mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-08 12:21:17 +00:00
Refactor CMake to use more modern paradigms (#741)
Remove 2.6-isms Remove 2.8-isms Bump CMake minimum version to 3.4 Disable some options when used as a subdirectory Use `CONFIGURE_DEPENDS` with `file(GLOB)` when possible Backport CMake 3.15's MSVC_RUNTIME_LIBRARY setting. Set all compile options as generator expressions. Set all find-package files to be installed to the correct file. Remove `export(PACKAGE)`, as this has been deprecated. Remove fat binary support Remove manual setting of iPhone settings. These should be set by parent projects. Remove use of ExternalProject for a local use Conditionally remove format target unless clang-format is found
This commit is contained in:

committed by
Jesse Beder

parent
9a3624205e
commit
5e9cb0128d
@@ -1,26 +1,32 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
add_executable(yaml-cpp-sandbox sandbox.cpp)
|
||||
add_executable(yaml-cpp-parse parse.cpp)
|
||||
add_executable(yaml-cpp-read read.cpp)
|
||||
|
||||
add_sources(parse.cpp)
|
||||
add_executable(parse parse.cpp)
|
||||
set_target_properties(parse PROPERTIES
|
||||
CXX_STANDARD 11
|
||||
target_link_libraries(yaml-cpp-sandbox PRIVATE yaml-cpp)
|
||||
target_link_libraries(yaml-cpp-parse PRIVATE yaml-cpp)
|
||||
target_link_libraries(yaml-cpp-read PRIVATE yaml-cpp)
|
||||
|
||||
set_property(TARGET yaml-cpp-sandbox PROPERTY OUTPUT_NAME sandbox)
|
||||
set_property(TARGET yaml-cpp-parse PROPERTY OUTPUT_NAME parse)
|
||||
set_property(TARGET yaml-cpp-read PROPERTY OUTPUT_NAME read)
|
||||
|
||||
set_target_properties(yaml-cpp-sandbox
|
||||
PROPERTIES
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
)
|
||||
target_link_libraries(parse yaml-cpp)
|
||||
OUTPUT_NAME sandbox)
|
||||
|
||||
add_sources(sandbox.cpp)
|
||||
add_executable(sandbox sandbox.cpp)
|
||||
set_target_properties(sandbox PROPERTIES
|
||||
CXX_STANDARD 11
|
||||
set_target_properties(yaml-cpp-parse
|
||||
PROPERTIES
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
)
|
||||
target_link_libraries(sandbox yaml-cpp)
|
||||
OUTPUT_NAME parse)
|
||||
|
||||
add_sources(read.cpp)
|
||||
add_executable(read read.cpp)
|
||||
set_target_properties(read PROPERTIES
|
||||
CXX_STANDARD 11
|
||||
set_target_properties(yaml-cpp-read
|
||||
PROPERTIES
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
)
|
||||
target_link_libraries(read yaml-cpp)
|
||||
OUTPUT_NAME read)
|
||||
|
||||
if (NOT DEFINED CMAKE_CXX_STANDARD)
|
||||
set_target_properties(yaml-cpp-sandbox yaml-cpp-parse yaml-cpp-read
|
||||
PROPERTIES
|
||||
CXX_STANDARD 11)
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user