-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
46 lines (37 loc) · 1.44 KB
/
CMakeLists.txt
File metadata and controls
46 lines (37 loc) · 1.44 KB
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
cmake_minimum_required(VERSION 3.16.3)
project(RegexMatcher VERSION 2.0.0.1 LANGUAGES CXX)
# Set C++ Standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Debug flag
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DDEBUG)
endif()
# Add subdirectories
add_subdirectory(external)
add_subdirectory(include)
add_subdirectory(tests)
# Install and export the targets.
install(TARGETS RegexMatcher
DESTINATION lib/RegexMatcher-${PROJECT_VERSION}
EXPORT RegexMatcher-targets
FILE_SET regex_matcher_headers
)
install(EXPORT RegexMatcher-targets
DESTINATION lib/RegexMatcher-${PROJECT_VERSION})
# Create and install package configuration and version files.
configure_file(
${RegexMatcher_SOURCE_DIR}/pkg/RegexMatcher-config.cmake.in
${RegexMatcher_BINARY_DIR}/pkg/RegexMatcher-config.cmake @ONLY)
configure_file(
${RegexMatcher_SOURCE_DIR}/RegexMatcher-config-version.cmake.in
${RegexMatcher_BINARY_DIR}/RegexMatcher-config-version.cmake @ONLY)
install(FILES ${RegexMatcher_BINARY_DIR}/pkg/RegexMatcher-config.cmake
${RegexMatcher_BINARY_DIR}/RegexMatcher-config-version.cmake
DESTINATION lib/RegexMatcher-${PROJECT_VERSION})
# Make project usable from build tree.
export(TARGETS RegexMatcher FILE RegexMatcher-targets.cmake)
configure_file(${RegexMatcher_SOURCE_DIR}/RegexMatcher-config.cmake.in
${RegexMatcher_BINARY_DIR}/RegexMatcher-config.cmake @ONLY)