dpilger26 / NumCpp

C++ implementation of the Python Numpy library
https://dpilger26.github.io/NumCpp
MIT License
3.59k stars 554 forks source link

NUMCPP_NO_USE_BOOST is not respected in NumCppConfig.cmake #184

Closed torsten-pf closed 1 year ago

torsten-pf commented 1 year ago

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.

dpilger26 commented 1 year ago

Fixed in Release Version 2.10.1