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.

36 lines
1.2 KiB

3 months ago
  1. find_program(AUTORECONF autoreconf)
  2. if(NOT AUTORECONF)
  3. message(SEND_ERROR "Can not build GiNaC, missing binary for autoreconf")
  4. endif()
  5. find_program(PYTHON2 python2)
  6. if(NOT PYTHON2)
  7. message(SEND_ERROR "Can not build GiNaC, missing binary for python2")
  8. endif()
  9. string(REPLACE "." "-" GINAC_TAG ${GINAC_VERSION})
  10. ExternalProject_Add(
  11. GiNaC-EP
  12. GIT_REPOSITORY "git://www.ginac.de/ginac.git"
  13. GIT_TAG "release_${GINAC_TAG}"
  14. DOWNLOAD_NO_PROGRESS 1
  15. UPDATE_COMMAND ""
  16. CONFIGURE_COMMAND ${AUTORECONF} -iv <SOURCE_DIR>
  17. COMMAND <SOURCE_DIR>/configure --quiet --prefix=<INSTALL_DIR> PYTHON=${PYTHON2} PKG_CONFIG_PATH=<INSTALL_DIR>/lib/pkgconfig/
  18. BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} -C ginac
  19. INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} -C ginac install
  20. LOG_INSTALL 1
  21. )
  22. ExternalProject_Get_Property(GiNaC-EP INSTALL_DIR)
  23. add_imported_library(GINAC SHARED "${INSTALL_DIR}/lib/libginac${DYNAMIC_EXT}" "${INSTALL_DIR}/include")
  24. add_imported_library(GINAC STATIC "${INSTALL_DIR}/lib/libginac${STATIC_EXT}" "${INSTALL_DIR}/include")
  25. add_dependencies(GiNaC-EP CLN_SHARED CLN_STATIC)
  26. add_dependencies(GINAC_SHARED GiNaC-EP)
  27. add_dependencies(GINAC_STATIC GiNaC-EP)
  28. add_dependencies(resources GINAC_SHARED GINAC_STATIC)
  29. mark_as_advanced(AUTORECONF)