1 ## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 cmake_minimum_required (VERSION 2.6)
4 cmake_policy(SET CMP0011 NEW)
6 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
7 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
8 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
10 set(CMAKE_INCLUDE_CURRENT_DIR ON)
13 ## Specific definitions: EHsc to avoid exceptions-linkage unresolved symbols
14 ADD_DEFINITIONS(-DWIN32 -D_WINDOWS /EHsc)
18 IF(CMAKE_COMPILER_IS_GNUCC)
19 #C++11 is not supported on some platforms, disable it
20 #MESSAGE(STATUS "Setting -std=c++0x flag for the gcc...")
21 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
23 #Supporting test coverage checks (gcov) in the DEBUG mode
26 MESSAGE(STATUS "Setting flags for gcov support the gcc...")
27 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
28 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
29 SET(CMAKE_SHARED_LINKER_FLAGS "-lgcov")
31 SETUP_TARGET_FOR_COVERAGE(test_coverage # Name for custom target.
32 ctest # Name of the test driver executable that runs the tests.
33 coverage) # Name of output directory.
35 SET(USE_TEST_COVERAGE False)
36 ENDIF(USE_TEST_COVERAGE)
38 #SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -E")
39 #MESSAGE(STATUS "gcc flags are: " ${CMAKE_CXX_FLAGS})
40 #MESSAGE(STATUS "linker flags are: " ${CMAKE_SHARED_LINKER_FLAGS})
41 ENDIF(CMAKE_COMPILER_IS_GNUCC)