yaml-cpp.cmake 945 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

find_package(Git REQUIRED)

include(ExternalProject)

message("${CMAKE_BUILD_TYPE}")

ExternalProject_Add(
        ext-yaml-cpp
        GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
        GIT_TAG e0e01d53c27ffee6c86153fa41e7f5e57d3e5c90
        CMAKE_ARGS
        -DYAML_CPP_BUILD_TESTS=OFF
		-DYAML_CPP_BUILD_TOOLS=OFF
        -DYAML_CPP_INSTALL=OFF
        -DYAML_CPP_BUILD_CONTRIB=OFF
		-DMSVC_SHARED_RT=OFF
		-DBUILD_SHARED_LIBS=OFF
        -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
        -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
        -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
        -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
        -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}/ext/yaml-cpp/lib
        -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}/ext/yaml-cpp/lib
        PREFIX "${CMAKE_BINARY_DIR}/ext/yaml-cpp"
        # Disable install step
        INSTALL_COMMAND ""
	    LOG_DOWNLOAD ON
)