- fix Windows build
This commit is contained in:
parent
4aea6d9613
commit
a708cebadb
|
|
@ -1,5 +1,4 @@
|
||||||
# 3.5 is actually available almost everywhere, but this a good minimum
|
cmake_minimum_required(VERSION 3.20)
|
||||||
cmake_minimum_required(VERSION 3.4)
|
|
||||||
|
|
||||||
# enable MSVC_RUNTIME_LIBRARY target property
|
# enable MSVC_RUNTIME_LIBRARY target property
|
||||||
# see https://cmake.org/cmake/help/latest/policy/CMP0091.html
|
# see https://cmake.org/cmake/help/latest/policy/CMP0091.html
|
||||||
|
|
@ -17,19 +16,13 @@ include(CTest)
|
||||||
|
|
||||||
find_program(YAML_CPP_CLANG_FORMAT_EXE NAMES clang-format)
|
find_program(YAML_CPP_CLANG_FORMAT_EXE NAMES clang-format)
|
||||||
|
|
||||||
option(YAML_CPP_BUILD_CONTRIB "Enable yaml-cpp contrib in library" ON)
|
option(YAML_CPP_BUILD_CONTRIB "Enable yaml-cpp contrib in library" OFF)
|
||||||
option(YAML_CPP_BUILD_TOOLS "Enable parse tools" ON)
|
option(YAML_CPP_BUILD_TOOLS "Enable parse tools" OFF)
|
||||||
option(YAML_BUILD_SHARED_LIBS "Build yaml-cpp shared library" ${BUILD_SHARED_LIBS})
|
option(YAML_BUILD_SHARED_LIBS "Build yaml-cpp shared library" OFF)
|
||||||
|
|
||||||
cmake_dependent_option(YAML_CPP_BUILD_TESTS
|
option(YAML_CPP_BUILD_TESTS "Enable yaml-cpp tests" OFF)
|
||||||
"Enable yaml-cpp tests" ON
|
option(YAML_CPP_INSTALL "Enable generation of yaml-cpp install targets" OFF)
|
||||||
"BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)
|
option(YAML_MSVC_SHARED_RT "MSVC: Build yaml-cpp with shared runtime libs (/MD)" OFF)
|
||||||
cmake_dependent_option(YAML_CPP_INSTALL
|
|
||||||
"Enable generation of yaml-cpp install targets" ON
|
|
||||||
"CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)
|
|
||||||
cmake_dependent_option(YAML_MSVC_SHARED_RT
|
|
||||||
"MSVC: Build yaml-cpp with shared runtime libs (/MD)" ON
|
|
||||||
"MSVC" OFF)
|
|
||||||
|
|
||||||
set(yaml-cpp-type STATIC)
|
set(yaml-cpp-type STATIC)
|
||||||
set(yaml-cpp-label-postfix "static")
|
set(yaml-cpp-label-postfix "static")
|
||||||
|
|
@ -158,13 +151,13 @@ if (YAML_CPP_INSTALL)
|
||||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/pkgconfig)
|
DESTINATION ${CMAKE_INSTALL_DATADIR}/pkgconfig)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(YAML_CPP_BUILD_TESTS)
|
#if(YAML_CPP_BUILD_TESTS)
|
||||||
add_subdirectory(test)
|
# add_subdirectory(test)
|
||||||
endif()
|
#endif()
|
||||||
|
#
|
||||||
if(YAML_CPP_BUILD_TOOLS)
|
#if(YAML_CPP_BUILD_TOOLS)
|
||||||
add_subdirectory(util)
|
# add_subdirectory(util)
|
||||||
endif()
|
#endif()
|
||||||
|
|
||||||
if (YAML_CPP_CLANG_FORMAT_EXE)
|
if (YAML_CPP_CLANG_FORMAT_EXE)
|
||||||
add_custom_target(format
|
add_custom_target(format
|
||||||
|
|
@ -173,3 +166,6 @@ if (YAML_CPP_CLANG_FORMAT_EXE)
|
||||||
COMMENT "Running clang-format"
|
COMMENT "Running clang-format"
|
||||||
VERBATIM)
|
VERBATIM)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set_property(TARGET yaml-cpp PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue