A Mastodon bot that expands shortened URLs.
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.7)
  2. project (expandurl-mastodon
  3. VERSION 0.9.13
  4. LANGUAGES CXX
  5. )
  6. include(GNUInstallDirs)
  7. find_package(CURL REQUIRED)
  8. find_package(PkgConfig REQUIRED)
  9. pkg_check_modules(CURLPP REQUIRED curlpp)
  10. pkg_check_modules(JSONCPP REQUIRED jsoncpp)
  11. pkg_check_modules(LIBXDG_BASEDIR REQUIRED libxdg-basedir)
  12. set(CMAKE_CXX_STANDARD 14)
  13. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  14. set(CMAKE_CXX_EXTENSIONS OFF)
  15. set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")
  16. if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
  17. # uint_fast16_t can be bigger than 16 bit, but that doesn't matter because
  18. # everything but the last 16 bit is padded with zeroes.
  19. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format")
  20. endif()
  21. include_directories(${PROJECT_SOURCE_DIR}/src)
  22. include_directories(${PROJECT_BINARY_DIR})
  23. include_directories(${CURL_INCLUDE_DIRS})
  24. include_directories(${CURLPP_INCLUDE_DIRS})
  25. include_directories(${JSONCPP_INCLUDE_DIRS})
  26. include_directories(${LIBXDG_BASEDIR_INCLUDE_DIRS})
  27. link_directories(${CURL_LIBRARY_DIRS})
  28. link_directories(${CURLPP_LIBRARY_DIRS})
  29. link_directories(${JSONCPP_LIBRARY_DIRS})
  30. link_directories(${LIBXDG_BASEDIR_LIBRARY_DIRS})
  31. # Write version in header
  32. configure_file (
  33. "${PROJECT_SOURCE_DIR}/src/version.hpp.in"
  34. "${PROJECT_BINARY_DIR}/version.hpp"
  35. )
  36. file(GLOB sources src/*.cpp)
  37. add_executable(expandurl-mastodon ${sources})
  38. target_link_libraries(expandurl-mastodon
  39. ${CURLPP_LIBRARIES} ${JSONCPP_LIBRARIES}
  40. ${LIBXDG_BASEDIR_LIBRARIES} mastodon-cpp pthread stdc++fs)
  41. install(TARGETS expandurl-mastodon DESTINATION ${CMAKE_INSTALL_BINDIR})