51 lines
1.1 KiB
CMake
51 lines
1.1 KiB
CMake
set(LIB webapp)
|
|
|
|
file(GLOB_RECURSE ${LIB}_SOURCE src/*)
|
|
file(GLOB ${LIB}_CONFIG config/*)
|
|
|
|
set(CONFIG )
|
|
configure_file(config/wt_config_${CMAKE_BUILD_TYPE}.xml ${CMAKE_BINARY_DIR}/local/etc/wt/wt_config.xml COPYONLY)
|
|
|
|
# find packages
|
|
find_package(wt REQUIRED)
|
|
find_package(nlohmann_json CONFIG REQUIRED)
|
|
|
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
set(Wt_LIBRARY wtd)
|
|
set(Wt_HTTP_LIBRARY wthttpd)
|
|
set(Wt_TEST_LIBRARY wttestd)
|
|
else (CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
set(Wt_LIBRARY wt)
|
|
set(Wt_HTTP_LIBRARY wthttp)
|
|
set(Wt_TEST_LIBRARY wttest)
|
|
endif()
|
|
|
|
# create library
|
|
add_library(${LIB} ${${LIB}_SOURCE} ${${LIB}_CONFIG})
|
|
|
|
# link all
|
|
target_include_directories(${LIB}
|
|
PUBLIC include
|
|
)
|
|
|
|
target_link_libraries(${LIB}
|
|
PRIVATE ${Wt_HTTP_LIBRARY}
|
|
PRIVATE ${Wt_LIBRARY}
|
|
PUBLIC auth
|
|
PUBLIC eedb-api
|
|
PUBLIC Boost::system
|
|
PUBLIC Boost::filesystem
|
|
PUBLIC Boost::thread
|
|
PUBLIC Boost::program_options
|
|
PUBLIC stdc++fs
|
|
PUBLIC nlohmann_json
|
|
)
|
|
|
|
# add cotire
|
|
set_target_properties(${LIB} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
|
|
cotire(${LIB})
|
|
|
|
# add tests
|
|
add_subdirectory(mock)
|
|
add_subdirectory(test)
|