NUMCPP_NO_USE_BOOST is not respected in NumCppConfig.cmake
torsten-pf opened this issue · comments
Describe the bug
If NUMCPP_NO_USE_BOOST is defined during build, the resulting NumCppConfig.cmake
file contains the find_package(Boost REQUIRED COMPONENTS date_time)
call and results in a build error.
Expected behavior
No call to find_package(BOOST...)
when NUMCPP_NO_USE_BOOST
was defined during CMake build / install.
Workaround
Replace
find_package(Boost REQUIRED COMPONENTS date_time)
set_property(TARGET @PROJECT_NAME@::@PROJECT_NAME@ APPEND
PROPERTY
INTERFACE_LINK_LIBRARIES
Boost::boost
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:Boost::date_time>
)
with
if(@NUMCPP_NO_USE_BOOST@)
# Is there any chance to globally define NUMCPP_NO_USE_BOOST for the compiler here?
else()
find_package(Boost REQUIRED COMPONENTS date_time)
set_property(TARGET @PROJECT_NAME@::@PROJECT_NAME@ APPEND
PROPERTY
INTERFACE_LINK_LIBRARIES
Boost::boost
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:Boost::date_time>
)
endif()
The comment is intended as a question to all of you.
Fixed in Release Version 2.10.1