-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
33 lines (28 loc) · 1.56 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
cmake_minimum_required(VERSION 3.6)
project(sigscanner)
set(CMAKE_CXX_STANDARD 17)
option(SIGSCANNER_BUILD_SHARED_LIB "Build a sigscanner library" OFF)
option(SIGSCANNER_BUILD_STATIC_LIB "Build a static sigscanner library" OFF)
option(SIGSCANNER_BUILD_EXEC "Build the sigscanner executable" ON)
set(SIGSCANNER_LIB_SOURCES lib/thread_pool.cpp lib/signature.cpp lib/multi_scanner.cpp lib/scanner.cpp lib/scan_options.cpp)
if(SIGSCANNER_BUILD_SHARED_LIB)
set(SIGSCANNER_SHARED_LIB sig-scanner-shared)
set(SIGSCANNER_SHARED_LIB ${SIGSCANNER_SHARED_LIB} PARENT_SCOPE)
set(SIGSCANNER_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(SIGSCANNER_INCLUDE_DIRS ${SIGSCANNER_INCLUDE_DIRS} PARENT_SCOPE)
add_library(${SIGSCANNER_SHARED_LIB} SHARED ${SIGSCANNER_LIB_SOURCES})
target_include_directories(${SIGSCANNER_SHARED_LIB} PUBLIC ${SIGSCANNER_INCLUDE_DIRS})
endif()
if(SIGSCANNER_BUILD_STATIC_LIB)
set(SIGSCANNER_STATIC_LIB sig-scanner-static)
set(SIGSCANNER_STATIC_LIB ${SIGSCANNER_STATIC_LIB} PARENT_SCOPE)
set(SIGSCANNER_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(SIGSCANNER_INCLUDE_DIRS ${SIGSCANNER_INCLUDE_DIRS} PARENT_SCOPE)
add_library(${SIGSCANNER_STATIC_LIB} STATIC ${SIGSCANNER_LIB_SOURCES})
target_include_directories(${SIGSCANNER_STATIC_LIB} PUBLIC ${SIGSCANNER_INCLUDE_DIRS})
endif()
if(SIGSCANNER_BUILD_EXEC)
set(SIGSCANNER_EXEC_NAME sig-scanner)
add_executable(${SIGSCANNER_EXEC_NAME} src/main.cpp ${SIGSCANNER_LIB_SOURCES})
target_include_directories(${SIGSCANNER_EXEC_NAME} PRIVATE src include)
endif()