comparison server/CMakeLists.txt @ 0:a4671277546c tip

created the repository for the thymian project
author ferencd
date Tue, 17 Aug 2021 11:19:54 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:a4671277546c
1 cmake_minimum_required (VERSION 3.0)
2 set (PROJECT thymian)
3
4 set (ECPPC /usr/local/bin/ecppc)
5
6 set (WEB_COMPONENTS
7 r # Recipe sender
8 root # Main root
9 filer # Just send the files
10 main_root_sender # The recipe root directory sender (which selects recipe categoroes)
11 category_root_sender # Send a category
12 )
13
14 include_directories(
15 "/usr/local/include/"
16 ${CMAKE_CURRENT_BINARY_DIR}
17 ${CMAKE_CURRENT_SOURCE_DIR}
18 )
19
20 set(${PROJECT}_SOURCES
21 ""
22 CACHE INTERNAL ${PROJECT}_SOURCES
23 )
24
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)
26
27 foreach(comp ${WEB_COMPONENTS})
28 list(APPEND ${PROJECT}_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${comp}.cpp )
29 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${comp}.cpp
30 COMMAND ${ECPPC} -o ${CMAKE_CURRENT_BINARY_DIR}/${comp}.cpp -v -n ${comp} ${CMAKE_CURRENT_SOURCE_DIR}/${comp}.ecpp
31 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${comp}.ecpp)
32 set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_CURRENT_BINARY_DIR}/${comp}.cpp)
33 endforeach()
34
35 set(CPP_SOURCES
36 config.cpp
37 category_sender.cpp
38 file_sender.cpp
39 flood_check.cpp
40 main_sender.cpp
41 r_impl.cpp
42 url_breaker.cpp
43 web_component.cpp
44 web_logmachine.cpp
45 )
46
47 set(CPP_HEADERS
48 category_sender.h
49 config.h
50 fake_locations.h
51 file_sender.h
52 flood_check.h
53 main_sender.h
54 r_impl.h
55 url_breaker.h
56 web_component.h
57 web_logmachine.h
58 )
59
60 if(BUILD_EXECUTABLE_WEB_COMPONENT)
61
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")
63
64 add_library(${PROJECT}_lib ${CPP_HEADERS} ${CPP_SOURCES})
65 target_link_libraries(${PROJECT}_lib ${CONAN_LIBS} cxxtools dl tntnet tntdb vmime fpaq0 templater common pthread )
66
67 add_executable(${PROJECT}_exe main.cpp ${${PROJECT}_SOURCES})
68 target_link_libraries(${PROJECT}_exe ${PROJECT}_lib)
69
70 else()
71 add_library(${PROJECT} SHARED ${${PROJECT}_SOURCES})
72 set_target_properties(${PROJECT} PROPERTIES PREFIX "")
73 target_link_libraries(${PROJECT} ${CONAN_LIBS} cxxtools dl tntnet tntdb vmime fpaq0 templater common pthread )
74 endif()
75