-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (38 loc) · 1.14 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
49
50
51
52
53
cmake_minimum_required(VERSION 3.20)
project(tohka)
set(VERSION 0.1.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
link_directories(/usr/local/lib)
SET(CXX_FLAGS
-g
-Wall
# -O3
)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
option(BUILD_EXAMPLES "build examples" ON)
option(BUILD_TEST "build tests" ON)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
include(utils)
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}")
#configure_file(
# "${PROJECT_SOURCE_DIR}/config.h.in"
# "${PROJECT_SOURCE_DIR}/config.h"
#)
message(STATUS "CXX_FLAGS = " ${CMAKE_CXX_FLAGS} " " ${CMAKE_CXX_FLAGS_${BUILD_TYPE}})
message(${PROJECT_SOURCE_DIR})
check_header("sys/poll.h")
check_function("getpid" "unistd.h")
include_directories(${PROJECT_SOURCE_DIR})
add_subdirectory(tohka)
add_subdirectory(tests)
if (BUILD_EXAMPLES)
add_subdirectory(examples)
endif ()
#add_subdirectory(tests)
if (BUILD_TESTS)
add_subdirectory(tests)
endif ()
#add_executable(test test.cc)
#target_link_libraries(test tohka)