summaryrefslogtreecommitdiff
path: root/src/cmake
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-05-28 15:45:15 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2018-05-28 15:45:15 +0000
commitaa12266a274c835adef5950a54ebdaa9fb68b89e (patch)
treeb3b335ec4bf2069c3925c39507c3ad67cd810442 /src/cmake
parent5fd7f8f63704131228a57c6292743295a25db11e (diff)
parenta4cc98d569c63d04729242e1cabe7a0e49ed3908 (diff)
Merge last trunk modifications
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/cechcomplex_vincent@3479 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 95377921626dc6294d4560571023692567db49b7
Diffstat (limited to 'src/cmake')
-rw-r--r--src/cmake/modules/GUDHI_compilation_flags.cmake35
-rw-r--r--src/cmake/modules/GUDHI_third_party_libraries.cmake4
-rw-r--r--src/cmake/modules/GUDHI_user_version_target.cmake2
3 files changed, 38 insertions, 3 deletions
diff --git a/src/cmake/modules/GUDHI_compilation_flags.cmake b/src/cmake/modules/GUDHI_compilation_flags.cmake
new file mode 100644
index 00000000..394f1f42
--- /dev/null
+++ b/src/cmake/modules/GUDHI_compilation_flags.cmake
@@ -0,0 +1,35 @@
+# This files manage compilation flags required by GUDHI
+
+include(TestCXXAcceptsFlag)
+
+# add a compiler flag only if it is accepted
+macro(add_cxx_compiler_flag _flag)
+ string(REPLACE "-" "_" _flag_var ${_flag})
+ check_cxx_accepts_flag("${_flag}" CXX_COMPILER_${_flag_var}_OK)
+ if(CXX_COMPILER_${_flag_var}_OK)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
+ endif()
+endmacro()
+
+set (CMAKE_CXX_STANDARD 11)
+
+enable_testing()
+
+if(MSVC)
+ # Turn off some VC++ warnings
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018")
+endif()
+
+add_cxx_compiler_flag("-Wall")
+
+if(CMAKE_BUILD_TYPE MATCHES Debug)
+ message("++ Debug compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+else()
+ message("++ Release compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
+endif()
+
+if (DEBUG_TRACES)
+ # For programs to be more verbose
+ message(STATUS "DEBUG_TRACES are activated")
+ add_definitions(-DDEBUG_TRACES)
+endif()
diff --git a/src/cmake/modules/GUDHI_third_party_libraries.cmake b/src/cmake/modules/GUDHI_third_party_libraries.cmake
index a008dd0a..7433f2f3 100644
--- a/src/cmake/modules/GUDHI_third_party_libraries.cmake
+++ b/src/cmake/modules/GUDHI_third_party_libraries.cmake
@@ -54,12 +54,12 @@ if(CGAL_FOUND)
endforeach(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIRS})
endif(NOT CGAL_VERSION VERSION_GREATER 4.9.0)
- if (NOT CGAL_VERSION VERSION_GREATER 4.11.0)
+ if (CGAL_VERSION VERSION_LESS 4.11.0)
# For dev version
include_directories(BEFORE "src/common/include/gudhi_patches")
# For user version
include_directories(BEFORE "include/gudhi_patches")
- endif (NOT CGAL_VERSION VERSION_GREATER 4.11.0)
+ endif ()
endif()
endif()
diff --git a/src/cmake/modules/GUDHI_user_version_target.cmake b/src/cmake/modules/GUDHI_user_version_target.cmake
index 87141380..1205966a 100644
--- a/src/cmake/modules/GUDHI_user_version_target.cmake
+++ b/src/cmake/modules/GUDHI_user_version_target.cmake
@@ -48,7 +48,7 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.11)
copy_directory ${CMAKE_SOURCE_DIR}/src/GudhUI ${GUDHI_USER_VERSION_DIR}/GudhUI)
set(GUDHI_DIRECTORIES "doc;example;concept;utilities")
- if (NOT CGAL_VERSION VERSION_GREATER 4.11.0)
+ if (CGAL_VERSION VERSION_LESS 4.11.0)
set(GUDHI_INCLUDE_DIRECTORIES "include/gudhi;include/Miniball;include/gudhi_patches")
else ()
set(GUDHI_INCLUDE_DIRECTORIES "include/gudhi;include/Miniball")