mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
Allow yaml-cpp to be installed from another project (#1007)
Changes YAML_CPP_INSTALL from a cmake_dependent_option to an option. Fixes #756, #847, and #1011.
This commit is contained in:
@@ -9,6 +9,11 @@ endif()
|
|||||||
|
|
||||||
project(YAML_CPP VERSION 0.7.0 LANGUAGES CXX)
|
project(YAML_CPP VERSION 0.7.0 LANGUAGES CXX)
|
||||||
|
|
||||||
|
set(YAML_CPP_MAIN_PROJECT OFF)
|
||||||
|
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||||
|
set(YAML_CPP_MAIN_PROJECT ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
include(CMakeDependentOption)
|
include(CMakeDependentOption)
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
@@ -17,6 +22,7 @@ include(GNUInstallDirs)
|
|||||||
option(YAML_CPP_BUILD_CONTRIB "Enable yaml-cpp contrib in library" ON)
|
option(YAML_CPP_BUILD_CONTRIB "Enable yaml-cpp contrib in library" ON)
|
||||||
option(YAML_CPP_BUILD_TOOLS "Enable parse tools" ON)
|
option(YAML_CPP_BUILD_TOOLS "Enable parse tools" ON)
|
||||||
option(YAML_BUILD_SHARED_LIBS "Build yaml-cpp shared library" ${BUILD_SHARED_LIBS})
|
option(YAML_BUILD_SHARED_LIBS "Build yaml-cpp shared library" ${BUILD_SHARED_LIBS})
|
||||||
|
option(YAML_CPP_INSTALL "Enable generation of yaml-cpp install targets" ${YAML_CPP_MAIN_PROJECT})
|
||||||
option(YAML_CPP_FORMAT_SOURCE "Format source" ON)
|
option(YAML_CPP_FORMAT_SOURCE "Format source" ON)
|
||||||
|
|
||||||
if (YAML_CPP_BUILD_TESTS)
|
if (YAML_CPP_BUILD_TESTS)
|
||||||
@@ -30,9 +36,6 @@ endif()
|
|||||||
cmake_dependent_option(YAML_CPP_BUILD_TESTS
|
cmake_dependent_option(YAML_CPP_BUILD_TESTS
|
||||||
"Enable yaml-cpp tests" ON
|
"Enable yaml-cpp tests" ON
|
||||||
"BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)
|
"BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" 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
|
cmake_dependent_option(YAML_MSVC_SHARED_RT
|
||||||
"MSVC: Build yaml-cpp with shared runtime libs (/MD)" ON
|
"MSVC: Build yaml-cpp with shared runtime libs (/MD)" ON
|
||||||
"CMAKE_SYSTEM_NAME MATCHES Windows" OFF)
|
"CMAKE_SYSTEM_NAME MATCHES Windows" OFF)
|
||||||
|
Reference in New Issue
Block a user