Discussion:
[PATCH] CMake: use find_package (SWIG) for cmake >= 3.0.0
Eneas U de Queiroz
2018-07-31 20:44:57 UTC
Permalink
There's a workaround for a bug (fixed in cmake 3.0.0) that does not
work in CMake 3.12. Only use the workaround with cmake < 3.0.0.

Signed-off-by: Eneas U de Queiroz <cote2004-***@yahoo.com>
---
python/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 4843396..7bdd9f9 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -1,5 +1,5 @@
# workaround for cmake bug #0013449
-if ( NOT DEFINED CMAKE_FIND_ROOT_PATH )
+if ( NOT DEFINED CMAKE_FIND_ROOT_PATH OR CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0 )
find_package ( SWIG REQUIRED )
else ()
find_program ( SWIG_EXECUTABLE NAMES swig2.0 swig )
--
2.16.4


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+***@developer.intra2net.com
Thomas Jarosch
2018-11-05 21:18:09 UTC
Permalink
Hi,
Post by Eneas U de Queiroz
There's a workaround for a bug (fixed in cmake 3.0.0) that does not
work in CMake 3.12. Only use the workaround with cmake < 3.0.0.
---
python/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 4843396..7bdd9f9 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -1,5 +1,5 @@
# workaround for cmake bug #0013449
-if ( NOT DEFINED CMAKE_FIND_ROOT_PATH )
+if ( NOT DEFINED CMAKE_FIND_ROOT_PATH OR CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0 )
find_package ( SWIG REQUIRED )
else ()
find_program ( SWIG_EXECUTABLE NAMES swig2.0 swig )
looks good to me, applied.

Still builds on Fedora 28 with cmake 3.11.2.

Cheers,
Thomas


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+***@developer.intra2net.com
Loading...