You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.3 KiB

2 months ago
  1. if (TARGET GMP-EP)
  2. get_target_property(GMP_LIB GMP_STATIC IMPORTED_LOCATION)
  3. set(GMP_LIB_ARG "--with-libgmp=${GMP_LIB}")
  4. endif()
  5. ExternalProject_Add(
  6. CoCoALib-EP
  7. URL "http://cocoa.dima.unige.it/cocoalib/tgz/CoCoALib-${COCOA_VERSION}.tgz"
  8. URL_MD5 ${COCOA_TGZHASH}
  9. DOWNLOAD_NO_PROGRESS 1
  10. BUILD_IN_SOURCE YES
  11. CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR> --threadsafe-hack ${GMP_LIB_ARG} --with-cxxflags=-Wno-deprecated-declarations\ -fPIC
  12. BUILD_COMMAND make library doc
  13. INSTALL_COMMAND ${CMAKE_COMMAND} -E touch <SOURCE_DIR>/examples/index.html
  14. COMMAND ${CMAKE_COMMAND} -E make_directory <INSTALL_DIR>/include
  15. COMMAND ${CMAKE_COMMAND} -E make_directory <INSTALL_DIR>/lib
  16. COMMAND ${CMAKE_MAKE_PROGRAM} install
  17. BUILD_BYPRODUCTS ${CMAKE_BINARY_DIR}/resources/src/CoCoALib-EP/lib/libcocoa${STATIC_EXT}
  18. )
  19. ExternalProject_Get_Property(CoCoALib-EP INSTALL_DIR)
  20. add_imported_library(COCOA SHARED "${INSTALL_DIR}/lib/libcocoa${STATIC_EXT}" "${INSTALL_DIR}/include")
  21. add_imported_library(COCOA STATIC "${INSTALL_DIR}/lib/libcocoa${STATIC_EXT}" "${INSTALL_DIR}/include")
  22. add_dependencies(CoCoALib-EP GMP_STATIC)
  23. add_dependencies(COCOA_SHARED CoCoALib-EP GMPXX_SHARED)
  24. add_dependencies(COCOA_STATIC CoCoALib-EP GMP_STATIC)
  25. add_dependencies(resources COCOA_SHARED COCOA_STATIC)