-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
37 lines (24 loc) · 1.06 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
cmake_minimum_required(VERSION 3.1)
project(StaticSearcher VERSION 0.1
DESCRIPTION "WebAssembly Search For Static Sites"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
function(make_includable input_file output_file)
file(READ ${input_file} content)
set(delim "for_c++_include")
set(content "R\"${delim}(\n${content})${delim}\"")
file(WRITE ${output_file} "${content}")
endfunction(make_includable)
make_includable(src/web/main.cc src/main.web.cc)
make_includable(src/web/index.html src/index.html)
make_includable(src/web/CMakeLists.txt src/CMakeLists.web.txt)
find_package(nlohmann_json CONFIG REQUIRED)
find_package(cereal CONFIG REQUIRED)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost COMPONENTS program_options REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(main src/main.cc)
target_link_libraries(main PRIVATE nlohmann_json::nlohmann_json cereal ${Boost_LIBRARIES})
target_compile_features(main PUBLIC cxx_std_17)