mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-11-01 21:13:12 +01:00
ci: add cmake tests for installed and embedded build
This commit is contained in:
17
example/cmake/CMakeLists.txt
Normal file
17
example/cmake/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
cmake_minimum_required (VERSION 3.0)
|
||||
project (example)
|
||||
|
||||
if(EXAMPLE_MSGPACK_EMBEDDED)
|
||||
add_subdirectory(msgpack-c)
|
||||
set(msgpack_DIR ${CMAKE_CURRENT_BINARY_DIR}/msgpack-c)
|
||||
endif()
|
||||
|
||||
find_package(msgpack REQUIRED)
|
||||
|
||||
add_executable (${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/../c/simple_c.c)
|
||||
target_link_libraries(${PROJECT_NAME} msgpackc)
|
||||
|
||||
if(TARGET msgpackc-static)
|
||||
add_executable (${PROJECT_NAME}-static ${CMAKE_CURRENT_LIST_DIR}/../c/simple_c.c)
|
||||
target_link_libraries(${PROJECT_NAME}-static msgpackc-static)
|
||||
endif()
|
||||
Reference in New Issue
Block a user