Commit f1687283 authored by Jan Möbius's avatar Jan Möbius

Enable c++11 support on mac by default now



git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@268 66977474-1d4b-4f09-8fe9-267525286df2
parent 76341350
......@@ -73,6 +73,33 @@ if (UNIX)
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-Wno-non-virtual-dtor" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-Wno-non-virtual-dtor" )
endif ()
################################################################################
# C++ 11 support
################################################################################
# On apple, if we have c++ 11 support, we enable it automatically here
if (APPLE)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-std=c++11" )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-std=c++11" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-std=c++11" )
elseif(COMPILER_SUPPORTS_CXX0X)
list(APPEND ADDITIONAL_CXX_DEBUG_FLAGS "-std=c++0x" )
list(APPEND ADDITIONAL_CXX_RELEASE_FLAGS "-std=c++0x" )
list(APPEND ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS "-std=c++0x" )
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Falling back to non C++11 mode. If you encounter errors, please use a different C++ compiler.")
endif()
endif()
################################################################################
# STL Vector checks
......
......@@ -42,7 +42,8 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES)
else(GTEST_PREFIX)
find_path(_GTEST_INCLUDE_DIR "gtest/gtest.h"
PATHS
~/sw/gtest/include
~/sw/gtest-1.7.0/include
~/sw/gtest/include
/ACG/acgdev/gcc-4.7-x86_64/gtest/include
/opt/local/include
/usr/local/include
......@@ -51,6 +52,7 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES)
NO_DEFAULT_PATH )
find_library(_GTEST_LIBRARY gtest
PATHS
~/sw/gtest-1.7.0/lib
~/sw/gtest/lib
/ACG/acgdev/gcc-4.7-x86_64/gtest/lib
/opt/local/lib
......@@ -60,6 +62,7 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES)
NO_DEFAULT_PATH )
find_library(_GTEST_MAIN_LIBRARY gtest_main
PATHS
~/sw/gtest-1.7.0/lib
~/sw/gtest/lib
/ACG/acgdev/gcc-4.7-x86_64/gtest/lib
/opt/local/lib
......@@ -90,6 +93,12 @@ else(GTEST_INCLUDE_DIRS AND GTEST_LIBRARIES AND GTEST_MAIN_LIBRARIES)
"Libraries to link for Google Test automatic main() definition")
endif()
# Macro required to use google test with vs2012
if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
add_definitions(-D_VARIADIC_MAX=10)
endif()
set(GTEST_LIBRARY_DIR ${_GTEST_LIBRARY_DIR} CACHE FILEPATH
"Library dir containing Google Test libraries")
mark_as_advanced(GTEST_INCLUDE_DIRS GTEST_LIBRARIES GTEST_MAIN_LIBRARIES GTEST_LIBRARY_DIR )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment