summaryrefslogtreecommitdiff
path: root/src/cmake/modules/GUDHI_third_party_libraries.cmake
diff options
context:
space:
mode:
authorGard Spreemann <gspr@nonempty.org>2020-12-16 15:17:15 +0100
committerGard Spreemann <gspr@nonempty.org>2020-12-16 15:17:15 +0100
commit289baa1aadd248940439698173caaa345ac0ba3d (patch)
tree719f4cee23b2eb5b98b51fb7520336df920024ae /src/cmake/modules/GUDHI_third_party_libraries.cmake
parent5a450e1d5e0faac25085fb96d756d5963d0a15c4 (diff)
parentb6a3def70b15baf2dda0844762dcd291e240d2c1 (diff)
Merge branch 'dfsg/latest' into debian/sid
Diffstat (limited to 'src/cmake/modules/GUDHI_third_party_libraries.cmake')
-rw-r--r--src/cmake/modules/GUDHI_third_party_libraries.cmake44
1 files changed, 7 insertions, 37 deletions
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)