# Support version 3.6 and above, but use policy settings up to 3.17. cmake_minimum_required(VERSION 3.6...3.17) # Ranges are supported from 3.12, set policy to current for < 3.12. if(${CMAKE_VERSION} VERSION_LESS 3.12) cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) endif() project(gitea2rss VERSION 0.5.2 LANGUAGES CXX) # DESCRIPTION was introduced in version 3.9. if(NOT (${CMAKE_VERSION} VERSION_LESS 3.9)) set(PROJECT_DESCRIPTION "Generates RSS feeds from Gitea releases or tags.") endif() option(WITH_MAN "Compile and install manpage." YES) option(WITH_TESTS "Compile tests." NO) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) include(cmake/debug_flags.cmake) find_package(PkgConfig REQUIRED) pkg_check_modules(jsoncpp REQUIRED IMPORTED_TARGET jsoncpp) # Some distributions do not contain Poco*Config.cmake recipes. find_package(Poco COMPONENTS Foundation Net NetSSL CONFIG) add_subdirectory(src) if (WITH_MAN) add_subdirectory(man) endif() if(WITH_TESTS) add_subdirectory(tests) endif()