-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (34 loc) · 1.23 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
cmake_minimum_required(VERSION 3.12.0)
project(pll VERSION 0.0.2)
include(CTest)
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
message(STATUS "CMAKE Generator: ${CMAKE_GENERATOR}")
message(STATUS "Build Test: ${PLL_ENABLE_BUILD_TESTING}")
if (NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Wextra -Wno-unused-function -Wno-unused-parameter")
endif()
# set(PLL_ENABLE_BUILD_TESTING True)
if (PLL_ENABLE_BUILD_TESTING)
find_package(GTest CONFIG REQUIRED)
endif()
file(GLOB_RECURSE PLL_SOURCES RELATIVE ${PROJECT_SOURCE_DIR} "src/*.cpp")
file(GLOB_RECURSE PLC_SOURCES RELATIVE ${PROJECT_SOURCE_DIR} "test/*.cpp")
add_library(pll SHARED ${PLL_SOURCES})
target_include_directories(pll PUBLIC ${PROJECT_SOURCE_DIR}/include)
if (PLL_ENABLE_BUILD_TESTING)
enable_testing()
add_executable(pll_test_coverage ${PLC_SOURCES})
target_link_libraries(pll_test_coverage PRIVATE pll GTest::gmock GTest::gtest GTest::gmock_main GTest::gtest_main)
include(GoogleTest)
gtest_discover_tests(pll_test_coverage)
set_target_properties(pll_test_coverage PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)
endif()
set_target_properties(pll PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
)