Log4Qt.cmake 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #
  2. # Log4Qt
  3. #
  4. superbuild_include_once()
  5. set(Log4Qt_enabling_variable Log4Qt_LIBRARIES)
  6. set(${Log4Qt_enabling_variable}_INCLUDE_DIRS Log4Qt_INCLUDE_DIRS)
  7. set(${Log4Qt_enabling_variable}_FIND_PACKAGE_CMD Log4Qt)
  8. set(Log4Qt_DEPENDENCIES "")
  9. ctkMacroCheckExternalProjectDependency(Log4Qt)
  10. set(proj Log4Qt)
  11. if(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
  12. message(FATAL_ERROR "Enabling ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj} is not supported !")
  13. endif()
  14. # Sanity checks
  15. if(DEFINED Log4Qt_DIR AND NOT EXISTS ${Log4Qt_DIR})
  16. message(FATAL_ERROR "Log4Qt_DIR variable is defined but corresponds to non-existing directory")
  17. endif()
  18. if(NOT DEFINED Log4Qt_DIR)
  19. set(revision_tag 8d3558b0f636cbf8ff83)
  20. if(${proj}_REVISION_TAG)
  21. set(revision_tag ${${proj}_REVISION_TAG})
  22. endif()
  23. set(location_args )
  24. if(${proj}_URL)
  25. set(location_args URL ${${proj}_URL})
  26. elseif(${proj}_GIT_REPOSITORY)
  27. set(location_args GIT_REPOSITORY ${${proj}_GIT_REPOSITORY}
  28. GIT_TAG ${revision_tag})
  29. else()
  30. set(location_args GIT_REPOSITORY "${git_protocol}://github.com/commontk/Log4Qt.git"
  31. GIT_TAG ${revision_tag})
  32. endif()
  33. ExternalProject_Add(${proj}
  34. SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
  35. BINARY_DIR ${proj}-build
  36. PREFIX ${proj}${ep_suffix}
  37. ${location_args}
  38. CMAKE_GENERATOR ${gen}
  39. INSTALL_COMMAND ""
  40. UPDATE_COMMAND ""
  41. LIST_SEPARATOR ${sep}
  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. # Since Log4Qt is statically build, there is not need to add its corresponding
  50. # library output directory to CTK_EXTERNAL_LIBRARY_DIRS
  51. else()
  52. ctkMacroEmptyExternalproject(${proj} "${${proj}_DEPENDENCIES}")
  53. endif()
  54. list(APPEND CTK_SUPERBUILD_EP_VARS Log4Qt_DIR:PATH)