From 64f04c1f15d9ccc4311d162d988c35a3d4130ace Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 14 Apr 2017 16:00:00 +0000 Subject: Remove scripts/generate_version.sh, use make user_version Remove GUDHIVersion.cmake.in (was for scripts/generate_version.sh) and CMakeLists.txt mechanism Modify src/Bitmap_cubical_complex/example/CMakeLists.txt to generate files in build directory git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@2358 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 32c73be6aa9a0a6fcfde09ebf21ff38d48abf5e0 --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index aef771d0..35604652 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 2.6) project(GUDHIdev) include(CMakeGUDHIVersion.txt) -# Generate GUDHI official version file -configure_file(GUDHIVersion.cmake.in "${CMAKE_SOURCE_DIR}/GUDHIVersion.cmake" @ONLY) set(CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/src/cmake/modules/") set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/src/cmake/modules/") -- cgit v1.2.3 From 2f63617adf4ea8b2fe07c6125d7f582b978cb922 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 18 Apr 2017 13:24:54 +0000 Subject: Rename CMake tests Add specific GUDHI test coverage function Rename cmake/modules/GUDHI_*.txt git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/add_test_windows@2362 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 071b1eda7d11b1781a9601a013b88a0b2a9b7bf7 --- CMakeLists.txt | 4 +- data/points/generator/CMakeLists.txt | 19 +-- data/points/generator/README | 8 +- src/Alpha_complex/example/CMakeLists.txt | 28 ++-- src/Alpha_complex/test/CMakeLists.txt | 19 +-- src/CMakeLists.txt | 4 +- src/cmake/modules/GUDHI_doxygen_target.cmake | 11 ++ src/cmake/modules/GUDHI_doxygen_target.txt | 11 -- src/cmake/modules/GUDHI_test_coverage.cmake | 15 +++ .../modules/GUDHI_third_party_libraries.cmake | 144 +++++++++++++++++++++ src/cmake/modules/GUDHI_third_party_libraries.txt | 144 --------------------- 11 files changed, 209 insertions(+), 198 deletions(-) create mode 100644 src/cmake/modules/GUDHI_doxygen_target.cmake delete mode 100644 src/cmake/modules/GUDHI_doxygen_target.txt create mode 100644 src/cmake/modules/GUDHI_test_coverage.cmake create mode 100644 src/cmake/modules/GUDHI_third_party_libraries.cmake delete mode 100644 src/cmake/modules/GUDHI_third_party_libraries.txt (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 35604652..324f8648 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,11 +13,11 @@ enable_testing() # For "make user_version" include("${CMAKE_MODULE_PATH}/GUDHI_user_version_target.txt") # For "make doxygen" -include("${CMAKE_MODULE_PATH}/GUDHI_doxygen_target.txt") +include(GUDHI_doxygen_target) # This variable is used by Cython CMakeLists.txt to know its path set(GUDHI_CYTHON_PATH "src/cython") # For third parties libraries management - To be done last as CGAL updates CMAKE_MODULE_PATH -include("${CMAKE_MODULE_PATH}/GUDHI_third_party_libraries.txt") +include(GUDHI_third_party_libraries) if(MSVC) # Turn off some VC++ warnings diff --git a/data/points/generator/CMakeLists.txt b/data/points/generator/CMakeLists.txt index 9a7f7bce..88d377a7 100644 --- a/data/points/generator/CMakeLists.txt +++ b/data/points/generator/CMakeLists.txt @@ -1,14 +1,15 @@ cmake_minimum_required(VERSION 2.6) -project(Data_points_generator) +project(data_points_generator) if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) - add_executable ( hypergenerator hypergenerator.cpp ) - target_link_libraries(hypergenerator ${Boost_SYSTEM_LIBRARY}) - add_test(hypergenerator_on_sphere_3000_10_5.0 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator on sphere onSphere.off 3000 10 5.0) - add_test(hypergenerator_on_sphere_10000_3 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator on sphere onSphere.off 10000 3) - add_test(hypergenerator_in_sphere_7000_12_10.8 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator in sphere inSphere.off 7000 12 10.8) - add_test(hypergenerator_in_sphere_50000_2 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator in sphere inSphere.off 50000 2) + add_executable ( data_points_generator hypergenerator.cpp ) + target_link_libraries(data_points_generator ${Boost_SYSTEM_LIBRARY}) + add_test(NAME data_points_generator_on_sphere_1000_3_15.2 COMMAND $ + "on" "sphere" "onSphere.off" "1000" "3" "15.2") + add_test(NAME data_points_generator_in_sphere_100_2 COMMAND $ + "in" "sphere" "inSphere.off" "100" "2") + # on cube is not available in CGAL - add_test(hypergenerator_in_cube_7000_12_10.8 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator in cube inCube.off 7000 12 10.8) - add_test(hypergenerator_in_cube_50000_2 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator in cube inCube.off 50000 3) + add_test(NAME data_points_generator_in_cube_10000_3_5.8 COMMAND $ + "in" "cube" "inCube.off" "10000" "3" "5.8") endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0) diff --git a/data/points/generator/README b/data/points/generator/README index 41cb9165..951bcfe1 100644 --- a/data/points/generator/README +++ b/data/points/generator/README @@ -7,21 +7,21 @@ cmake . cd /path-to-data-generator/ make -=========================== hypergenerator ===================================== +======================= data_points_generator ================================== Example of use : *** Hyper sphere|cube generator -./hypergenerator on sphere onSphere.off 1000 3 15.2 +./data_points_generator on sphere onSphere.off 1000 3 15.2 => generates a onSphere.off file with 1000 points randomized on a sphere of dimension 3 and radius 15.2 -./hypergenerator in sphere inSphere.off 100 2 +./data_points_generator in sphere inSphere.off 100 2 => generates a inSphere.off file with 100 points randomized in a sphere of dimension 2 (circle) and radius 1.0 (default) -./hypergenerator in cube inCube.off 10000 3 5.8 +./data_points_generator in cube inCube.off 10000 3 5.8 => generates a inCube.off file with 10000 points randomized in a cube of dimension 3 and side 5.8 diff --git a/src/Alpha_complex/example/CMakeLists.txt b/src/Alpha_complex/example/CMakeLists.txt index b9bcdb55..ab09fe91 100644 --- a/src/Alpha_complex/example/CMakeLists.txt +++ b/src/Alpha_complex/example/CMakeLists.txt @@ -4,26 +4,30 @@ project(Alpha_complex_examples) # need CGAL 4.7 # cmake -DCGAL_DIR=~/workspace/CGAL-4.7 .. if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) - add_executable ( alphapoints Alpha_complex_from_points.cpp ) - target_link_libraries(alphapoints ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY}) - add_executable ( alphaoffreader Alpha_complex_from_off.cpp ) - target_link_libraries(alphaoffreader ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY}) + add_executable ( Alpha_complex_example_from_points Alpha_complex_from_points.cpp ) + target_link_libraries(Alpha_complex_example_from_points ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY}) + add_executable ( Alpha_complex_example_from_off Alpha_complex_from_off.cpp ) + target_link_libraries(Alpha_complex_example_from_off ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY}) if (TBB_FOUND) - target_link_libraries(alphapoints ${TBB_LIBRARIES}) - target_link_libraries(alphaoffreader ${TBB_LIBRARIES}) + target_link_libraries(Alpha_complex_example_from_points ${TBB_LIBRARIES}) + target_link_libraries(Alpha_complex_example_from_off ${TBB_LIBRARIES}) endif() - add_test(alphapoints ${CMAKE_CURRENT_BINARY_DIR}/alphapoints) + add_test(NAME Alpha_complex_example_from_points COMMAND $) + # Do not forget to copy test files in current binary dir - file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) - add_test(alphaoffreader_doc_60 ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader alphacomplexdoc.off 60.0 ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_60.txt) - add_test(alphaoffreader_doc_32 ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader alphacomplexdoc.off 32.0 ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_32.txt) + add_test(NAME Alpha_complex_example_from_off_60 COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" "60.0" "${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_60.txt") + add_test(NAME Alpha_complex_example_from_off_32 COMMAND $ + "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" "32.0" "${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_32.txt") if (DIFF_PATH) # Do not forget to copy test results files in current binary dir file(COPY "alphaoffreader_for_doc_32.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) file(COPY "alphaoffreader_for_doc_60.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) - add_test(alphaoffreader_doc_60_diff_files ${DIFF_PATH} ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_60.txt ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_for_doc_60.txt) - add_test(alphaoffreader_doc_32_diff_files ${DIFF_PATH} ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_32.txt ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_for_doc_32.txt) + add_test(Alpha_complex_example_from_off_60_diff_files ${DIFF_PATH} + ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_60.txt ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_for_doc_60.txt) + add_test(Alpha_complex_example_from_off_32_diff_files ${DIFF_PATH} + ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_32.txt ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_for_doc_32.txt) endif() endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) diff --git a/src/Alpha_complex/test/CMakeLists.txt b/src/Alpha_complex/test/CMakeLists.txt index 32091196..59f86c5b 100644 --- a/src/Alpha_complex/test/CMakeLists.txt +++ b/src/Alpha_complex/test/CMakeLists.txt @@ -1,28 +1,19 @@ cmake_minimum_required(VERSION 2.6) project(Alpha_complex_tests) -if (GCOVR_PATH) - # for gcovr to make coverage reports - Corbera Jenkins plugin - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") -endif() -if (GPROF_PATH) - # for gprof to make coverage reports - Jenkins - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") -endif() +include(GUDHI_test_coverage) if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) - add_executable ( AlphaComplexUT Alpha_complex_unit_test.cpp ) - target_link_libraries(AlphaComplexUT ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) + add_executable ( Alpha_complex_unit_test Alpha_complex_unit_test.cpp ) + target_link_libraries(Alpha_complex_unit_test ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) if (TBB_FOUND) - target_link_libraries(AlphaComplexUT ${TBB_LIBRARIES}) + target_link_libraries(Alpha_complex_unit_test ${TBB_LIBRARIES}) endif() # Do not forget to copy test files in current binary dir file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) - add_test(AlphaComplexUT ${CMAKE_CURRENT_BINARY_DIR}/AlphaComplexUT - # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/AlphaComplexUT.xml --log_level=test_suite --report_level=no) + gudhi_add_coverage_test(Alpha_complex_unit_test) endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 708f3649..ebcb6888 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,12 +9,12 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/") # For "make doxygen" set(GUDHI_USER_VERSION_DIR ${CMAKE_SOURCE_DIR}) -include(${CMAKE_MODULE_PATH}/GUDHI_doxygen_target.txt) +include(GUDHI_doxygen_target) # This variable is used by Cython CMakeLists.txt to know its path set(GUDHI_CYTHON_PATH "cython") # For third parties libraries management - To be done last as CGAL updates CMAKE_MODULE_PATH -include("${CMAKE_MODULE_PATH}/GUDHI_third_party_libraries.txt") +include(GUDHI_third_party_libraries) if(MSVC) # Turn off some VC++ warnings diff --git a/src/cmake/modules/GUDHI_doxygen_target.cmake b/src/cmake/modules/GUDHI_doxygen_target.cmake new file mode 100644 index 00000000..d2cb952d --- /dev/null +++ b/src/cmake/modules/GUDHI_doxygen_target.cmake @@ -0,0 +1,11 @@ +# add a target to generate API documentation with Doxygen +find_package(Doxygen) +if(DOXYGEN_FOUND) + # configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) + + add_custom_target(doxygen ${DOXYGEN_EXECUTABLE} ${GUDHI_USER_VERSION_DIR}/Doxyfile + WORKING_DIRECTORY ${GUDHI_USER_VERSION_DIR} + DEPENDS ${GUDHI_USER_VERSION_DIR}/Doxyfile ${GUDHI_DOXYGEN_DEPENDENCY} + COMMENT "Generating API documentation with Doxygen in ${GUDHI_USER_VERSION_DIR}/doc/html/" VERBATIM) + +endif(DOXYGEN_FOUND) diff --git a/src/cmake/modules/GUDHI_doxygen_target.txt b/src/cmake/modules/GUDHI_doxygen_target.txt deleted file mode 100644 index d2cb952d..00000000 --- a/src/cmake/modules/GUDHI_doxygen_target.txt +++ /dev/null @@ -1,11 +0,0 @@ -# add a target to generate API documentation with Doxygen -find_package(Doxygen) -if(DOXYGEN_FOUND) - # configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) - - add_custom_target(doxygen ${DOXYGEN_EXECUTABLE} ${GUDHI_USER_VERSION_DIR}/Doxyfile - WORKING_DIRECTORY ${GUDHI_USER_VERSION_DIR} - DEPENDS ${GUDHI_USER_VERSION_DIR}/Doxyfile ${GUDHI_DOXYGEN_DEPENDENCY} - COMMENT "Generating API documentation with Doxygen in ${GUDHI_USER_VERSION_DIR}/doc/html/" VERBATIM) - -endif(DOXYGEN_FOUND) diff --git a/src/cmake/modules/GUDHI_test_coverage.cmake b/src/cmake/modules/GUDHI_test_coverage.cmake new file mode 100644 index 00000000..bf7ad7e4 --- /dev/null +++ b/src/cmake/modules/GUDHI_test_coverage.cmake @@ -0,0 +1,15 @@ + +if (GCOVR_PATH) + # for gcovr to make coverage reports - Corbera Jenkins plugin + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") +endif() +if (GPROF_PATH) + # for gprof to make coverage reports - Jenkins + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") +endif() + +function(gudhi_add_coverage_test unitary_test) + message("++ ${CMAKE_BINARY_DIR}/${unitary_test}_UT.xml") + add_test(NAME ${unitary_test} COMMAND $ + "--log_format=XML" "--log_sink=${CMAKE_BINARY_DIR}/${unitary_test}_UT.xml" "--log_level=test_suite" "--report_level=no") +endfunction() diff --git a/src/cmake/modules/GUDHI_third_party_libraries.cmake b/src/cmake/modules/GUDHI_third_party_libraries.cmake new file mode 100644 index 00000000..5f84c602 --- /dev/null +++ b/src/cmake/modules/GUDHI_third_party_libraries.cmake @@ -0,0 +1,144 @@ +# This files manage third party libraries required by GUDHI + +find_package(Boost REQUIRED COMPONENTS system filesystem unit_test_framework chrono timer date_time program_options thread) + +if(NOT Boost_FOUND) + message(FATAL_ERROR "NOTICE: This program requires Boost and will not be compiled.") +endif(NOT Boost_FOUND) + +find_package(GMP) +if(GMP_FOUND) + message(STATUS "GMP_LIBRARIES = ${GMP_LIBRARIES}") + INCLUDE_DIRECTORIES(${GMP_INCLUDE_DIR}) + find_package(GMPXX) + if(GMPXX_FOUND) + message(STATUS "GMPXX_LIBRARIES = ${GMPXX_LIBRARIES}") + INCLUDE_DIRECTORIES(${GMPXX_INCLUDE_DIR}) + endif() +endif() + +# In CMakeLists.txt, when include(${CGAL_USE_FILE}), CMAKE_CXX_FLAGS are overwritten. +# cf. http://doc.cgal.org/latest/Manual/installation.html#title40 +# A workaround is to include(${CGAL_USE_FILE}) before adding "-std=c++11". +# A fix would be to use https://cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html +# or even better https://cmake.org/cmake/help/v3.1/variable/CMAKE_CXX_STANDARD.html +# but it implies to use cmake version 3.1 at least. +find_package(CGAL) + +# Only CGAL versions > 4.4 supports what Gudhi uses from CGAL +if (CGAL_VERSION VERSION_LESS 4.4.0) + message("CGAL version ${CGAL_VERSION} is considered too old to be used by Gudhi.") + unset(CGAL_FOUND) +endif() +if(CGAL_FOUND) + message(STATUS "CGAL version: ${CGAL_VERSION}.") + include( ${CGAL_USE_FILE} ) + + if (NOT CGAL_VERSION VERSION_LESS 4.8.0) + # HACK to detect CGAL version 4.8.0 + # CGAL version 4.8, 4.8.1 and 4.8.2 are identified as version 4.8.1000) + # cf. https://github.com/CGAL/cgal/issues/1559 + # Limit the HACK between CGAL versions 4.8 and 4.9 because of file read + if (NOT CGAL_VERSION VERSION_GREATER 4.9.0) + foreach(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIRS}) + if (EXISTS "${CGAL_INCLUDE_DIR}/CGAL/version.h") + FILE(READ "${CGAL_INCLUDE_DIR}/CGAL/version.h" contents) + STRING(REGEX REPLACE "\n" ";" contents "${contents}") + foreach(Line ${contents}) + if("${Line}" STREQUAL "#define CGAL_VERSION 4.8") + set(CGAL_VERSION 4.8.0) + message (">>>>> HACK CGAL version to ${CGAL_VERSION}") + endif("${Line}" STREQUAL "#define CGAL_VERSION 4.8") + endforeach(Line ${contents}) + endif (EXISTS "${CGAL_INCLUDE_DIR}/CGAL/version.h") + endforeach(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIRS}) + endif(NOT CGAL_VERSION VERSION_GREATER 4.9.0) + + # For dev version + include_directories(BEFORE "src/common/include/gudhi_patches") + # For user version + include_directories(BEFORE "include/gudhi_patches") + endif() +endif() + +# Find TBB package for parallel sort - not mandatory, just optional. +set(TBB_FIND_QUIETLY ON) +find_package(TBB) +if (TBB_FOUND) + include(${TBB_USE_FILE}) + message("TBB found in ${TBB_LIBRARY_DIRS}") + add_definitions(-DGUDHI_USE_TBB) +endif() + +set(CGAL_WITH_EIGEN3_VERSION 0.0.0) +find_package(Eigen3 3.1.0) +if (EIGEN3_FOUND) + message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") + include( ${EIGEN3_USE_FILE} ) + set(CGAL_WITH_EIGEN3_VERSION ${CGAL_VERSION}) +endif (EIGEN3_FOUND) + +# Required programs for unitary tests purpose +FIND_PROGRAM( GCOVR_PATH gcovr ) +if (GCOVR_PATH) + message("gcovr found in ${GCOVR_PATH}") +endif() +# Required programs for unitary tests purpose +FIND_PROGRAM( GPROF_PATH gprof ) +if (GPROF_PATH) + message("gprof found in ${GPROF_PATH}") +endif() +FIND_PROGRAM( DIFF_PATH diff ) +if (DIFF_PATH) + message("diff found in ${DIFF_PATH}") +endif() + +# BOOST ISSUE result_of vs C++11 +add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE) +# BOOST ISSUE with Libraries name resolution under Windows +add_definitions(-DBOOST_ALL_NO_LIB) +# problem with Visual Studio link on Boost program_options +add_definitions( -DBOOST_ALL_DYN_LINK ) + +INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) +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. +find_package(Cython) + +if(NOT GUDHI_CYTHON_PATH) + message(FATAL_ERROR "ERROR: GUDHI_CYTHON_PATH is not valid.") +endif(NOT GUDHI_CYTHON_PATH) + +if(PYTHONINTERP_FOUND AND CYTHON_FOUND) + # Unitary tests are available through py.test + find_program( PYTEST_PATH py.test ) + # Default found version 2 + if(PYTHON_VERSION_MAJOR EQUAL 2) + # Documentation generation is available through sphinx + find_program( SPHINX_PATH sphinx-build ) + elseif(PYTHON_VERSION_MAJOR EQUAL 3) + # 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 AND CYTHON_FOUND) + diff --git a/src/cmake/modules/GUDHI_third_party_libraries.txt b/src/cmake/modules/GUDHI_third_party_libraries.txt deleted file mode 100644 index 5f84c602..00000000 --- a/src/cmake/modules/GUDHI_third_party_libraries.txt +++ /dev/null @@ -1,144 +0,0 @@ -# This files manage third party libraries required by GUDHI - -find_package(Boost REQUIRED COMPONENTS system filesystem unit_test_framework chrono timer date_time program_options thread) - -if(NOT Boost_FOUND) - message(FATAL_ERROR "NOTICE: This program requires Boost and will not be compiled.") -endif(NOT Boost_FOUND) - -find_package(GMP) -if(GMP_FOUND) - message(STATUS "GMP_LIBRARIES = ${GMP_LIBRARIES}") - INCLUDE_DIRECTORIES(${GMP_INCLUDE_DIR}) - find_package(GMPXX) - if(GMPXX_FOUND) - message(STATUS "GMPXX_LIBRARIES = ${GMPXX_LIBRARIES}") - INCLUDE_DIRECTORIES(${GMPXX_INCLUDE_DIR}) - endif() -endif() - -# In CMakeLists.txt, when include(${CGAL_USE_FILE}), CMAKE_CXX_FLAGS are overwritten. -# cf. http://doc.cgal.org/latest/Manual/installation.html#title40 -# A workaround is to include(${CGAL_USE_FILE}) before adding "-std=c++11". -# A fix would be to use https://cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html -# or even better https://cmake.org/cmake/help/v3.1/variable/CMAKE_CXX_STANDARD.html -# but it implies to use cmake version 3.1 at least. -find_package(CGAL) - -# Only CGAL versions > 4.4 supports what Gudhi uses from CGAL -if (CGAL_VERSION VERSION_LESS 4.4.0) - message("CGAL version ${CGAL_VERSION} is considered too old to be used by Gudhi.") - unset(CGAL_FOUND) -endif() -if(CGAL_FOUND) - message(STATUS "CGAL version: ${CGAL_VERSION}.") - include( ${CGAL_USE_FILE} ) - - if (NOT CGAL_VERSION VERSION_LESS 4.8.0) - # HACK to detect CGAL version 4.8.0 - # CGAL version 4.8, 4.8.1 and 4.8.2 are identified as version 4.8.1000) - # cf. https://github.com/CGAL/cgal/issues/1559 - # Limit the HACK between CGAL versions 4.8 and 4.9 because of file read - if (NOT CGAL_VERSION VERSION_GREATER 4.9.0) - foreach(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIRS}) - if (EXISTS "${CGAL_INCLUDE_DIR}/CGAL/version.h") - FILE(READ "${CGAL_INCLUDE_DIR}/CGAL/version.h" contents) - STRING(REGEX REPLACE "\n" ";" contents "${contents}") - foreach(Line ${contents}) - if("${Line}" STREQUAL "#define CGAL_VERSION 4.8") - set(CGAL_VERSION 4.8.0) - message (">>>>> HACK CGAL version to ${CGAL_VERSION}") - endif("${Line}" STREQUAL "#define CGAL_VERSION 4.8") - endforeach(Line ${contents}) - endif (EXISTS "${CGAL_INCLUDE_DIR}/CGAL/version.h") - endforeach(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIRS}) - endif(NOT CGAL_VERSION VERSION_GREATER 4.9.0) - - # For dev version - include_directories(BEFORE "src/common/include/gudhi_patches") - # For user version - include_directories(BEFORE "include/gudhi_patches") - endif() -endif() - -# Find TBB package for parallel sort - not mandatory, just optional. -set(TBB_FIND_QUIETLY ON) -find_package(TBB) -if (TBB_FOUND) - include(${TBB_USE_FILE}) - message("TBB found in ${TBB_LIBRARY_DIRS}") - add_definitions(-DGUDHI_USE_TBB) -endif() - -set(CGAL_WITH_EIGEN3_VERSION 0.0.0) -find_package(Eigen3 3.1.0) -if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) - set(CGAL_WITH_EIGEN3_VERSION ${CGAL_VERSION}) -endif (EIGEN3_FOUND) - -# Required programs for unitary tests purpose -FIND_PROGRAM( GCOVR_PATH gcovr ) -if (GCOVR_PATH) - message("gcovr found in ${GCOVR_PATH}") -endif() -# Required programs for unitary tests purpose -FIND_PROGRAM( GPROF_PATH gprof ) -if (GPROF_PATH) - message("gprof found in ${GPROF_PATH}") -endif() -FIND_PROGRAM( DIFF_PATH diff ) -if (DIFF_PATH) - message("diff found in ${DIFF_PATH}") -endif() - -# BOOST ISSUE result_of vs C++11 -add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE) -# BOOST ISSUE with Libraries name resolution under Windows -add_definitions(-DBOOST_ALL_NO_LIB) -# problem with Visual Studio link on Boost program_options -add_definitions( -DBOOST_ALL_DYN_LINK ) - -INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -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. -find_package(Cython) - -if(NOT GUDHI_CYTHON_PATH) - message(FATAL_ERROR "ERROR: GUDHI_CYTHON_PATH is not valid.") -endif(NOT GUDHI_CYTHON_PATH) - -if(PYTHONINTERP_FOUND AND CYTHON_FOUND) - # Unitary tests are available through py.test - find_program( PYTEST_PATH py.test ) - # Default found version 2 - if(PYTHON_VERSION_MAJOR EQUAL 2) - # Documentation generation is available through sphinx - find_program( SPHINX_PATH sphinx-build ) - elseif(PYTHON_VERSION_MAJOR EQUAL 3) - # 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 AND CYTHON_FOUND) - -- cgit v1.2.3