1 # Copyright (C) 2014-2019 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 cmake_minimum_required (VERSION 2.6)
21 cmake_policy(SET CMP0011 NEW)
23 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
24 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
25 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
27 set(CMAKE_INCLUDE_CURRENT_DIR ON)
30 ## Specific definitions: EHsc to avoid exceptions-linkage unresolved symbols
31 ADD_DEFINITIONS(-DWIN32 -D_WINDOWS /EHsc)
35 IF(CMAKE_COMPILER_IS_GNUCC)
36 #C++11 is not supported on some platforms, disable it
37 #MESSAGE(STATUS "Setting -std=c++0x flag for the gcc...")
38 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
40 #Supporting test coverage checks (gcov) in the DEBUG mode
43 MESSAGE(STATUS "Setting flags for gcov support the gcc...")
44 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
45 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
46 SET(CMAKE_SHARED_LINKER_FLAGS "-lgcov")
48 SETUP_TARGET_FOR_COVERAGE(test_coverage # Name for custom target.
49 ctest # Name of the test driver executable that runs the tests.
50 coverage) # Name of output directory.
52 SET(USE_TEST_COVERAGE False)
53 ENDIF(USE_TEST_COVERAGE)
55 #SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -E")
56 #MESSAGE(STATUS "gcc flags are: " ${CMAKE_CXX_FLAGS})
57 #MESSAGE(STATUS "linker flags are: " ${CMAKE_SHARED_LINKER_FLAGS})
58 ENDIF(CMAKE_COMPILER_IS_GNUCC)