Split up cmake file
parent
691292598a
commit
a5dec132a1
|
@ -11,7 +11,6 @@ find_package(Qt5Core CONFIG REQUIRED)
|
||||||
if(NOT WITHOUT_GUI)
|
if(NOT WITHOUT_GUI)
|
||||||
find_package(Qt5Widgets CONFIG REQUIRED)
|
find_package(Qt5Widgets CONFIG REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
find_package(Qt5LinguistTools)
|
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
@ -22,9 +21,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -g -Og")
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
set(CMAKE_AUTOUIC ON)
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
|
||||||
include_directories(${PROJECT_SOURCE_DIR}/src)
|
|
||||||
include_directories(${PROJECT_BINARY_DIR})
|
include_directories(${PROJECT_BINARY_DIR})
|
||||||
|
|
||||||
include_directories(${LIBXDG_BASEDIR_INCLUDE_DIRS})
|
include_directories(${LIBXDG_BASEDIR_INCLUDE_DIRS})
|
||||||
|
|
||||||
link_directories(${LIBXDG_BASEDIR_LIBRARY_DIRS})
|
link_directories(${LIBXDG_BASEDIR_LIBRARY_DIRS})
|
||||||
|
@ -35,14 +32,6 @@ configure_file (
|
||||||
"${PROJECT_BINARY_DIR}/version.hpp"
|
"${PROJECT_BINARY_DIR}/version.hpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(Qt5_LRELEASE_EXECUTABLE)
|
|
||||||
file(GLOB TS_FILES "translations/*.ts")
|
|
||||||
file(GLOB TS_SRC_FILES "src/*")
|
|
||||||
qt5_create_translation(QM_FILES ${TS_SRC_FILES} ${TS_FILES}
|
|
||||||
OPTIONS -no-obsolete)
|
|
||||||
qt5_add_translation(QM_FILES ${TS_FILES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_executable(whyblocked src/interface_text.cpp src/whyblocked.cpp)
|
add_executable(whyblocked src/interface_text.cpp src/whyblocked.cpp)
|
||||||
target_link_libraries(whyblocked
|
target_link_libraries(whyblocked
|
||||||
${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs Qt5::Core)
|
${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs Qt5::Core)
|
||||||
|
@ -64,61 +53,8 @@ if(NOT WITHOUT_GUI)
|
||||||
${CMAKE_INSTALL_DATAROOTDIR}/qt5/translations)
|
${CMAKE_INSTALL_DATAROOTDIR}/qt5/translations)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT WITHOUT_TRANSLATIONS)
|
||||||
# Packages
|
add_subdirectory(translations)
|
||||||
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
|
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR ${mastodon-cpp_VERSION_MAJOR})
|
|
||||||
set(CPACK_PACKAGE_VERSION_MINOR ${mastodon-cpp_VERSION_MINOR})
|
|
||||||
set(CPACK_PACKAGE_VERSION_PATCH ${mastodon-cpp_VERSION_PATCH})
|
|
||||||
set(CPACK_PACKAGE_VERSION ${whyblocked_VERSION})
|
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Whyblocked reminds you why you blocked someone.")
|
|
||||||
set(CPACK_PACKAGE_CONTACT "tastytea <tastytea@tastytea.de>")
|
|
||||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
|
||||||
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")
|
|
||||||
set(CPACK_PACKAGE_ICON "de.tastytea.Whyblocked.svg")
|
|
||||||
list(APPEND CPACK_SOURCE_IGNORE_FILES "/\\\\.git"
|
|
||||||
"/.gitignore"
|
|
||||||
"/build/"
|
|
||||||
"\\\\.sublime-"
|
|
||||||
"/.drone.yml")
|
|
||||||
execute_process(COMMAND uname -m
|
|
||||||
OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME
|
|
||||||
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}_${CPACK_PACKAGE_ARCHITECTURE}")
|
|
||||||
set(CPACK_GENERATOR "TGZ")
|
|
||||||
set(CPACK_SOURCE_GENERATOR "TGZ")
|
|
||||||
|
|
||||||
if (WITH_DEB)
|
|
||||||
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
|
|
||||||
set(CPACK_GENERATOR "DEB")
|
|
||||||
set(CPACK_SOURCE_GENERATOR "DEB")
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://schlomp.space/tastytea/whyblocked")
|
|
||||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
|
||||||
execute_process(COMMAND dpkg --print-architecture
|
|
||||||
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME
|
|
||||||
"${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-0_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
|
||||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME
|
|
||||||
"${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-0_src")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WITH_RPM)
|
include(packages.CMakeLists.txt)
|
||||||
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
|
|
||||||
set(CPACK_GENERATOR "RPM")
|
|
||||||
set(CPACK_SOURCE_GENERATOR "RPM")
|
|
||||||
set(CPACK_RPM_PACKAGE_LICENSE "GPL-3")
|
|
||||||
set(CPACK_RPM_PACKAGE_URL "https://schlomp.space/tastytea/whyblocked")
|
|
||||||
if(NOT WITHOUT_QT)
|
|
||||||
set(CPACK_RPM_PACKAGE_REQUIRES "vsqlite++ >= 0.3.13, libxdg-basedir >= 1.2.0, qt >= 5.0")
|
|
||||||
else()
|
|
||||||
set(CPACK_RPM_PACKAGE_REQUIRES "vsqlite++ >= 0.3.13, libxdg-basedir >= 1.2.0")
|
|
||||||
endif()
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME
|
|
||||||
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-0.${CPACK_PACKAGE_ARCHITECTURE}")
|
|
||||||
set(CPACK_SOURCE_PACKAGE_FILE_NAME
|
|
||||||
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-0.src")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(CPack)
|
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
# Packages
|
||||||
|
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
|
||||||
|
set(CPACK_PACKAGE_VERSION_MAJOR ${mastodon-cpp_VERSION_MAJOR})
|
||||||
|
set(CPACK_PACKAGE_VERSION_MINOR ${mastodon-cpp_VERSION_MINOR})
|
||||||
|
set(CPACK_PACKAGE_VERSION_PATCH ${mastodon-cpp_VERSION_PATCH})
|
||||||
|
set(CPACK_PACKAGE_VERSION ${whyblocked_VERSION})
|
||||||
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Whyblocked reminds you why you blocked someone.")
|
||||||
|
set(CPACK_PACKAGE_CONTACT "tastytea <tastytea@tastytea.de>")
|
||||||
|
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||||
|
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")
|
||||||
|
set(CPACK_PACKAGE_ICON "de.tastytea.Whyblocked.svg")
|
||||||
|
list(APPEND CPACK_SOURCE_IGNORE_FILES "/\\\\.git"
|
||||||
|
"/.gitignore"
|
||||||
|
"/build/"
|
||||||
|
"\\\\.sublime-"
|
||||||
|
"/.drone.yml")
|
||||||
|
execute_process(COMMAND uname -m
|
||||||
|
OUTPUT_VARIABLE CPACK_PACKAGE_ARCHITECTURE
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
set(CPACK_PACKAGE_FILE_NAME
|
||||||
|
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}_${CPACK_PACKAGE_ARCHITECTURE}")
|
||||||
|
set(CPACK_GENERATOR "TGZ")
|
||||||
|
set(CPACK_SOURCE_GENERATOR "TGZ")
|
||||||
|
|
||||||
|
if (WITH_DEB)
|
||||||
|
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
|
||||||
|
set(CPACK_GENERATOR "DEB")
|
||||||
|
set(CPACK_SOURCE_GENERATOR "DEB")
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://schlomp.space/tastytea/whyblocked")
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||||
|
execute_process(COMMAND dpkg --print-architecture
|
||||||
|
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
set(CPACK_PACKAGE_FILE_NAME
|
||||||
|
"${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-0_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||||
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME
|
||||||
|
"${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-0_src")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (WITH_RPM)
|
||||||
|
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
|
||||||
|
set(CPACK_GENERATOR "RPM")
|
||||||
|
set(CPACK_SOURCE_GENERATOR "RPM")
|
||||||
|
set(CPACK_RPM_PACKAGE_LICENSE "GPL-3")
|
||||||
|
set(CPACK_RPM_PACKAGE_URL "https://schlomp.space/tastytea/whyblocked")
|
||||||
|
if(NOT WITHOUT_QT)
|
||||||
|
set(CPACK_RPM_PACKAGE_REQUIRES "vsqlite++ >= 0.3.13, libxdg-basedir >= 1.2.0, qt >= 5.0")
|
||||||
|
else()
|
||||||
|
set(CPACK_RPM_PACKAGE_REQUIRES "vsqlite++ >= 0.3.13, libxdg-basedir >= 1.2.0")
|
||||||
|
endif()
|
||||||
|
set(CPACK_PACKAGE_FILE_NAME
|
||||||
|
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-0.${CPACK_PACKAGE_ARCHITECTURE}")
|
||||||
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME
|
||||||
|
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-0.src")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(CPack)
|
|
@ -0,0 +1,10 @@
|
||||||
|
find_package(Qt5LinguistTools REQUIRED)
|
||||||
|
|
||||||
|
file(GLOB TS_FILES "${PROJECT_SOURCE_DIR}/translations/*.ts")
|
||||||
|
file(GLOB TS_SRC_FILES "${PROJECT_SOURCE_DIR}/src/*")
|
||||||
|
qt5_create_translation(QM_FILES ${TS_SRC_FILES} ${TS_FILES}
|
||||||
|
OPTIONS -no-obsolete)
|
||||||
|
qt5_add_translation(QM_FILES ${TS_FILES})
|
||||||
|
add_custom_target(translations ALL DEPENDS ${QM_FILES})
|
||||||
|
add_dependencies(${CMAKE_PROJECT_NAME} translations)
|
||||||
|
add_dependencies(${CMAKE_PROJECT_NAME}-gui translations)
|
Loading…
Reference in New Issue