Log4Qt.cmake 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #
  2. # Log4Qt
  3. #
  4. SET(Log4Qt_DEPENDS)
  5. ctkMacroShouldAddExternalProject(Log4Qt_LIBRARIES add_project)
  6. IF(${add_project})
  7. # Sanity checks
  8. IF(DEFINED Log4Qt_DIR AND NOT EXISTS ${Log4Qt_DIR})
  9. MESSAGE(FATAL_ERROR "Log4Qt_DIR variable is defined but corresponds to non-existing directory")
  10. ENDIF()
  11. SET(Log4Qt_enabling_variable Log4Qt_LIBRARIES)
  12. SET(proj Log4Qt)
  13. SET(proj_DEPENDENCIES)
  14. SET(Log4Qt_DEPENDS ${proj})
  15. IF(NOT DEFINED Log4Qt_DIR)
  16. # MESSAGE(STATUS "Adding project:${proj}")
  17. ExternalProject_Add(${proj}
  18. GIT_REPOSITORY "${git_protocol}://github.com/commontk/Log4Qt.git"
  19. GIT_TAG "origin/patched"
  20. CMAKE_GENERATOR ${gen}
  21. BUILD_COMMAND ""
  22. CMAKE_ARGS
  23. ${ep_common_args}
  24. -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
  25. DEPENDS
  26. ${proj_DEPENDENCIES}
  27. )
  28. SET(Log4Qt_DIR ${ep_install_dir})
  29. # Since Log4Qt is statically build, there is not need to add its corresponding
  30. # library output directory to CTK_EXTERNAL_LIBRARY_DIRS
  31. ELSE()
  32. ctkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")
  33. ENDIF()
  34. LIST(APPEND CTK_SUPERBUILD_EP_ARGS -DLog4Qt_DIR:PATH=${Log4Qt_DIR})
  35. SET(${Log4Qt_enabling_variable}_INCLUDE_DIRS Log4Qt_INCLUDE_DIR)
  36. SET(${Log4Qt_enabling_variable}_FIND_PACKAGE_CMD Log4Qt)
  37. ENDIF()