cmake_minimum_required(VERSION 3.10) project(launchpadlib-cpp VERSION 0.0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(nlohmann_json REQUIRED) find_package(OpenSSL REQUIRED) find_package(CURL REQUIRED) find_package(PkgConfig REQUIRED) find_package(date REQUIRED) pkg_check_modules(LIBSECRET REQUIRED libsecret-1) add_library(launchpad SHARED src/launchpad.cpp src/archive.cpp src/archive_permission.cpp src/utils.cpp src/person.cpp src/distribution.cpp src/authentication.cpp src/source_package_publishing_history.cpp src/build.cpp src/binary_package_publishing_history.cpp src/archive_dependency.cpp src/distro_series.cpp src/distro_arch_series.cpp src/distro_arch_series_filter.cpp ) target_include_directories(launchpad PUBLIC ${LIBSECRET_INCLUDE_DIRS} ) target_compile_definitions(launchpad PRIVATE BUILDING_LAUNCHPAD) set_target_properties(launchpad PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION 0 PUBLIC_HEADER "src/lazy_optional.h;src/launchpad.h;src/callablewrapper.h;src/archive.h;src/archive_permission.h;src/utils.h;src/person.h;src/distribution.h;src/authentication.h;src/source_package_publishing_history.h;src/build.h;src/binary_package_publishing_history.h;src/archive_dependency.h;src/distro_series.h;src/distro_arch_series.h;src/distro_arch_series_filter.h" ) install(TARGETS launchpad EXPORT launchpadTargets LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin PUBLIC_HEADER DESTINATION include/launchpadlib-cpp ) install(EXPORT launchpadTargets FILE launchpadTargets.cmake NAMESPACE launchpad:: DESTINATION lib/cmake/launchpadlib-cpp ) include(CMakePackageConfigHelpers) configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/launchpadConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/launchpadConfig.cmake" INSTALL_DESTINATION lib/cmake/launchpadlib-cpp NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO ) write_basic_package_version_file( "${CMAKE_CURRENT_BINARY_DIR}/launchpadConfigVersion.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/launchpadConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/launchpadConfigVersion.cmake" DESTINATION lib/cmake/launchpadlib-cpp ) target_link_libraries(launchpad PRIVATE nlohmann_json::nlohmann_json OpenSSL::Crypto CURL::libcurl date::date-tz ${LIBSECRET_LIBRARIES} )