Log4Qt.cmake 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. # message(STATUS "Adding project:${proj}")
  23. ExternalProject_Add(${proj}
  24. SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
  25. BINARY_DIR ${proj}-build
  26. PREFIX ${proj}${ep_suffix}
  27. GIT_REPOSITORY "${git_protocol}://github.com/commontk/Log4Qt.git"
  28. GIT_TAG ${revision_tag}
  29. CMAKE_GENERATOR ${gen}
  30. INSTALL_COMMAND ""
  31. UPDATE_COMMAND ""
  32. CMAKE_CACHE_ARGS
  33. ${ep_common_cache_args}
  34. -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
  35. DEPENDS
  36. ${proj_DEPENDENCIES}
  37. )
  38. set(Log4Qt_DIR ${CMAKE_BINARY_DIR}/${proj}-build)
  39. # Since Log4Qt is statically build, there is not need to add its corresponding
  40. # library output directory to CTK_EXTERNAL_LIBRARY_DIRS
  41. else()
  42. ctkMacroEmptyExternalproject(${proj} "${proj_DEPENDENCIES}")
  43. endif()
  44. list(APPEND CTK_SUPERBUILD_EP_VARS Log4Qt_DIR:PATH)
  45. endif()
  46. endif()