-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
37 lines (26 loc) · 874 Bytes
/
CMakeLists.txt
File metadata and controls
37 lines (26 loc) · 874 Bytes
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
cmake_minimum_required (VERSION 2.8)
# disable in-source build
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
# set name of project
project (TEST)
# set name of binary file
set(BIN test)
#add_subdirectory(src)
# list files for compiling
file(GLOB_RECURSE PROJECT_SOURCES src/*.cpp)
file(GLOB_RECURSE PROJECT_HEADERS src/*.h)
# Collecting all headers directories
set (PROJECT_INCLUDE_DIRS "")
foreach (_headerFile ${PROJECT_HEADERS})
get_filename_component(_dir ${_headerFile} PATH)
list (APPEND PROJECT_INCLUDE_DIRS ${_dir})
endforeach()
list(REMOVE_DUPLICATES PROJECT_INCLUDE_DIRS)
# Include all headers directories
include_directories(${PROJECT_INCLUDE_DIRS})
# set name of binary file
add_executable(${BIN} ${PROJECT_SOURCES})
# linking with library
target_link_libraries(${BIN} fcgi)
target_link_libraries(${BIN} config++)