mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-11-02 14:03:43 +01:00
Add cmake package config support
Add support for CMake find_package command to msgpack. The package exports the two targets msgpackc-static and msgpackc if shared is enabled. The CMake find_package command works after installation of msgpack and during build of another project which adds msgpack as sub project via add_subdirectory command. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
This commit is contained in:
23
msgpack-config.cmake.in
Normal file
23
msgpack-config.cmake.in
Normal file
@@ -0,0 +1,23 @@
|
||||
#.rst:
|
||||
# msgpack
|
||||
# -------
|
||||
#
|
||||
# The following import targets are created
|
||||
#
|
||||
# ::
|
||||
#
|
||||
# msgpackc-static
|
||||
# msgpackc
|
||||
#
|
||||
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
|
||||
if(NOT TARGET msgpackc AND NOT TARGET msgpackc-static)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/msgpack-targets.cmake")
|
||||
|
||||
if(NOT @MSGPACK_ENABLE_SHARED@)
|
||||
add_library(msgpackc ALIAS msgpackc-static)
|
||||
endif()
|
||||
endif()
|
||||
Reference in New Issue
Block a user