BuildLibiconv.cmake 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. if(MSVC)
  2. ExternalProject_Add(libiconv
  3. PREFIX ${DEPS_BUILD_DIR}
  4. URL ${LIBICONV_URL}
  5. DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libiconv
  6. DOWNLOAD_COMMAND ${CMAKE_COMMAND}
  7. -DPREFIX=${DEPS_BUILD_DIR}
  8. -DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/libiconv
  9. -DURL=${LIBICONV_URL}
  10. -DEXPECTED_SHA256=${LIBICONV_SHA256}
  11. -DTARGET=libiconv
  12. -DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
  13. -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
  14. CONFIGURE_COMMAND ${CMAKE_COMMAND} -E copy
  15. ${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibiconvCMakeLists.txt
  16. ${DEPS_BUILD_DIR}/src/libiconv/CMakeLists.txt
  17. COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/libiconv
  18. -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_DIR}
  19. # Pass toolchain
  20. -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN}
  21. -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
  22. -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
  23. BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE}
  24. INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${CMAKE_BUILD_TYPE})
  25. else()
  26. message(FATAL_ERROR "Trying to build libiconv in an unsupported system ${CMAKE_SYSTEM_NAME}/${CMAKE_C_COMPILER_ID}")
  27. endif()
  28. list(APPEND THIRD_PARTY_DEPS libiconv)