yaml-cpp.cmake 962 B

123456789101112131415161718192021222324252627282930
  1. find_package(Git REQUIRED)
  2. include(ExternalProject)
  3. message("${CMAKE_BUILD_TYPE}")
  4. ExternalProject_Add(
  5. ext-yaml-cpp
  6. URL https://bj.bcebos.com/paddlex/deploy/deps/yaml-cpp.zip
  7. URL_MD5 9542d6de397d1fbd649ed468cb5850e6
  8. CMAKE_ARGS
  9. -DYAML_CPP_BUILD_TESTS=OFF
  10. -DYAML_CPP_BUILD_TOOLS=OFF
  11. -DYAML_CPP_INSTALL=OFF
  12. -DYAML_CPP_BUILD_CONTRIB=OFF
  13. -DMSVC_SHARED_RT=OFF
  14. -DBUILD_SHARED_LIBS=OFF
  15. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
  16. -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
  17. -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
  18. -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
  19. -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}/ext/yaml-cpp/lib
  20. -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}/ext/yaml-cpp/lib
  21. PREFIX "${CMAKE_BINARY_DIR}/ext/yaml-cpp"
  22. # Disable install step
  23. INSTALL_COMMAND ""
  24. LOG_DOWNLOAD ON
  25. LOG_BUILD 1
  26. )