2019-12-16 15:21:06 +01:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2019-12-20 01:13:19 +01:00
|
|
|
# The minimum versions should be in Debian oldstable, if possible.
|
2019-12-25 23:05:48 +01:00
|
|
|
find_package(Boost 1.62 REQUIRED COMPONENTS filesystem log regex)
|
2020-05-02 23:53:30 +02:00
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_check_modules(jsoncpp REQUIRED IMPORTED_TARGET jsoncpp)
|
2019-12-20 01:13:19 +01:00
|
|
|
find_package(Threads REQUIRED)
|
2020-11-13 14:29:46 +01:00
|
|
|
find_package(mastodonpp 0.5.6 REQUIRED CONFIG)
|
2019-12-16 15:21:06 +01:00
|
|
|
|
2020-11-21 22:30:24 +01:00
|
|
|
add_subdirectory(curl_wrapper)
|
2019-12-25 22:50:25 +01:00
|
|
|
|
2019-12-20 01:13:19 +01:00
|
|
|
# Write version in header.
|
2019-12-29 10:32:16 +01:00
|
|
|
configure_file ("${PROJECT_SOURCE_DIR}/src/version.hpp.in"
|
|
|
|
"${PROJECT_BINARY_DIR}/version.hpp" @ONLY)
|
2019-12-20 01:13:19 +01:00
|
|
|
|
|
|
|
include_directories("${PROJECT_BINARY_DIR}")
|
2019-12-16 15:21:06 +01:00
|
|
|
|
|
|
|
file(GLOB sources *.cpp)
|
|
|
|
add_executable(mastorss ${sources})
|
|
|
|
target_link_libraries(mastorss
|
2019-12-24 18:53:45 +01:00
|
|
|
PRIVATE
|
2020-11-21 22:30:24 +01:00
|
|
|
PkgConfig::jsoncpp curl_wrapper mastodonpp::mastodonpp
|
2019-12-25 23:05:48 +01:00
|
|
|
Boost::filesystem Boost::log Boost::regex)
|
2019-12-24 18:53:45 +01:00
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
target_compile_definitions(mastorss PRIVATE "BOOST_ALL_DYN_LINK=1")
|
|
|
|
endif()
|
2019-12-20 01:13:19 +01:00
|
|
|
install(TARGETS mastorss DESTINATION "${CMAKE_INSTALL_BINDIR}")
|