mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-04-22 08:34:35 +02:00

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>
24 lines
385 B
CMake
24 lines
385 B
CMake
#.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()
|