-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
83 lines (61 loc) · 2.1 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
77
78
79
80
81
82
83
cmake_minimum_required(VERSION 3.6)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
project(vcf_scanner VERSION 0.1.0 LANGUAGES CXX)
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
list(INSERT CMAKE_MODULE_PATH 0 ${PROJECT_SOURCE_DIR}/cmake/Modules)
if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
set_target_properties(${PROJECT_NAME}
PROPERTIES EXPORT_NAME VCFScanner)
include(GNUInstallDirs)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(TARGETS ${PROJECT_NAME}
EXPORT VCFScannerTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(EXPORT VCFScannerTargets
FILE VCFScannerTargets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/VCFScanner
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/VCFScannerConfigVersion.cmake
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMajorVersion
)
configure_package_config_file(
${PROJECT_SOURCE_DIR}/cmake/VCFScannerConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/VCFScannerConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/VCFScanner
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/VCFScannerConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/VCFScannerConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/VCFScanner
)
export(EXPORT VCFScannerTargets
FILE ${CMAKE_CURRENT_BINARY_DIR}/VCFScannerTargets.cmake
)
export(PACKAGE VCFScanner)
include(CTest)
if(BUILD_TESTING)
option(BUILD_COVERAGE "Enable code coverage report" OFF)
if(BUILD_COVERAGE)
include(CodeCoverage)
append_coverage_compiler_flags()
endif()
add_subdirectory(tests)
add_subdirectory(examples)
endif()
include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
set(CPACK_PACKAGE_VERSION_MAJOR "${b_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${b_VERSION_MINOR}")
include(CPack)
endif()