msgpack/example/cmake/CMakeLists.txt
Takatoshi Kondo 01f3d24fee Unify all package related names to msgpack-c.
Update the version to 6.0.0.
2023-02-28 10:49:13 +09:00

18 lines
531 B
CMake

cmake_minimum_required (VERSION 3.0)
project (example)
if(EXAMPLE_MSGPACK_EMBEDDED)
add_subdirectory(msgpack-c)
set(msgpack-c_DIR ${CMAKE_CURRENT_BINARY_DIR}/msgpack-c)
endif()
find_package(msgpack-c REQUIRED)
add_executable (${PROJECT_NAME} ${CMAKE_CURRENT_LIST_DIR}/../simple_c.c)
target_link_libraries(${PROJECT_NAME} msgpack-c)
if(TARGET msgpack-c-static)
add_executable (${PROJECT_NAME}-static ${CMAKE_CURRENT_LIST_DIR}/../simple_c.c)
target_link_libraries(${PROJECT_NAME}-static msgpack-c-static)
endif()