Support CMake 3.12.

Ubuntu 20.04 has 3.16, so requiring 3.17 is a bit mean.
This commit is contained in:
tastytea 2021-05-25 07:30:34 +02:00
parent 8dfafae025
commit acb9f4d975
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
4 changed files with 14 additions and 5 deletions

View File

@ -42,10 +42,10 @@ steps:
- name: debian-package-cache
path: /var/cache/apt/archives
- name: Download CMake 3.17 installer
- name: Download CMake 3.12 installer
image: plugins/download
settings:
source: https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.sh
source: https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.sh
destination: cmake_installer.sh
- name: GCC 7 / clang 6

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.17...3.18)
cmake_minimum_required(VERSION 3.12...3.18)
# Global build options.
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "The type of build.")

View File

@ -43,7 +43,7 @@ image::https://repology.org/badge/vertical-allrepos/epubgrep.svg[]
* Tested OS: Linux
* C\++ compiler with C++17 support (tested: link:{uri-gcc}[GCC] 7/10,
link:{uri-clang}[clang] 6/11)
* link:{uri-cmake}[CMake] (at least: 3.17)
* link:{uri-cmake}[CMake] (at least: 3.12)
* link:{uri-boost}[Boost] (tested: 1.75.0 / 1.65.0)
* link:{uri-gettext}[gettext] (tested: 0.21 / 0.19)
* link:{uri-libarchive}[libarchive] (tested: 3.5 / 3.2)

View File

@ -21,9 +21,18 @@ target_link_libraries(${PROJECT_NAME}_lib
Boost::program_options
Boost::regex
std::filesystem
LibArchive::LibArchive
fmt::fmt)
if(${CMAKE_VERSION} VERSION_LESS 3.17)
target_link_libraries(${PROJECT_NAME}_lib
PUBLIC ${LibArchive_LIBRARIES})
target_include_directories(${PROJECT_NAME}_lib
PUBLIC ${LibArchive_INCLUDE_DIRS})
else()
target_link_libraries(${PROJECT_NAME}_lib
PUBLIC LibArchive::LibArchive)
endif()
target_include_directories(${PROJECT_NAME}_lib
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"