Commit 5e0bb1c8da99a95708f504640f2b55fee40fbedc

Authored by Henry Schreiner
Committed by GitHub
1 parent c9123811

Fix Boost CMake (#226)

* Fixing typos in FindBoost

* Minimum required Boost is actually 1.61
CHANGELOG.md
... ... @@ -8,6 +8,7 @@ Set handling has been completely replaced by a new backend that works as a Valid
8 8 * Support for composable unnamed subcommands [#216]
9 9 * Custom vector separator [#209], [#221]
10 10 * Validators added for IP4 addresses and positive numbers [#210]
  11 +* Minimum required Boost for optional Optionals has been corrected to 1.61
11 12  
12 13 > ### Converting from CLI11 1.7:
13 14 >
... ...
CMakeLists.txt
... ... @@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 3.4)
2 2 # Note: this is a header only library. If you have an older CMake than 3.4,
3 3 # just add the CLI11/include directory and that's all you need to do.
4 4  
5   -# Make sure users don't get warnings on a tested (3.4 to 3.12) version
  5 +# Make sure users don't get warnings on a tested (3.4 to 3.13) version
6 6 # of CMake. For most of the policies, the new version is better (hence the change).
7   -if(${CMAKE_VERSION} VERSION_LESS 3.12)
  7 +if(${CMAKE_VERSION} VERSION_LESS 3.13)
8 8 cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
9 9 else()
10   - cmake_policy(VERSION 3.12)
  10 + cmake_policy(VERSION 3.13)
11 11 endif()
12 12  
13 13 set(VERSION_REGEX "#define CLI11_VERSION[ \t]+\"(.+)\"")
... ...
include/CLI/Optional.hpp
... ... @@ -29,7 +29,7 @@
29 29  
30 30 #if __has_include(<boost/optional.hpp>) && !defined(CLI11_BOOST_OPTIONAL)
31 31 #include <boost/version.hpp>
32   -#if BOOST_VERSION >= 105800
  32 +#if BOOST_VERSION >= 106100
33 33 #define CLI11_BOOST_OPTIONAL 1
34 34 #endif
35 35 #elif !defined(CLI11_BOOST_OPTIONAL)
... ...
tests/CMakeLists.txt
... ... @@ -110,14 +110,14 @@ file(WRITE &quot;${PROJECT_BINARY_DIR}/CTestCustom.cmake&quot;
110 110 )
111 111  
112 112 # Add boost to test boost::optional if available
113   -find_package(Boost 1.58)
  113 +find_package(Boost 1.61)
114 114 if(Boost_FOUND)
115   - if (TARGET Boost::boost)
  115 + if(TARGET Boost::boost)
116 116 target_link_libraries(informational PUBLIC Boost::boost)
117 117 target_link_libraries(OptionalTest PUBLIC Boost::boost)
118 118 else()
119   - target_link_libraries(informational PUBLIC ${Boost_INCLUDE_DIR})
120   - target_link_libraries(OptionalTest PUBLIC ${BOOST_INCLUDE_DIR})
  119 + target_include_directories(informational PUBLIC ${Boost_INCLUDE_DIRS})
  120 + target_include_directories(OptionalTest PUBLIC ${Boost_INCLUDE_DIRS})
121 121 endif()
122 122 # Enforce Boost::Optional even if __has_include is missing on your compiler
123 123 target_compile_definitions(informational PUBLIC CLI11_BOOST_OPTIONAL)
... ...