javaTargets.cmake.in 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. cmake_minimum_required(VERSION 2.8)
  2. cmake_policy(PUSH)
  3. cmake_policy(VERSION 2.8)
  4. #----------------------------------------------------------------
  5. # Generated CMake Java target import file.
  6. #----------------------------------------------------------------
  7. # Protect against multiple inclusion, which would fail when already imported targets are added once more.
  8. set(_targetsDefined)
  9. set(_targetsNotDefined)
  10. set(_expectedTargets)
  11. foreach(_expectedTarget @__targets__@)
  12. list(APPEND _expectedTargets ${_expectedTarget})
  13. if(TARGET ${_expectedTarget})
  14. list(APPEND _targetsDefined ${_expectedTarget})
  15. else()
  16. list(APPEND _targetsNotDefined ${_expectedTarget})
  17. endif()
  18. endforeach()
  19. if("%${_targetsDefined}" STREQUAL "%${_expectedTargets}")
  20. unset(_targetsDefined)
  21. unset(_targetsNotDefined)
  22. unset(_expectedTargets)
  23. cmake_policy(POP)
  24. return()
  25. endif()
  26. if(NOT "${_targetsDefined}" STREQUAL "")
  27. message(FATAL_ERROR
  28. "Some (but not all) targets in this export set were already defined.\n"
  29. "Targets Defined: ${_targetsDefined}\n"
  30. "Targets not yet defined: ${_targetsNotDefined}\n")
  31. endif()
  32. unset(_targetsDefined)
  33. unset(_targetsNotDefined)
  34. unset(_expectedTargets)
  35. @__targetdefs__@
  36. cmake_policy(POP)