🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. # Copyright (c) 2014 Jarryd Beck
  2. #
  3. # Permission is hereby granted, free of charge, to any person obtaining a copy
  4. # of this software and associated documentation files (the "Software"), to deal
  5. # in the Software without restriction, including without limitation the rights
  6. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. # copies of the Software, and to permit persons to whom the Software is
  8. # furnished to do so, subject to the following conditions:
  9. #
  10. # The above copyright notice and this permission notice shall be included in
  11. # all copies or substantial portions of the Software.
  12. #
  13. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. # THE SOFTWARE.
  20. cmake_minimum_required(VERSION 3.1...3.19)
  21. list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
  22. include(cxxopts)
  23. set("PROJECT_DESCRIPTION" "A header-only lightweight C++ command line option parser")
  24. set("PROJECT_HOMEPAGE_URL" "https://github.com/jarro2783/cxxopts")
  25. # Get the version of the library
  26. cxxopts_getversion(VERSION)
  27. project(cxxopts
  28. VERSION "${VERSION}"
  29. LANGUAGES CXX
  30. )
  31. # Must include after the project call due to GNUInstallDirs requiring a language be enabled (IE. CXX)
  32. include(GNUInstallDirs)
  33. # Determine whether this is a standalone project or included by other projects
  34. set(CXXOPTS_STANDALONE_PROJECT OFF)
  35. if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
  36. set(CXXOPTS_STANDALONE_PROJECT ON)
  37. endif()
  38. # Establish the project options
  39. option(CXXOPTS_BUILD_EXAMPLES "Set to ON to build examples" ${CXXOPTS_STANDALONE_PROJECT})
  40. option(CXXOPTS_BUILD_TESTS "Set to ON to build tests" ${CXXOPTS_STANDALONE_PROJECT})
  41. option(CXXOPTS_ENABLE_INSTALL "Generate the install target" ${CXXOPTS_STANDALONE_PROJECT})
  42. option(CXXOPTS_ENABLE_WARNINGS "Add warnings to CMAKE_CXX_FLAGS" ${CXXOPTS_STANDALONE_PROJECT})
  43. option(CXXOPTS_USE_UNICODE_HELP "Use ICU Unicode library" OFF)
  44. if (CXXOPTS_STANDALONE_PROJECT)
  45. cxxopts_set_cxx_standard()
  46. endif()
  47. if (CXXOPTS_ENABLE_WARNINGS)
  48. cxxopts_enable_warnings()
  49. endif()
  50. add_library(cxxopts INTERFACE)
  51. add_library(cxxopts::cxxopts ALIAS cxxopts)
  52. add_subdirectory(include)
  53. # Link against the ICU library when requested
  54. if(CXXOPTS_USE_UNICODE_HELP)
  55. cxxopts_use_unicode()
  56. endif()
  57. # Install cxxopts when requested by the user
  58. if (CXXOPTS_ENABLE_INSTALL)
  59. cxxopts_install_logic()
  60. endif()
  61. # Build examples when requested by the user
  62. if (CXXOPTS_BUILD_EXAMPLES)
  63. add_subdirectory(src)
  64. endif()
  65. # Enable testing when requested by the user
  66. if (CXXOPTS_BUILD_TESTS)
  67. enable_testing()
  68. add_subdirectory(test)
  69. endif()