BuildUnibilium.cmake 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. if(WIN32)
  2. ExternalProject_Add(unibilium
  3. PREFIX ${DEPS_BUILD_DIR}
  4. URL ${UNIBILIUM_URL}
  5. DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/unibilium
  6. DOWNLOAD_COMMAND ${CMAKE_COMMAND}
  7. -DPREFIX=${DEPS_BUILD_DIR}
  8. -DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/unibilium
  9. -DURL=${UNIBILIUM_URL}
  10. -DEXPECTED_SHA256=${UNIBILIUM_SHA256}
  11. -DTARGET=unibilium
  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/UnibiliumCMakeLists.txt
  16. ${DEPS_BUILD_DIR}/src/unibilium/CMakeLists.txt
  17. COMMAND ${CMAKE_COMMAND} ${DEPS_BUILD_DIR}/src/unibilium
  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. ExternalProject_Add(unibilium
  27. PREFIX ${DEPS_BUILD_DIR}
  28. URL ${UNIBILIUM_URL}
  29. DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/unibilium
  30. DOWNLOAD_COMMAND ${CMAKE_COMMAND}
  31. -DPREFIX=${DEPS_BUILD_DIR}
  32. -DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/unibilium
  33. -DURL=${UNIBILIUM_URL}
  34. -DEXPECTED_SHA256=${UNIBILIUM_SHA256}
  35. -DTARGET=unibilium
  36. -DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR}
  37. -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake
  38. CONFIGURE_COMMAND ""
  39. BUILD_IN_SOURCE 1
  40. BUILD_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER}
  41. PREFIX=${DEPS_INSTALL_DIR}
  42. CFLAGS=-fPIC
  43. LDFLAGS+=-static
  44. INSTALL_COMMAND ${MAKE_PRG} PREFIX=${DEPS_INSTALL_DIR} install)
  45. endif()
  46. list(APPEND THIRD_PARTY_DEPS unibilium)