-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
76 lines (51 loc) · 2.29 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
cmake_minimum_required(VERSION 3.10)
project(StackWalkAsAService)
include(GNUInstallDirs)
# Common options
if(CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Set the build type, usually Release or RelWithDebInfo" FORCE)
endif(CMAKE_BUILD_TYPE STREQUAL "")
find_package(Threads)
# Boost
set(NEEDED_BOOST_COMPONENTS program_options system filesystem)
find_package(Boost COMPONENTS ${NEEDED_BOOST_COMPONENTS})
if(NOT Boost_FOUND)
# Automatically print stuff if it failed
set(Boost_DEBUG ON)
find_package(Boost COMPONENTS ${NEEDED_BOOST_COMPONENTS})
message(FATAL_ERROR "Failed to find Boost libraries")
endif(NOT Boost_FOUND)
# Boost is found or the configuration has already failed
include_directories(${Boost_INCLUDE_DIR})
# All boost libs are linked by cmake
add_definitions(-DBOOST_ALL_NO_LIB)
add_definitions(-DBOOST_PROGRAM_OPTIONS_DYN_LINK=1)
# RubySetupSystem installed things
link_directories(build/ThirdParty/lib)
include_directories(build/ThirdParty/include)
# Copy stackwalk to the build folder and also install it
set(STACK_WALK_EXECUTABLE build/ThirdParty/bin/minidump_stackwalk)
set(STACK_WALK_MINGW build/ThirdParty/breakpad_mingw/bin/minidump_stackwalk)
# Wt libs (static linking is used on windows)
if(UNIX)
file(GLOB WT_LIBRARIES build/ThirdParty/lib/libwt*.so*)
install(FILES ${WT_LIBRARIES} DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_LIBDIR}")
# Core Wt resources
set(WT_RESOURCES_FOLDER build/ThirdParty/share/Wt/resources)
set(WT_CONFIG_FILE config/wt_config.xml)
file(COPY ${STACK_WALK_EXECUTABLE} DESTINATION "${CMAKE_BINARY_DIR}/src")
install(PROGRAMS ${STACK_WALK_EXECUTABLE} DESTINATION ${CMAKE_INSTALL_BINDIR})
# hack to rename while copying
configure_file(${STACK_WALK_MINGW} "${CMAKE_BINARY_DIR}/src/minidump_stackwalk_mingw" COPYONLY)
install(PROGRAMS ${STACK_WALK_MINGW} DESTINATION ${CMAKE_INSTALL_BINDIR}
RENAME minidump_stackwalk_mingw)
file(COPY ${WT_RESOURCES_FOLDER} DESTINATION "${CMAKE_BINARY_DIR}/src")
install(DIRECTORY ${WT_RESOURCES_FOLDER} DESTINATION
${CMAKE_INSTALL_LOCALSTATEDIR}/StackWalkAsAService/http)
install(FILES ${WT_CONFIG_FILE} DESTINATION
${CMAKE_INSTALL_SYSCONFDIR}/StackWalkAsAService/)
add_subdirectory(src)
# add_subdirectory(test)