forked from alliedtelesis/buildsyspp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (34 loc) · 1.24 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
cmake_minimum_required(VERSION 3.1...3.15)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()
project(Buildsys++ LANGUAGES CXX)
option(BUILD_TESTING "" OFF)
include(CTest)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
file(GLOB_RECURSE SOURCE_FILES
${CMAKE_SOURCE_DIR}/src/*.cpp
${CMAKE_SOURCE_DIR}/src/*.hpp
${CMAKE_SOURCE_DIR}/src/*.h)
include(cpplint)
include(clang-format)
include(clang-tidy)
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(CMAKE_CXX_STANDARD 17)
find_package(Threads REQUIRED)
find_package(Lua REQUIRED)
find_package(OpenSSL REQUIRED)
if(BUILD_TESTING)
add_subdirectory(unit-test)
else()
FILE(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
add_executable(buildsyspp ${sources})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/)
include_directories(${LUA_INCLUDE_DIR})
target_link_libraries(buildsyspp PRIVATE Threads::Threads)
target_link_libraries(buildsyspp PRIVATE ${LUA_LIBRARIES})
target_link_libraries(buildsyspp PRIVATE OpenSSL::Crypto)
target_link_libraries(buildsyspp PRIVATE util)
target_link_libraries(buildsyspp PRIVATE stdc++fs)
endif()
add_subdirectory(functional-test)