CMakeLists.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #
  2. # Copyright 2009-2017 Alibaba Cloud All rights reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. if(CMAKE_HOST_WIN32)
  17. ExternalProject_Add(jsoncpp
  18. URL https://github.com/open-source-parsers/jsoncpp/archive/0.10.5.tar.gz
  19. CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
  20. -DJSONCPP_WITH_TESTS=OFF
  21. -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF
  22. -DJSONCPP_WITH_WARNING_AS_ERROR=OFF
  23. -DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF
  24. -DJSONCPP_WITH_CMAKE_PACKAGE=OFF
  25. -DBUILD_SHARED_LIBS=OFF
  26. -DBUILD_STATIC_LIBS=ON
  27. )
  28. ExternalProject_Add(curl
  29. URL https://github.com/curl/curl/releases/download/curl-7_55_1/curl-7.55.1.tar.gz
  30. CMAKE_ARGS -DBUILD_CURL_EXE=OFF
  31. -DBUILD_TESTING=OFF
  32. -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
  33. -DCMAKE_USE_WINSSL=ON
  34. -DCURL_STATICLIB=ON
  35. -DENABLE_MANUAL=OFF
  36. -DHTTP_ONLY=ON
  37. )
  38. endif()
  39. ExternalProject_Add(catch
  40. URL https://github.com/catchorg/Catch2/releases/download/v2.0.1/catch.hpp
  41. DOWNLOAD_NO_EXTRACT 1
  42. CONFIGURE_COMMAND ""
  43. BUILD_COMMAND ""
  44. INSTALL_COMMAND
  45. ${CMAKE_COMMAND} -E copy_if_different <DOWNLOADED_FILE> <INSTALL_DIR>
  46. )