From fb348a5b3416eab84a1cd872c7fb3d09987d473a Mon Sep 17 00:00:00 2001 From: Debian Science Team Date: Wed, 13 Jan 2021 10:55:53 +1100 Subject: [PATCH] enable_CGAL5_CXX14 =================================================================== Gbp-Pq: Name enable_CGAL5_CXX14.patch --- CMakeLists.txt | 12 +++++++++--- python/setup.py | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78fee4a..ea1d5dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ endif() # CGAL setup option(USE_SYSTEM_CGAL "Do not build CGAL, but use an existing build instead." OFF) if (USE_SYSTEM_CGAL) - find_package(CGAL 4.12 CONFIG REQUIRED) + find_package(CGAL CONFIG REQUIRED) endif() # Borrow some cmake modules from cgal @@ -43,8 +43,8 @@ MACRO(LIST_CONTAINS var value) ENDFOREACH (value2) ENDMACRO(LIST_CONTAINS) -# Use C++11 -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall") +# Use C++14 to support std:enable_if used by CGAL 5 +set(CMAKE_CXX_STANDARD 14) # Boost # This is workaround to avoid that find_package(Boost) @@ -158,6 +158,9 @@ target_link_libraries( mshr ${Boost_MSHR_LIBRARIES} ) +# CMAKE_CXX_STANDARD is ignored ;( Need to set standard manually here. +set_property(TARGET mshr PROPERTY CXX_STANDARD 14) + # install library install(TARGETS mshr RUNTIME DESTINATION ${INSTALL_BIN_DIR} @@ -175,6 +178,9 @@ if (ENABLE_MSHRABLE) ${Boost_MSHR_LIBRARIES} ) +# CMAKE_CXX_STANDARD is ignored ;( Need to set standard manually here. +set_property(TARGET mshrable PROPERTY CXX_STANDARD 14) + # install app install(TARGETS mshrable RUNTIME DESTINATION ${INSTALL_BIN_DIR} diff --git a/python/setup.py b/python/setup.py index 2ead3e7..2dde610 100644 --- a/python/setup.py +++ b/python/setup.py @@ -27,8 +27,8 @@ mshr_ext = Extension('mshr.cpp', include_dirs=include_dirs, library_dirs=config['mshr']['lib_dirs'].split(";"), libraries=config['mshr']['libs'].split(";"), - extra_compile_args=['-std=c++11'], - language='c++11') + extra_compile_args=['-std=c++14'], + language='c++14') setup(name = 'mshr', -- 2.30.2