DCMTK.cmake 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #
  2. # DCMTK
  3. #
  4. SET(DCMTK_DEPENDS)
  5. ctkMacroShouldAddExternalProject(DCMTK_LIBRARIES add_project)
  6. IF(${add_project})
  7. # Sanity checks
  8. IF(DEFINED DCMTK_DIR AND NOT EXISTS ${DCMTK_DIR})
  9. MESSAGE(FATAL_ERROR "DCMTK_DIR variable is defined but corresponds to non-existing directory")
  10. ENDIF()
  11. SET(proj DCMTK)
  12. SET(proj_DEPENDENCIES)
  13. SET(DCMTK_DEPENDS ${proj})
  14. IF(NOT DEFINED DCMTK_DIR)
  15. # MESSAGE(STATUS "Adding project:${proj}")
  16. ExternalProject_Add(${proj}
  17. GIT_REPOSITORY "${git_protocol}://github.com/commontk/DCMTK.git"
  18. GIT_TAG "patched"
  19. CMAKE_GENERATOR ${gen}
  20. BUILD_COMMAND ""
  21. CMAKE_ARGS
  22. ${ep_common_args}
  23. -DDCMTK_BUILD_APPS:BOOL=ON # Build also dmctk tools (movescu, storescp, ...)
  24. )
  25. SET(DCMTK_DIR ${ep_install_dir})
  26. ExternalProject_Add_Step(${proj} force_rebuild
  27. COMMENT "Force ${proj} re-build"
  28. DEPENDERS build # Steps that depend on this step
  29. ALWAYS 1
  30. WORKING_DIRECTORY ${ep_build_dir}/${proj}
  31. DEPENDS
  32. ${proj_DEPENDENCIES}
  33. )
  34. # Since DCMTK is statically build, there is not need to add its corresponding
  35. # library output directory to CTK_EXTERNAL_LIBRARY_DIRS
  36. ELSE()
  37. ctkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")
  38. ENDIF()
  39. ENDIF()