summaryrefslogtreecommitdiff
path: root/src/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmake')
-rw-r--r--src/cmake/modules/GUDHI_modules.cmake7
-rw-r--r--src/cmake/modules/GUDHI_third_party_libraries.cmake44
2 files changed, 13 insertions, 38 deletions
diff --git a/src/cmake/modules/GUDHI_modules.cmake b/src/cmake/modules/GUDHI_modules.cmake
index aab1dd08..ccaf1ac5 100644
--- a/src/cmake/modules/GUDHI_modules.cmake
+++ b/src/cmake/modules/GUDHI_modules.cmake
@@ -30,7 +30,12 @@ if (WITH_GUDHI_EXAMPLE)
set(GUDHI_SUB_DIRECTORIES "${GUDHI_SUB_DIRECTORIES};example")
endif()
if (WITH_GUDHI_TEST)
- set(GUDHI_SUB_DIRECTORIES "${GUDHI_SUB_DIRECTORIES};test")
+ # All tests are using boost tests
+ if(TARGET Boost::unit_test_framework)
+ set(GUDHI_SUB_DIRECTORIES "${GUDHI_SUB_DIRECTORIES};test")
+ else()
+ message("++ WITH_GUDHI_TEST but no TARGET Boost::unit_test_framework")
+ endif()
endif()
if (WITH_GUDHI_UTILITIES)
set(GUDHI_SUB_DIRECTORIES "${GUDHI_SUB_DIRECTORIES};utilities")
diff --git a/src/cmake/modules/GUDHI_third_party_libraries.cmake b/src/cmake/modules/GUDHI_third_party_libraries.cmake
index a56a2756..e1566877 100644
--- a/src/cmake/modules/GUDHI_third_party_libraries.cmake
+++ b/src/cmake/modules/GUDHI_third_party_libraries.cmake
@@ -1,42 +1,11 @@
# This files manage third party libraries required by GUDHI
-find_package(Boost 1.56.0 REQUIRED COMPONENTS system filesystem unit_test_framework program_options thread)
+find_package(Boost 1.56.0 QUIET OPTIONAL_COMPONENTS filesystem unit_test_framework program_options)
-if(NOT Boost_FOUND)
+# Boost_FOUND is not reliable
+if(NOT Boost_VERSION)
message(FATAL_ERROR "NOTICE: This program requires Boost and will not be compiled.")
-endif(NOT Boost_FOUND)
-
-# cf. https://cliutils.gitlab.io/modern-cmake/chapters/packages/Boost.html
-# This is needed if your Boost version is newer than your CMake version
-# or if you have an old version of CMake (<3.5)
-if(NOT TARGET Boost::program_options)
- add_library(Boost::program_options IMPORTED INTERFACE)
- set_property(TARGET Boost::program_options PROPERTY
- INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR})
- set_property(TARGET Boost::program_options PROPERTY
- INTERFACE_LINK_LIBRARIES ${Boost_LIBRARIES})
-endif()
-if(NOT TARGET Boost::filesystem)
- add_library(Boost::filesystem IMPORTED INTERFACE)
- set_property(TARGET Boost::filesystem PROPERTY
- INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR})
- set_property(TARGET Boost::filesystem PROPERTY
- INTERFACE_LINK_LIBRARIES ${Boost_LIBRARIES})
-endif()
-if(NOT TARGET Boost::unit_test_framework)
- add_library(Boost::unit_test_framework IMPORTED INTERFACE)
- set_property(TARGET Boost::unit_test_framework PROPERTY
- INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR})
- set_property(TARGET Boost::unit_test_framework PROPERTY
- INTERFACE_LINK_LIBRARIES ${Boost_LIBRARIES})
-endif()
-if(NOT TARGET Boost::system)
- add_library(Boost::system IMPORTED INTERFACE)
- set_property(TARGET Boost::system PROPERTY
- INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIR})
- set_property(TARGET Boost::system PROPERTY
- INTERFACE_LINK_LIBRARIES ${Boost_LIBRARIES})
-endif()
+endif(NOT Boost_VERSION)
find_package(GMP)
if(GMP_FOUND)
@@ -137,8 +106,8 @@ function( find_python_module PYTHON_MODULE_NAME )
OUTPUT_VARIABLE PYTHON_MODULE_VERSION
ERROR_VARIABLE PYTHON_MODULE_ERROR)
if(PYTHON_MODULE_RESULT EQUAL 0)
- # Remove carriage return
- string(STRIP ${PYTHON_MODULE_VERSION} PYTHON_MODULE_VERSION)
+ # Remove all carriage returns as it can be multiline
+ string(REGEX REPLACE "\n" " " PYTHON_MODULE_VERSION "${PYTHON_MODULE_VERSION}")
message ("++ Python module ${PYTHON_MODULE_NAME} - Version ${PYTHON_MODULE_VERSION} found")
set(${PYTHON_MODULE_NAME_UP}_VERSION ${PYTHON_MODULE_VERSION} PARENT_SCOPE)
@@ -186,6 +155,7 @@ if( PYTHONINTERP_FOUND )
find_python_module("pykeops")
find_python_module("eagerpy")
find_python_module_no_version("hnswlib")
+ find_python_module("tensorflow")
endif()
if(NOT GUDHI_PYTHON_PATH)