summaryrefslogtreecommitdiff
path: root/src/cmake/modules/GUDHI_third_party_libraries.txt
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-04-10 14:00:40 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-04-10 14:00:40 +0000
commit9661f87b543eb53d0473ceb147e95a7d61bd1763 (patch)
treeae88e18468240cbf71a90567dbbadb5f8ce67e2e /src/cmake/modules/GUDHI_third_party_libraries.txt
parentdd108b5a6c620b10675b7ebaf8d1561c2c165bf2 (diff)
parent2334cb2704e84792f3972ba7d3b45a7b9ee75f67 (diff)
Merge code reviews fix
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@2325 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 1a35ff8f60aee0bd150db7b571b13a50e843851a
Diffstat (limited to 'src/cmake/modules/GUDHI_third_party_libraries.txt')
-rw-r--r--src/cmake/modules/GUDHI_third_party_libraries.txt46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/cmake/modules/GUDHI_third_party_libraries.txt b/src/cmake/modules/GUDHI_third_party_libraries.txt
index 1974f70f..2ddc9f1f 100644
--- a/src/cmake/modules/GUDHI_third_party_libraries.txt
+++ b/src/cmake/modules/GUDHI_third_party_libraries.txt
@@ -105,3 +105,49 @@ LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
message(STATUS "boost include dirs:" ${Boost_INCLUDE_DIRS})
message(STATUS "boost library dirs:" ${Boost_LIBRARY_DIRS})
+
+macro( find_the_lib placeholder THE_LIBS )
+ set (THE_LIB_WE_FOUND "NO")
+ foreach(THE_LIB ${THE_LIBS})
+ if(EXISTS ${THE_LIB})
+ get_filename_component(THE_LIB_WE ${THE_LIB} NAME_WE)
+ if (NOT THE_LIB_WE_FOUND)
+ set (THE_LIB_WE_FOUND "YES")
+ set(returnValue "${THE_LIB_WE}")
+ endif(NOT THE_LIB_WE_FOUND)
+ endif(EXISTS ${THE_LIB})
+ endforeach(THE_LIB ${THE_LIBS})
+endmacro( find_the_lib )
+
+# Find the correct Python interpreter.
+# Can be set with -DPYTHON_EXECUTABLE=/usr/bin/python3 or -DPython_ADDITIONAL_VERSIONS=3 for instance.
+if(PYTHON_EXECUTABLE)
+ if(NOT EXISTS "${PYTHON_EXECUTABLE}")
+ message(FATAL_ERROR "ERROR: ${PYTHON_EXECUTABLE} does not exist.")
+ endif(NOT EXISTS "${PYTHON_EXECUTABLE}")
+endif(PYTHON_EXECUTABLE)
+find_package(PythonInterp)
+
+if(NOT GUDHI_CYTHON_PATH)
+ message(FATAL_ERROR "ERROR: GUDHI_CYTHON_PATH is not valid.")
+endif(NOT GUDHI_CYTHON_PATH)
+
+if(PYTHONINTERP_FOUND)
+ # Default found version 2
+ if(PYTHON_VERSION_MAJOR EQUAL 2)
+ FIND_PROGRAM(CYTHON_PATH cython)
+ # Unitary tests are available through py.test
+ find_program( PYTEST_PATH py.test )
+ # Documentation generation is available through sphinx
+ find_program( SPHINX_PATH sphinx-build )
+ elseif(PYTHON_VERSION_MAJOR EQUAL 3)
+ FIND_PROGRAM(CYTHON_PATH cython3)
+ # Unitary tests are available through py.test
+ find_program( PYTEST_PATH py.test )
+ # Documentation generation is available through sphinx
+ set(SPHINX_PATH "${CMAKE_SOURCE_DIR}/${GUDHI_CYTHON_PATH}/doc/python3-sphinx-build")
+ else()
+ message(FATAL_ERROR "ERROR: Try to compile the Cython interface. Python version ${PYTHON_VERSION_STRING} is not valid.")
+ endif(PYTHON_VERSION_MAJOR EQUAL 2)
+endif(PYTHONINTERP_FOUND)
+