[Jderobot-admin] jderobot-r1243 - trunk/src/stable/libs/log
frivas en jderobot.org
frivas en jderobot.org
Mar Oct 28 16:38:06 CET 2014
Author: frivas
Date: 2014-10-28 16:38:05 +0100 (Tue, 28 Oct 2014)
New Revision: 1243
Modified:
trunk/src/stable/libs/log/CMakeLists.txt
Log:
#283 solve issue with c++11 on debian stable (still named c++0x)
Modified: trunk/src/stable/libs/log/CMakeLists.txt
===================================================================
--- trunk/src/stable/libs/log/CMakeLists.txt 2014-10-23 21:27:06 UTC (rev 1242)
+++ trunk/src/stable/libs/log/CMakeLists.txt 2014-10-28 15:38:05 UTC (rev 1243)
@@ -3,10 +3,19 @@
set(SRC_FILES Logger.h Logger.cpp)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+ include(CheckCXXCompilerFlag)
+ CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+ CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
# Si el compilador es superior a 4.6 debemos incluir una opción adicional
- if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
- endif()
+ message (version: ${CMAKE_CXX_COMPILER_VERSION})
+ if(COMPILER_SUPPORTS_CXX11)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ elseif(COMPILER_SUPPORTS_CXX0X)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+ else()
+ message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
+ endif()
+
endif()
ADD_LIBRARY(logger SHARED ${SRC_FILES})
More information about the Jderobot-admin
mailing list