Skip to content

Commit

Permalink
Merge pull request #218 from poacpm/bump/cmake-version
Browse files Browse the repository at this point in the history
Bump cmake_minimum_required version from 3.11 to 3.13
  • Loading branch information
ken-matsui authored Nov 30, 2020
2 parents 1c2c941 + 715e5ed commit 0daa46b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
23 changes: 4 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FATAL: In-source builds are not allowed.
")
endif ()

cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.13)
project(poac VERSION 0.2.1 LANGUAGES CXX)
option(poac_BUILD_TEST "Do not build tests by default" OFF) # -Dpoac_BUILD_TEST=ON

Expand Down Expand Up @@ -95,29 +95,18 @@ if (NOT ${Boost_FOUND})
endif ()
target_include_directories(${PROJECT_NAME} PRIVATE ${Boost_INCLUDE_DIRS})
message(STATUS "Boost include directory is ... ${Boost_INCLUDE_DIRS}")
if (${CMAKE_VERSION} VERSION_LESS 3.13)
link_directories(${Boost_LIBRARY_DIRS})
else ()
target_link_directories(${PROJECT_NAME} PRIVATE ${Boost_LIBRARY_DIRS})
endif()
target_link_directories(${PROJECT_NAME} PRIVATE ${Boost_LIBRARY_DIRS})
message(STATUS "Boost library directories are ... ${Boost_LIBRARY_DIRS}")
# If boost version greater than 1.69.0 and cmake version less then 3.12, occur error.
if (${Boost_VERSION} GREATER 106900)
if (${CMAKE_VERSION} VERSION_LESS 3.12)
message(FATAL_ERROR "If cmake version less than 3.12, CMake can't use Boost::libname style.")
endif ()
set(BOOST_LIBS Boost::system)
else ()
set(BOOST_LIBS ${Boost_SYSTEM_LIBRARY})
endif ()

if (DEFINED GIT2_DIR)
target_include_directories(${PROJECT_NAME} PRIVATE ${GIT2_DIR}/include)
if (${CMAKE_VERSION} VERSION_LESS 3.13)
link_directories(${GIT2_DIR}/lib)
else ()
target_link_directories(${PROJECT_NAME} PRIVATE ${GIT2_DIR}/lib)
endif()
target_link_directories(${PROJECT_NAME} PRIVATE ${GIT2_DIR}/lib)
endif ()

if (DEFINED TOML11_DIR)
Expand All @@ -130,11 +119,7 @@ endif ()

if (DEFINED FMT_DIR)
target_include_directories(${PROJECT_NAME} PRIVATE ${FMT_DIR}/include)
if (${CMAKE_VERSION} VERSION_LESS 3.13)
link_directories(${FMT_DIR}/lib)
else ()
target_link_directories(${PROJECT_NAME} PRIVATE ${FMT_DIR}/lib)
endif()
target_link_directories(${PROJECT_NAME} PRIVATE ${FMT_DIR}/lib)
endif ()

if (APPLE)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ curl -fsSL https://sh.poac.pm | bash
### Manual install (Build)

Poac requires the following tools and packages to build:
* [`cmake`](https://github.com/Kitware/CMake): `3.11` or later
* [`cmake`](https://github.com/Kitware/CMake): `3.13` or later
* [`boost`](https://github.com/boostorg): `1.66.0` or later
* [`openssl`](https://github.com/openssl/openssl): as new as possible
* [`libgit2`](https://github.com/libgit2/libgit2): `0.27` or later
Expand Down

0 comments on commit 0daa46b

Please sign in to comment.