-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
62 lines (50 loc) · 1.84 KB
/
CMakeLists.txt
File metadata and controls
62 lines (50 loc) · 1.84 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
cmake_minimum_required(VERSION 3.15)
project(sentinel VERSION 3.2.0 LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 11)
option(SENTINEL_BUILD_TOOLS "Build standalone tools" ON)
option(SENTINEL_BUILD_EXAMPLES "Build examples" ON)
option(SENTINEL_BUILD_TESTS "Build unit tests" ON)
if(MSVC)
add_compile_options(/W4 /WX- /MP)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS UNICODE _UNICODE)
else()
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
include_directories(${CMAKE_SOURCE_DIR}/include)
file(GLOB_RECURSE SENTINEL_SOURCES "src/*.cpp" "src/*.c")
add_library(sentinel STATIC ${SENTINEL_SOURCES})
target_include_directories(sentinel PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
if(WIN32)
target_link_libraries(sentinel PUBLIC ntdll dbghelp psapi)
endif()
install(TARGETS sentinel ARCHIVE DESTINATION lib)
install(DIRECTORY include/sentinel DESTINATION include)
# Tools
if(SENTINEL_BUILD_TOOLS)
add_executable(sig_scan tools/sig_scan.cpp)
target_link_libraries(sig_scan sentinel)
endif()
if(SENTINEL_BUILD_TOOLS)
add_executable(ac_probe tools/ac_probe.cpp)
target_link_libraries(ac_probe sentinel)
endif()
# Examples
if(SENTINEL_BUILD_EXAMPLES)
add_executable(basic_scan examples/basic_scan.cpp)
target_link_libraries(basic_scan sentinel)
add_executable(driver_comm_example examples/driver_comm.cpp)
target_link_libraries(driver_comm_example sentinel)
endif()
if(SENTINEL_BUILD_TESTS)
add_executable(test_scanner tests/test_scanner.cpp)
target_link_libraries(test_scanner sentinel)
add_test(NAME test_scanner COMMAND test_scanner)
add_executable(test_pe_parser tests/test_pe_parser.cpp)
target_link_libraries(test_pe_parser sentinel)
add_test(NAME test_pe_parser COMMAND test_pe_parser)
endif()