-
Notifications
You must be signed in to change notification settings - Fork 909
Closed
Description
After the split discussed in #872, it seems that if both the C and the C++ library are installed, only the C library is found. This happens as both library install a configuration file called msgpack-config.cmake
, even if there is not direct conflict as the files are installed in different directories.
Detailed example
To give you an example, I have a sample program like the following:
project(HelloWorld)
cmake_minimum_required(VERSION 3.16)
find_package(msgpack REQUIRED)
message(STATUS "msgpack_DIR: ${msgpack_DIR}")
if(TARGET msgpackc)
message(STATUS "TARGET msgpackc is found")
else()
message(STATUS "TARGET msgpackc is NOT found")
endif()
if(TARGET msgpackc-cxx)
message(STATUS "TARGET msgpackc-cxx is found")
else()
message(STATUS "TARGET msgpackc-cxx is NOT found")
endif()
If I run CMake when only the C++ library is installed in the /home/traversaro/msgpack_ws/install
prefix, I obtained the following output:
traversaro@IITICUBLAP257:~/msgpack_ws/example/build$ cmake .
-- msgpack_DIR: /home/traversaro/msgpack_ws/install/lib/cmake/msgpackc-cxx
-- TARGET msgpackc is NOT found
-- TARGET msgpackc-cxx is found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/traversaro/msgpack_ws/example/build
However, if I also install the C library in the /home/traversaro/msgpack_ws/install
prefix, the following happens, i.e. the C library is found instead, making it impossible to use the msgpackc-cxx
target:
-- msgpack_DIR: /home/traversaro/msgpack_ws/install/lib/cmake/msgpack
-- TARGET msgpackc is found
-- TARGET msgpackc-cxx is NOT found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/traversaro/msgpack_ws/example/build
Metadata
Metadata
Assignees
Labels
No labels