Whyblocked reminds you why you blocked someone.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. cmake_minimum_required (VERSION 3.2)
  2. project (whyblocked
  3. VERSION 0.12.2
  4. LANGUAGES CXX
  5. )
  6. include(GNUInstallDirs)
  7. find_package(PkgConfig REQUIRED)
  8. pkg_check_modules(LIBXDG_BASEDIR REQUIRED libxdg-basedir)
  9. # sqlite3 is not a direct dependency, but vsqlite++ has no cmake- or pkg-config
  10. # module. Since it installs in the same directories as sqlite3, I am adding the
  11. # module here to add the include- and link directories below. It is not REQUIRED
  12. # because the sqlite3 in Debian jessie doesn't come with a pkg-config module.
  13. pkg_check_modules(SQLITE3 sqlite3)
  14. find_package(Qt5Core CONFIG REQUIRED)
  15. if(NOT WITHOUT_GUI)
  16. find_package(Qt5Widgets CONFIG REQUIRED)
  17. pkg_check_modules(LIBCONFIG REQUIRED libconfig++)
  18. endif()
  19. set(CMAKE_CXX_STANDARD 14)
  20. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  21. set(CMAKE_CXX_EXTENSIONS OFF)
  22. set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -g -Og")
  23. set(CMAKE_AUTOMOC ON)
  24. set(CMAKE_AUTOUIC ON)
  25. include_directories(${PROJECT_BINARY_DIR})
  26. include_directories(${LIBXDG_BASEDIR_INCLUDE_DIRS})
  27. include_directories(${SQLITE3_INCLUDE_DIRS})
  28. include_directories(${LIBCONFIG_INCLUDE_DIRS})
  29. link_directories(${LIBXDG_BASEDIR_LIBRARY_DIRS})
  30. link_directories(${SQLITE3_LIBRARY_DIRS})
  31. link_directories(${LIBCONFIG_LIBRARY_DIRS})
  32. # Write version in header
  33. configure_file (
  34. "${PROJECT_SOURCE_DIR}/src/version.hpp.in"
  35. "${PROJECT_BINARY_DIR}/version.hpp"
  36. )
  37. set(COMMON_LIBRARIES
  38. ${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs)
  39. add_executable(whyblocked
  40. src/interface_text.cpp src/whyblocked.cpp)
  41. target_link_libraries(whyblocked ${COMMON_LIBRARIES} Qt5::Core)
  42. install(TARGETS whyblocked DESTINATION ${CMAKE_INSTALL_BINDIR})
  43. if(NOT WITHOUT_GUI)
  44. add_executable(whyblocked-gui
  45. src/interface_qt.cpp src/whyblocked.cpp src/xdgcfg.cpp)
  46. target_link_libraries(whyblocked-gui
  47. ${COMMON_LIBRARIES} Qt5::Widgets
  48. ${LIBCONFIG_LIBRARIES} stdc++fs)
  49. install(TARGETS whyblocked-gui DESTINATION ${CMAKE_INSTALL_BINDIR})
  50. install(FILES de.tastytea.Whyblocked.desktop DESTINATION
  51. ${CMAKE_INSTALL_DATAROOTDIR}/applications)
  52. install(FILES de.tastytea.Whyblocked.appdata.xml DESTINATION
  53. ${CMAKE_INSTALL_DATAROOTDIR}/metainfo)
  54. install(FILES de.tastytea.Whyblocked.svg DESTINATION
  55. ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps)
  56. endif()
  57. if(NOT WITHOUT_TRANSLATIONS)
  58. add_subdirectory(translations)
  59. endif()
  60. include(packages.CMakeLists.txt)