CMakeLists.txt 939 B

12345678910111213141516171819202122232425262728293031
  1. # This file is part of Desktop App Toolkit,
  2. # a set of libraries for developing nice desktop applications.
  3. #
  4. # For license and copyright information please follow this link:
  5. # https://github.com/desktop-app/legal/blob/master/LEGAL
  6. add_library(external_gsl INTERFACE IMPORTED GLOBAL)
  7. add_library(desktop-app::external_gsl ALIAS external_gsl)
  8. if (DESKTOP_APP_USE_PACKAGED)
  9. if (DESKTOP_APP_USE_PACKAGED_LAZY)
  10. find_package(Microsoft.GSL 4.1.0 QUIET)
  11. else()
  12. find_package(Microsoft.GSL 4.1.0)
  13. endif()
  14. if (Microsoft.GSL_FOUND)
  15. target_link_libraries(external_gsl INTERFACE Microsoft.GSL::GSL)
  16. return()
  17. endif()
  18. endif()
  19. # https://gitlab.kitware.com/cmake/cmake/-/issues/25222
  20. if (NOT EXISTS ${third_party_loc}/GSL/include)
  21. message(FATAL_ERROR "Guidelines Support Library is not found")
  22. endif()
  23. target_include_directories(external_gsl SYSTEM
  24. INTERFACE
  25. ${third_party_loc}/GSL/include
  26. )