From 5eaab18b4f5b0aee91237d2b410048a6903e084a Mon Sep 17 00:00:00 2001 From: Olivier Parcollet Date: Sat, 18 Oct 2014 11:36:26 +0200 Subject: [PATCH] [cmake] Minor modif. C++14 in definition for apps. - Change the message for cmake of apps (was misleading C++11 while 14). - minor cleaning --- cmake/FindCompilerCheck.cmake | 5 +++-- cmake/TRIQSConfig.cmake.in | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cmake/FindCompilerCheck.cmake b/cmake/FindCompilerCheck.cmake index 42ca9b06..c1ca6697 100644 --- a/cmake/FindCompilerCheck.cmake +++ b/cmake/FindCompilerCheck.cmake @@ -81,9 +81,10 @@ endif(compiler_version VERSION_LESS ${compiler_version_min} ) # on OS X : for clang, add the infamous -stdlib=libc++ IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if (CMAKE_COMPILER_IS_CLANG) - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ ") + #set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ ") + set(TRIQS_CXX_DEFINITIONS ${TRIQS_CXX_DEFINITIONS} " -stdlib=libc++ -Wno-deprecated-writable-strings ") MESSAGE(STATUS "Adding compilation flags -stdlib=libc++ ") - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-writable-strings ") + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ ") else (CMAKE_COMPILER_IS_CLANG) MESSAGE( WARNING "${line_of_star}You are on Os X but your are not using clang. This is NOT recommended...${line_of_star}") endif (CMAKE_COMPILER_IS_CLANG) diff --git a/cmake/TRIQSConfig.cmake.in b/cmake/TRIQSConfig.cmake.in index d0428850..0c9db076 100644 --- a/cmake/TRIQSConfig.cmake.in +++ b/cmake/TRIQSConfig.cmake.in @@ -58,8 +58,11 @@ endmacro(triqs_get_git_hash) # Python specific stuff set (TRIQS_PYTHON_INTERPRETER @PYTHON_INTERPRETER@) -message(STATUS "TRIQS : Adding C++11 compilation flags -std=c++11 ") -set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x ") +message(STATUS "TRIQS : Adding compilation flags detected by the library (C++11/14, libc++, etc...) ") +add_definitions(${TRIQS_CXX_DEFINITIONS}) +#set( CMAKE_CXX_FLAGS "${TRIQS_CXX_DEFINITIONS} ${CMAKE_CXX_FLAGS} ") +#message(STATUS "TRIQS : Adding C++11 compilation flags -std=c++11 ") +#set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x ") #add_definitions( -std=c++0x) # Check compiler @@ -70,7 +73,7 @@ endif() if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ ") - message(STATUS "TRIQS : Adding C++11 compilation flags for Os X: -stdlib=libc++ ") + message(STATUS "TRIQS : Adding C++11/14 compilation flags for Os X: -stdlib=libc++ ") else () message( WARNING "${line_of_star}You are on Os X but your are not using clang. This is NOT recommended...${line_of_star}") endif ()