mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00

Setting CMAKE_CXX_STANDARD and CMAKE_CXX_STANDARD_REQUIRED directly is problematic when including yaml-cpp as a subproject. The proper way is to set these per-target.
27 lines
594 B
CMake
27 lines
594 B
CMake
cmake_minimum_required(VERSION 3.5)
|
|
|
|
add_sources(parse.cpp)
|
|
add_executable(parse parse.cpp)
|
|
set_target_properties(parse PROPERTIES
|
|
CXX_STANDARD 11
|
|
CXX_STANDARD_REQUIRED ON
|
|
)
|
|
target_link_libraries(parse yaml-cpp)
|
|
|
|
add_sources(sandbox.cpp)
|
|
add_executable(sandbox sandbox.cpp)
|
|
set_target_properties(sandbox PROPERTIES
|
|
CXX_STANDARD 11
|
|
CXX_STANDARD_REQUIRED ON
|
|
)
|
|
target_link_libraries(sandbox yaml-cpp)
|
|
|
|
add_sources(read.cpp)
|
|
add_executable(read read.cpp)
|
|
set_target_properties(read PROPERTIES
|
|
CXX_STANDARD 11
|
|
CXX_STANDARD_REQUIRED ON
|
|
)
|
|
target_link_libraries(read yaml-cpp)
|
|
|