-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
76 lines (55 loc) · 2.21 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
cmake_minimum_required(VERSION 3.12.4)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(mhbcore multi-half-bridge-corelib)
project(${mhbcore} CXX C)
# set(CMAKE_CXX_STANDARD 11)
# set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE ON)
# set(CMAKE_C_OUTPUT_EXTENSION_REPLACE ON)
# # Coverage Flags
# set(CMAKE_CXX_FLAGS "-g -O0 -Wall -fprofile-arcs -ftest-coverage")
# set(CMAKE_C_FLAGS "-g -O0 -Wall -fprofile-arcs -ftest-coverage")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/lib)
message( STATUS "PROJECT_NAME : ${PROJECT_NAME}" )
message( STATUS "CMAKE_BUILD_TYPE : ${CMAKE_BUILD_TYPE}" )
message( STATUS "CMAKE_SYSTEM_NAME : ${CMAKE_SYSTEM_NAME}" )
message( STATUS "CMAKE_SOURCE_DIR : ${CMAKE_SOURCE_DIR}" )
include( CompilerSettings )
# Search for include Files
include_directories(
src/config
src/corelib
src/pal
)
# Header & Source Files
set(Headers
src/config
src/corelib
src/pal
)
file(GLOB Sources CONFIGURE_DEPENDS src/corelib/*.cpp)
# Add Library
add_library(${mhbcore} ${Sources} ${Headers})
# Currently only using this target for rasbperry pi host
# if (CMAKE_HOST_UNIX)
# # Add directory
# add_subdirectory(src/framework/raspberrypi)
# endif()
option(SETUP_PROJECT_TESTS "Enable and setup project tests." ON)
if(SETUP_PROJECT_TESTS)
# Add GoogleTest
option(USE_GLOBAL_GOOGLETEST_INSTALLATION "Use available global installation of googletest." ON)
include(UseGoogleTestInstallation)
# Enable Testing with CTest
enable_testing()
# Add Tests Folder
add_subdirectory(test/unit)
endif()