forked from Benny44/QPALM_vLADEL
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
46 lines (39 loc) · 1.22 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# This is the CMake file for developers. If you are a user or a packager, please
# see QPALM/CMakeLists.txt instead.
cmake_minimum_required(VERSION 3.17)
project(QPALM-dev)
include(CTest)
# Add coverage target
option(QPALM_WITH_COVERAGE
"Generate coverage information." Off)
if (QPALM_WITH_COVERAGE)
add_custom_target(coverage
${CMAKE_CURRENT_LIST_DIR}/scripts/coverage.sh
${CMAKE_CXX_COMPILER_ID}
${CMAKE_CXX_COMPILER_VERSION}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage -fno-inline")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fno-inline")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
add_dependencies(coverage QPALM::tests)
endif()
# Add documentation target
find_program(QPALM_DOXYGEN doxygen)
if (QPALM_DOXYGEN)
add_custom_target(documentation
doxygen
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/doxygen)
endif()
set(QPALM_WARNINGS_AS_ERRORS On)
# Source code
add_subdirectory(QPALM)
# Examples
option(QPALM_WITH_EXAMPLES
"Build the example programs" On)
if (QPALM_WITH_EXAMPLES)
add_subdirectory(examples)
endif()
# Unit tests
if (BUILD_TESTING)
add_subdirectory(test)
endif()