-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (38 loc) · 1.16 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
PROJECT(sca_e_kozet)
SET(CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR}/build)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
## ===============================================
FIND_PACKAGE(Boost REQUIRED COMPONENTS filesystem system)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
FIND_PACKAGE(Lua REQUIRED)
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR})
## ===============================================
INCLUDE_DIRECTORIES(include/)
SET(SOURCES
src/errors.cpp
src/PHash.cpp
src/Lexer.cpp
src/Parser.cpp
src/matching.cpp
src/verify_rule.cpp
src/Rule.cpp
src/sca_lua.cpp
src/SCA.cpp
src/main.cpp
)
ADD_EXECUTABLE(sca_e_kozet ${SOURCES})
SET(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} --std=c++17 -Wall -Werror -pedantic -fno-exceptions -fno-rtti")
TARGET_LINK_LIBRARIES(sca_e_kozet
${Boost_LIBRARIES} ${LUA_LIBRARIES}
)
# This works only with in-source builds. Sorry.
SET(TEST_DIR "${CMAKE_SOURCE_DIR}/test")
ADD_CUSTOM_TARGET(
atest
COMMAND python3 ${TEST_DIR}/auto/test.py ${CMAKE_BINARY_DIR}/sca_e_kozet ${TEST_DIR}
SOURCES ${TEST_DIR}/auto/test.py
)
ADD_DEPENDENCIES(atest sca_e_kozet)