working version
This commit is contained in:
@@ -1,12 +1,11 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
project(singlechat.wt LANGUAGES CXX)
|
project(singlechat.wt LANGUAGES CXX)
|
||||||
add_compile_options(-Wno-deprecated-declarations)
|
|
||||||
|
|
||||||
|
add_compile_options(-Wno-deprecated-declarations)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_COMPILER "/usr/bin/g++-12")
|
set(CMAKE_CXX_COMPILER "/usr/bin/g++-12")
|
||||||
set(CMAKE_PREFIX_PATH "/usr")
|
|
||||||
|
|
||||||
# Set default build type if not specified
|
# Set default build type if not specified
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
@@ -22,16 +21,13 @@ endif()
|
|||||||
|
|
||||||
add_executable(${PROJECT_NAME}
|
add_executable(${PROJECT_NAME}
|
||||||
src/main.cpp
|
src/main.cpp
|
||||||
src/broadcast.h src/broadcast.cpp
|
src/broadcast.cpp
|
||||||
src/app.h src/app.cpp
|
src/app.cpp
|
||||||
docroot/text.xml
|
|
||||||
docroot/ads.txt
|
|
||||||
docroot/links.csv
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
|
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
target_link_libraries(${PROJECT_NAME}
|
||||||
wt
|
wt
|
||||||
wthttp
|
wthttp
|
||||||
@@ -41,31 +37,36 @@ target_link_libraries(${PROJECT_NAME}
|
|||||||
)
|
)
|
||||||
|
|
||||||
find_package(Boost COMPONENTS system filesystem REQUIRED)
|
find_package(Boost COMPONENTS system filesystem REQUIRED)
|
||||||
if(UNIX)
|
|
||||||
# Ubuntu-spezifische Include-Verzeichnisse
|
|
||||||
find_package(PkgConfig)
|
|
||||||
pkg_check_modules(XML2 libxml-2.0)
|
|
||||||
if(XML2_FOUND)
|
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE /usr/include/GraphicsMagick ${XML2_INCLUDE_DIRS})
|
|
||||||
endif()
|
|
||||||
elseif(EXISTS "/etc/os-release" AND ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux"))
|
|
||||||
# Tumbleweed-spezifische Include-Verzeichnisse
|
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE /usr/include/GraphicsMagick)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(Boost_FOUND)
|
if(Boost_FOUND)
|
||||||
include_directories(${Boost_INCLUDE_DIRS})
|
include_directories(${Boost_INCLUDE_DIRS})
|
||||||
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} GraphicsMagick++ GraphicsMagick)
|
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} GraphicsMagick++ GraphicsMagick)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
if(UNIX)
|
||||||
|
find_package(PkgConfig)
|
||||||
|
pkg_check_modules(XML2 libxml-2.0)
|
||||||
|
if(XML2_FOUND)
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE ${XML2_INCLUDE_DIRS})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(UNIX)
|
||||||
|
find_package(PkgConfig)
|
||||||
|
pkg_check_modules(XML2 libxml-2.0)
|
||||||
|
if(XML2_FOUND)
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE ${XML2_INCLUDE_DIRS} /usr/include/GraphicsMagick)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
install(TARGETS ${PROJECT_NAME}
|
install(TARGETS ${PROJECT_NAME}
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
||||||
RUNTIME DESTINATION /opt/ypchat/bin
|
RUNTIME DESTINATION /opt/ypchat/bin
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Install docroot directory and handle logs setup
|
||||||
install(DIRECTORY docroot/
|
install(DIRECTORY docroot/
|
||||||
DESTINATION /opt/ypchat/docroot
|
DESTINATION /opt/ypchat/docroot
|
||||||
)
|
)
|
||||||
install(CODE "file(MAKE_DIRECTORY /opt/ypchat/logs)")
|
install(CODE "file(MAKE_DIRECTORY /opt/ypchat/logs)")
|
||||||
install(CODE "execute_process(COMMAND chmod 777 /opt/ypchat/logs)")
|
install(CODE "execute_process(COMMAND chmod 777 /opt/ypchat/logs)")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user