-
Notifications
You must be signed in to change notification settings - Fork 886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevents the looking for boost if built without it for dependents #1032
Prevents the looking for boost if built without it for dependents #1032
Conversation
Codecov Report
@@ Coverage Diff @@
## cpp_master #1032 +/- ##
===========================================
Coverage 85.60% 85.60%
===========================================
Files 79 79
Lines 5023 5023
===========================================
Hits 4300 4300
Misses 723 723 |
Thank you for sending and updating the PR. Could you tell me the link of cmake manual about |
Sure! CMake is wonderfully confusing! (And I am far from an expert) When calling The file configuration step will do a search and replace for This After this PR, the config file becomes the following if we built msgpack with install/lib/cmake/msgpackc-cxx$ cat msgpack-config.cmake
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was msgpack-config.cmake.in ########
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
####################################################################################
include(CMakeFindDependencyMacro)
IF (OFF)
find_dependency(Boost REQUIRED)
ENDIF ()
include("${CMAKE_CURRENT_LIST_DIR}/msgpackc-cxx-targets.cmake")
check_required_components(msgpackc-cxx)
|
Merged. Thank you! |
You are welcome! |
The library is still using Boost for the dependents and will fail to build if the dependents do not have BOOST installed.
By adding the following to the configured file, we will fix the usage with either looking or not for Boost. (
@MSGPACK_USE_BOOST@
will be translated toON
orOFF
at configure time)