This repository has been archived on 2020-04-18. You can view files and clone it, but cannot push or open issues or pull requests.
FediPotato/lib/src/CMakeLists.txt

31 lines
836 B
CMake

include(GNUInstallDirs)
find_package(mastodonpp 0.5.4 REQUIRED CONFIG)
find_package(Filesystem REQUIRED)
find_package(nlohmann_json REQUIRED CONFIG)
find_package(Boost 1.62.0 REQUIRED COMPONENTS chrono thread)
add_library(${PROJECT_NAME})
file(GLOB_RECURSE sources_lib *.cpp)
file(GLOB_RECURSE headers_lib *.hpp)
target_sources(${PROJECT_NAME}
PRIVATE "${sources_lib}" "${headers_lib}")
set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR})
target_link_libraries(${PROJECT_NAME}
PUBLIC
std::filesystem
nlohmann_json::nlohmann_json
mastodonpp::mastodonpp
Boost::chrono
Boost::thread)
install(TARGETS ${PROJECT_NAME}
EXPORT "${PROJECT_NAME}Targets"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")