Log4Qt.cmake 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #
  2. # Log4Qt
  3. #
  4. ctkMacroShouldAddExternalproject(Log4Qt_LIBRARIES add_project)
  5. if(${add_project})
  6. # Sanity checks
  7. if(DEFINED Log4Qt_DIR AND NOT EXISTS ${Log4Qt_DIR})
  8. message(FATAL_ERROR "Log4Qt_DIR variable is defined but corresponds to non-existing directory")
  9. endif()
  10. set(Log4Qt_enabling_variable Log4Qt_LIBRARIES)
  11. set(proj Log4Qt)
  12. set(proj_DEPENDENCIES)
  13. list(APPEND CTK_DEPENDENCIES ${proj})
  14. set(${Log4Qt_enabling_variable}_INCLUDE_DIRS Log4Qt_INCLUDE_DIRS)
  15. set(${Log4Qt_enabling_variable}_FIND_PACKAGE_CMD Log4Qt)
  16. if(CTK_SUPERBUILD)
  17. if(NOT DEFINED Log4Qt_DIR)
  18. set(revision_tag 8d3558b0f636cbf8ff83)
  19. if(${proj}_REVISION_TAG)
  20. set(revision_tag ${${proj}_REVISION_TAG})
  21. endif()
  22. set(location_args )
  23. if(${proj}_URL)
  24. set(location_args URL ${${proj}_URL})
  25. elseif(${proj}_GIT_REPOSITORY)
  26. set(location_args GIT_REPOSITORY ${${proj}_GIT_REPOSITORY}
  27. GIT_TAG ${revision_tag})
  28. else()
  29. set(location_args GIT_REPOSITORY "${git_protocol}://github.com/commontk/Log4Qt.git"
  30. GIT_TAG ${revision_tag})
  31. endif()
  32. # message(STATUS "Adding project:${proj}")
  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. CMAKE_CACHE_ARGS
  42. ${ep_common_cache_args}
  43. -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
  44. DEPENDS
  45. ${proj_DEPENDENCIES}
  46. )
  47. set(Log4Qt_DIR ${CMAKE_BINARY_DIR}/${proj}-build)
  48. # Since Log4Qt is statically build, there is not need to add its corresponding
  49. # library output directory to CTK_EXTERNAL_LIBRARY_DIRS
  50. else()
  51. ctkMacroEmptyExternalproject(${proj} "${proj_DEPENDENCIES}")
  52. endif()
  53. list(APPEND CTK_SUPERBUILD_EP_VARS Log4Qt_DIR:PATH)
  54. endif()
  55. endif()