-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
45 lines (33 loc) · 1.52 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
cmake_minimum_required(VERSION 3.2)
project(SeedCpp)
# Configure environment
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_EXE_LINKER_FLAGS "-no-pie")
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Configure include directories
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_SOURCE_DIR}/test)
# Add application projects
add_subdirectory(${CMAKE_SOURCE_DIR}/src/SeedCppCore)
add_subdirectory(${CMAKE_SOURCE_DIR}/src/SeedCpp)
set_target_properties(SeedCppCore PROPERTIES FOLDER Application)
set_target_properties(SeedCpp PROPERTIES FOLDER Application)
# Add test projects
add_subdirectory(${CMAKE_SOURCE_DIR}/test/SeedCppCoreTestUtilities)
add_subdirectory(${CMAKE_SOURCE_DIR}/test/SeedCppCoreUnitTest)
add_subdirectory(${CMAKE_SOURCE_DIR}/test/DatabaseIntegrationTest)
set_target_properties(SeedCppCoreTestUtilities PROPERTIES FOLDER Test)
set_target_properties(SeedCppCoreUnitTest PROPERTIES FOLDER Test)
set_target_properties(DatabaseIntegrationTest PROPERTIES FOLDER Test)
# Add code coverage project
if (CMAKE_BUILD_TYPE STREQUAL "Coverage")
include(CodeCoverage)
setup_target_for_coverage(AutomatedTestCoverage SeedCppCoreUnitTest DatabaseIntegrationTest coverage)
endif()