forked from dascandy/evoke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
92 lines (78 loc) · 3.27 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
cmake_minimum_required(VERSION 3.9)
project(evoke)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(
FATAL_ERROR
"Prevented in-tree build. Please create a build directory outside of the source directory and call cmake from there."
)
endif()
if(EVOKE_BUILD_WITH_UNITTEST)
add_subdirectory("toolsets/test")
endif()
set(INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}/evoke/include
${CMAKE_CURRENT_SOURCE_DIR}/fw/include
${CMAKE_CURRENT_SOURCE_DIR}/project/include
${CMAKE_CURRENT_SOURCE_DIR}/reporter/include
${CMAKE_CURRENT_SOURCE_DIR}/toolsets/include
${CMAKE_CURRENT_SOURCE_DIR}/utils/include
${CMAKE_CURRENT_SOURCE_DIR}/view/include
${CMAKE_CURRENT_SOURCE_DIR}/network/include
)
set(SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/evoke/src/Executor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/evoke/src/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/evoke/src/JsonCompileDb.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fw/src/Configuration.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fw/src/FileParser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/fw/src/dotted.cpp
${CMAKE_CURRENT_SOURCE_DIR}/project/src/CMakeListsTxt.cpp
${CMAKE_CURRENT_SOURCE_DIR}/project/src/Component.cpp
${CMAKE_CURRENT_SOURCE_DIR}/project/src/File.cpp
${CMAKE_CURRENT_SOURCE_DIR}/project/src/PendingCommand.cpp
${CMAKE_CURRENT_SOURCE_DIR}/project/src/PredefComponents.cpp
${CMAKE_CURRENT_SOURCE_DIR}/project/src/Project.cpp
${CMAKE_CURRENT_SOURCE_DIR}/project/src/ReadCode.cpp
${CMAKE_CURRENT_SOURCE_DIR}/project/src/tarjan.cpp
${CMAKE_CURRENT_SOURCE_DIR}/reporter/src/ConsoleReporter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/reporter/src/Reporter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/reporter/src/SimpleReporter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/reporter/src/IDEReporter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/toolsets/src/clang.cpp
${CMAKE_CURRENT_SOURCE_DIR}/toolsets/src/gcc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/toolsets/src/generic.cpp
${CMAKE_CURRENT_SOURCE_DIR}/toolsets/src/known.cpp
${CMAKE_CURRENT_SOURCE_DIR}/toolsets/src/msvc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/toolsets/src/Toolset.cpp
)
if (EVOKE_BUILD_WITH_DAEMON)
set(SOURCES ${SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/fw/src/FsWatcher.cpp
${CMAKE_CURRENT_SOURCE_DIR}/reporter/src/DaemonConsoleReporter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/network/src/Finder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/network/src/Retriever.cpp
)
endif()
add_executable(${PROJECT_NAME} ${SOURCES})
if (MINGW)
set(Boost_ARCHITECTURE -x64)
target_link_libraries(${PROJECT_NAME} PRIVATE ws2_32)
endif()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem system)
target_link_libraries(${PROJECT_NAME} PRIVATE Boost::disable_autolinking)
target_include_directories(${PROJECT_NAME}
PRIVATE ${INCLUDES} ${Boost_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME}
PRIVATE Threads::Threads ${Boost_LIBRARIES})
if (EVOKE_BUILD_WITH_DAEMON)
target_compile_definitions(${PROJECT_NAME} DAEMON_SUPPORT)
target_link_libraries(${PROJECT_NAME}
PRIVATE inotify-cpp)
endif()
INSTALL(TARGETS evoke RUNTIME DESTINATION bin)
include(cpack.cmake)