-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
39 lines (30 loc) · 1.4 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
cmake_minimum_required(VERSION 3.10)
project(cdb)
add_library(${PROJECT_NAME}_lib src/cdb.cpp)
target_include_directories(${PROJECT_NAME}_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_compile_features(${PROJECT_NAME}_lib PUBLIC cxx_std_11)
target_compile_options(${PROJECT_NAME}_lib PUBLIC --coverage)
target_link_libraries(${PROJECT_NAME}_lib PUBLIC gcov)
add_executable(${PROJECT_NAME} src/main.cpp)
target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_NAME}_lib readline)
## Installation
install(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin/)
install(FILES cdbConfig.cmake DESTINATION /usr/share/cmake/cdb/)
## Testing
enable_testing()
add_test(NAME ${PROJECT_NAME}_integration_test COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/test.sh")
add_executable(${PROJECT_NAME}_unit_test src/test_cdb.cpp)
target_link_libraries(${PROJECT_NAME}_unit_test PUBLIC ${PROJECT_NAME}_lib)
add_test(NAME ${PROJECT_NAME}_unit_test_runner COMMAND
${PROJECT_NAME}_unit_test)
## Packaging
# SET(CPACK_GENERATOR "DEB")
# set(CPACK_PACKAGE_NAME cdb)
# SET(CPACK_PACKAGE_CONTACT "Nickolai Belakovski")
# SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
# SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, libgcc1, libreadline7, libstdc++6")
# set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A debugger for CMake files")
# SET(CPACK_PACKAGE_VERSION_MAJOR "0")
# SET(CPACK_PACKAGE_VERSION_MINOR "1")
# SET(CPACK_PACKAGE_VERSION_PATCH "0")
# INCLUDE(CPack)