libravatarserv is a simple libravatar server.
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 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. cmake_minimum_required (VERSION 3.2)
  2. project(libravatarserv
  3. VERSION 0.6.8
  4. LANGUAGES CXX
  5. )
  6. include(GNUInstallDirs)
  7. find_package(PkgConfig REQUIRED)
  8. pkg_check_modules(MAGICPP REQUIRED Magick++)
  9. pkg_check_modules(LIBCRYPTOPP libcryptopp)
  10. if(NOT LIBCRYPTOPP_FOUND)
  11. # Debian stretch package installs libcrypto++.pc
  12. pkg_check_modules(LIBCRYPTOPP REQUIRED libcrypto++)
  13. endif()
  14. pkg_check_modules(LIBXDG_BASEDIR REQUIRED libxdg-basedir)
  15. set(CMAKE_CXX_STANDARD 14)
  16. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  17. set(CMAKE_CXX_EXTENSIONS OFF)
  18. string(REPLACE ";" " " MAGICPP_CFLAGS_STRING "${MAGICPP_CFLAGS}")
  19. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MAGICPP_CFLAGS_STRING}")
  20. set(CMAKE_CXX_FLAGS_DEBUG
  21. "${CMAKE_CXX_FLAGS_DEBUG} -Wall -pedantic -Wextra -g -Og")
  22. include_directories(${PROJECT_BINARY_DIR})
  23. include_directories(${MAGICPP_INCLUDE_DIRS})
  24. include_directories(${LIBCRYPTOPP_INCLUDE_DIRS})
  25. include_directories(${LIBXDG_BASEDIR_INCLUDE_DIRS})
  26. link_directories(${MAGICPP_LIBRARY_DIRS})
  27. link_directories(${LIBCRYPTOPP_LIBRARY_DIRS})
  28. link_directories(${LIBXDG_BASEDIR_LIBRARY_DIRS})
  29. # Write version in header
  30. configure_file(
  31. "${PROJECT_SOURCE_DIR}/src/version.hpp.in"
  32. "${PROJECT_BINARY_DIR}/version.hpp"
  33. )
  34. file(GLOB sources src/*.cpp)
  35. add_executable(${CMAKE_PROJECT_NAME} "${sources}")
  36. target_link_libraries(${CMAKE_PROJECT_NAME}
  37. "${MAGICPP_LDFLAGS} ${LIBCRYPTOPP_LDFLAGS}"
  38. "${LIBXDG_BASEDIR_LDFLAGS} -lstdc++fs")
  39. install(TARGETS ${CMAKE_PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
  40. install(FILES README.md DESTINATION ${CMAKE_INSTALL_DOCDIR})
  41. include(packages.CMakeLists.txt)