KWStyle.cmake 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #
  2. # KWStyle
  3. #
  4. superbuild_include_once()
  5. set(proj KWStyle)
  6. set(${proj}_DEPENDENCIES "")
  7. superbuild_include_dependencies(PROJECT_VAR proj)
  8. if(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
  9. unset(KWSTYLE_EXECUTABLE CACHE)
  10. find_program(KWSTYLE_EXECUTABLE kwstyle)
  11. if(NOT KWSTYLE_EXECUTABLE)
  12. message(FATAL_ERROR "Couldn't find 'kwstyle' on the system !")
  13. endif()
  14. endif()
  15. # Sanity checks
  16. if(DEFINED KWSTYLE_EXECUTABLE AND NOT EXISTS ${KWSTYLE_EXECUTABLE})
  17. message(FATAL_ERROR "KWSTYLE_EXECUTABLE variable is defined but corresponds to non-existing executable")
  18. endif()
  19. if(NOT DEFINED KWSTYLE_EXECUTABLE)
  20. set(location_args )
  21. if(${proj}_URL)
  22. set(location_args URL ${${proj}_URL})
  23. else()
  24. set(location_args CVS_REPOSITORY ":pserver:anoncvs:@public.kitware.com:/cvsroot/KWStyle"
  25. CVS_MODULE "KWStyle")
  26. endif()
  27. ExternalProject_Add(${proj}
  28. ${${proj}_EXTERNAL_PROJECT_ARGS}
  29. SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
  30. BINARY_DIR ${proj}-build
  31. PREFIX ${proj}${ep_suffix}
  32. ${location_args}
  33. CMAKE_GENERATOR ${gen}
  34. LIST_SEPARATOR ${sep}
  35. CMAKE_CACHE_ARGS
  36. ${ep_common_cache_args}
  37. DEPENDS
  38. ${${proj}_DEPENDENCIES}
  39. )
  40. set(KWSTYLE_EXECUTABLE ${ep_install_dir}/bin/KWStyle)
  41. # Since KWStyle is an executable, there is not need to add its corresponding
  42. # library output directory to CTK_EXTERNAL_LIBRARY_DIRS
  43. else()
  44. superbuild_add_empty_external_project(${proj} "${${proj}_DEPENDENCIES}")
  45. endif()
  46. mark_as_superbuild(
  47. VARS KWSTYLE_EXECUTABLE:FILEPATH
  48. LABELS "FIND_PACKAGE"
  49. )