summaryrefslogtreecommitdiff
path: root/src/Simplex_tree/example/CMakeLists.txt
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-02-04 12:17:04 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-02-04 12:17:04 +0000
commitd15e4b04a8b333d0adc09e321241a6a5daa9b94a (patch)
tree678746e1668728fa77277a68f375dd492353f99b /src/Simplex_tree/example/CMakeLists.txt
parentf4ac13983d5d977cab5c575184e9b21ee000485f (diff)
test with include CGAL_USE_FILE to fix windows issue
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/Win64_Boost_Xunit_fix@1000 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 11a5fb78933306cfc83951174b38a03837fef58a
Diffstat (limited to 'src/Simplex_tree/example/CMakeLists.txt')
-rw-r--r--src/Simplex_tree/example/CMakeLists.txt27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/Simplex_tree/example/CMakeLists.txt b/src/Simplex_tree/example/CMakeLists.txt
index c70cfe35..de75415d 100644
--- a/src/Simplex_tree/example/CMakeLists.txt
+++ b/src/Simplex_tree/example/CMakeLists.txt
@@ -14,11 +14,24 @@ add_test(mini_simplex_tree ${CMAKE_CURRENT_BINARY_DIR}/mini_simplex_tree)
# An example with Simplex-tree using CGAL alpha_shapes_3
if(GMP_FOUND AND CGAL_FOUND)
- message("CGAL_lib = ${CGAL_LIBRARIES_DIR}")
- message("GMP_LIBRARIES = ${GMP_LIBRARIES}")
- INCLUDE_DIRECTORIES(${GMP_INCLUDE_DIR})
- INCLUDE_DIRECTORIES(${CGAL_INCLUDE_DIRS})
- add_executable ( simplex_tree_from_alpha_shapes_3 simplex_tree_from_alpha_shapes_3.cpp )
- target_link_libraries(simplex_tree_from_alpha_shapes_3 ${GMP_LIBRARIES} ${CGAL_LIBRARY})
- add_test(simplex_tree_from_alpha_shapes_3 ${CMAKE_CURRENT_BINARY_DIR}/simplex_tree_from_alpha_shapes_3 ${CMAKE_SOURCE_DIR}/data/points/bunny_5000)
+ include( ${CGAL_USE_FILE} )
+ # In CMakeLists.txt, when include(${CGAL_USE_FILE}), CXX_FLAGS are overwritten.
+ # cf. http://doc.cgal.org/latest/Manual/installation.html#title40
+ # A workaround is to add "-std=c++11" again.
+ # 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.
+ if(NOT MSVC)
+ include(CheckCXXCompilerFlag)
+ CHECK_CXX_COMPILER_FLAG(-std=c++11 COMPILER_SUPPORTS_CXX11)
+ if(COMPILER_SUPPORTS_CXX11)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ endif()
+ endif()
+ # - End of workaround
+
+ INCLUDE_DIRECTORIES(${GMP_INCLUDE_DIR})
+ add_executable ( simplex_tree_from_alpha_shapes_3 simplex_tree_from_alpha_shapes_3.cpp )
+ target_link_libraries(simplex_tree_from_alpha_shapes_3 ${GMP_LIBRARIES} ${CGAL_LIBRARY})
+ add_test(simplex_tree_from_alpha_shapes_3 ${CMAKE_CURRENT_BINARY_DIR}/simplex_tree_from_alpha_shapes_3 ${CMAKE_SOURCE_DIR}/data/points/bunny_5000)
endif()