Log4Qt.cmake 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #
  2. # Log4Qt
  3. #
  4. set(proj Log4Qt)
  5. set(${proj}_DEPENDENCIES "")
  6. ExternalProject_Include_Dependencies(${proj}
  7. PROJECT_VAR proj
  8. DEPENDS_VAR ${proj}_DEPENDENCIES
  9. EP_ARGS_VAR ${proj}_EXTERNAL_PROJECT_ARGS
  10. USE_SYSTEM_VAR ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj}
  11. )
  12. if(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
  13. message(FATAL_ERROR "Enabling ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj} is not supported !")
  14. endif()
  15. # Sanity checks
  16. if(DEFINED Log4Qt_DIR AND NOT EXISTS ${Log4Qt_DIR})
  17. message(FATAL_ERROR "Log4Qt_DIR variable is defined but corresponds to non-existing directory")
  18. endif()
  19. if(NOT DEFINED Log4Qt_DIR)
  20. set(revision_tag 8d3558b0f636cbf8ff83)
  21. if(${proj}_REVISION_TAG)
  22. set(revision_tag ${${proj}_REVISION_TAG})
  23. endif()
  24. set(location_args )
  25. if(${proj}_URL)
  26. set(location_args URL ${${proj}_URL})
  27. elseif(${proj}_GIT_REPOSITORY)
  28. set(location_args GIT_REPOSITORY ${${proj}_GIT_REPOSITORY}
  29. GIT_TAG ${revision_tag})
  30. else()
  31. set(location_args GIT_REPOSITORY "${git_protocol}://github.com/commontk/Log4Qt.git"
  32. GIT_TAG ${revision_tag})
  33. endif()
  34. ExternalProject_Add(${proj}
  35. ${${proj}_EXTERNAL_PROJECT_ARGS}
  36. SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
  37. BINARY_DIR ${proj}-build
  38. PREFIX ${proj}${ep_suffix}
  39. ${location_args}
  40. INSTALL_COMMAND ""
  41. UPDATE_COMMAND ""
  42. CMAKE_CACHE_ARGS
  43. ${ep_common_cache_args}
  44. -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
  45. DEPENDS
  46. ${${proj}_DEPENDENCIES}
  47. )
  48. set(Log4Qt_DIR ${CMAKE_BINARY_DIR}/${proj}-build)
  49. else()
  50. ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})
  51. endif()
  52. mark_as_superbuild(
  53. VARS Log4Qt_DIR:PATH
  54. LABELS "FIND_PACKAGE"
  55. )