|
ferencd@0
|
1 cmake_minimum_required (VERSION 3.0)
|
|
ferencd@0
|
2 set (PROJECT thymian)
|
|
ferencd@0
|
3
|
|
ferencd@0
|
4 set (ECPPC /usr/local/bin/ecppc)
|
|
ferencd@0
|
5
|
|
ferencd@0
|
6 set (WEB_COMPONENTS
|
|
ferencd@0
|
7 r # Recipe sender
|
|
ferencd@0
|
8 root # Main root
|
|
ferencd@0
|
9 filer # Just send the files
|
|
ferencd@0
|
10 main_root_sender # The recipe root directory sender (which selects recipe categoroes)
|
|
ferencd@0
|
11 category_root_sender # Send a category
|
|
ferencd@0
|
12 )
|
|
ferencd@0
|
13
|
|
ferencd@0
|
14 include_directories(
|
|
ferencd@0
|
15 "/usr/local/include/"
|
|
ferencd@0
|
16 ${CMAKE_CURRENT_BINARY_DIR}
|
|
ferencd@0
|
17 ${CMAKE_CURRENT_SOURCE_DIR}
|
|
ferencd@0
|
18 )
|
|
ferencd@0
|
19
|
|
ferencd@0
|
20 set(${PROJECT}_SOURCES
|
|
ferencd@0
|
21 ""
|
|
ferencd@0
|
22 CACHE INTERNAL ${PROJECT}_SOURCES
|
|
ferencd@0
|
23 )
|
|
ferencd@0
|
24
|
|
ferencd@0
|
25 OPTION(BUILD_EXECUTABLE_WEB_COMPONENT "Build a standalone executable of the web component. If you don't select this, a library will be built, you will need to run it with tntnet." ON)
|
|
ferencd@0
|
26
|
|
ferencd@0
|
27 foreach(comp ${WEB_COMPONENTS})
|
|
ferencd@0
|
28 list(APPEND ${PROJECT}_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${comp}.cpp )
|
|
ferencd@0
|
29 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${comp}.cpp
|
|
ferencd@0
|
30 COMMAND ${ECPPC} -o ${CMAKE_CURRENT_BINARY_DIR}/${comp}.cpp -v -n ${comp} ${CMAKE_CURRENT_SOURCE_DIR}/${comp}.ecpp
|
|
ferencd@0
|
31 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${comp}.ecpp)
|
|
ferencd@0
|
32 set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_CURRENT_BINARY_DIR}/${comp}.cpp)
|
|
ferencd@0
|
33 endforeach()
|
|
ferencd@0
|
34
|
|
ferencd@0
|
35 set(CPP_SOURCES
|
|
ferencd@0
|
36 config.cpp
|
|
ferencd@0
|
37 category_sender.cpp
|
|
ferencd@0
|
38 file_sender.cpp
|
|
ferencd@0
|
39 flood_check.cpp
|
|
ferencd@0
|
40 main_sender.cpp
|
|
ferencd@0
|
41 r_impl.cpp
|
|
ferencd@0
|
42 url_breaker.cpp
|
|
ferencd@0
|
43 web_component.cpp
|
|
ferencd@0
|
44 web_logmachine.cpp
|
|
ferencd@0
|
45 )
|
|
ferencd@0
|
46
|
|
ferencd@0
|
47 set(CPP_HEADERS
|
|
ferencd@0
|
48 category_sender.h
|
|
ferencd@0
|
49 config.h
|
|
ferencd@0
|
50 fake_locations.h
|
|
ferencd@0
|
51 file_sender.h
|
|
ferencd@0
|
52 flood_check.h
|
|
ferencd@0
|
53 main_sender.h
|
|
ferencd@0
|
54 r_impl.h
|
|
ferencd@0
|
55 url_breaker.h
|
|
ferencd@0
|
56 web_component.h
|
|
ferencd@0
|
57 web_logmachine.h
|
|
ferencd@0
|
58 )
|
|
ferencd@0
|
59
|
|
ferencd@0
|
60 if(BUILD_EXECUTABLE_WEB_COMPONENT)
|
|
ferencd@0
|
61
|
|
ferencd@0
|
62 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wno-deprecated -Wall -Wextra -Wstrict-aliasing -pedantic -fmax-errors=5 -Wno-error=strict-overflow -Wunreachable-code -Wcast-align -Wcast-qual -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wnoexcept -Wno-old-style-cast -Woverloaded-virtual -Wredundant-decls -Wno-shadow -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wno-unused -Wno-variadic-macros -Wno-parentheses -fdiagnostics-show-option --param max-gcse-memory=200000000 --param=max-vartrack-size=600000000")
|
|
ferencd@0
|
63
|
|
ferencd@0
|
64 add_library(${PROJECT}_lib ${CPP_HEADERS} ${CPP_SOURCES})
|
|
ferencd@0
|
65 target_link_libraries(${PROJECT}_lib ${CONAN_LIBS} cxxtools dl tntnet tntdb vmime fpaq0 templater common pthread )
|
|
ferencd@0
|
66
|
|
ferencd@0
|
67 add_executable(${PROJECT}_exe main.cpp ${${PROJECT}_SOURCES})
|
|
ferencd@0
|
68 target_link_libraries(${PROJECT}_exe ${PROJECT}_lib)
|
|
ferencd@0
|
69
|
|
ferencd@0
|
70 else()
|
|
ferencd@0
|
71 add_library(${PROJECT} SHARED ${${PROJECT}_SOURCES})
|
|
ferencd@0
|
72 set_target_properties(${PROJECT} PROPERTIES PREFIX "")
|
|
ferencd@0
|
73 target_link_libraries(${PROJECT} ${CONAN_LIBS} cxxtools dl tntnet tntdb vmime fpaq0 templater common pthread )
|
|
ferencd@0
|
74 endif()
|
|
ferencd@0
|
75
|