geom_gate userland utility improvements
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.
 
 
 
 

110 lines
3.6 KiB

  1. # Copyright (c) 2014, 2015 Alexander Lamaison <alexander.lamaison@gmail.com>
  2. #
  3. # Redistribution and use in source and binary forms,
  4. # with or without modification, are permitted provided
  5. # that the following conditions are met:
  6. #
  7. # Redistributions of source code must retain the above
  8. # copyright notice, this list of conditions and the
  9. # following disclaimer.
  10. #
  11. # Redistributions in binary form must reproduce the above
  12. # copyright notice, this list of conditions and the following
  13. # disclaimer in the documentation and/or other materials
  14. # provided with the distribution.
  15. #
  16. # Neither the name of the copyright holder nor the names
  17. # of any other contributors may be used to endorse or
  18. # promote products derived from this software without
  19. # specific prior written permission.
  20. #
  21. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  22. # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  23. # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  24. # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  26. # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  27. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  28. # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  29. # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  30. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  31. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  32. # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
  33. # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  34. # OF SUCH DAMAGE.
  35. cmake_minimum_required(VERSION 2.8.11)
  36. set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
  37. project(libssh2 C)
  38. set(PROJECT_URL "https://www.libssh2.org/")
  39. set(PROJECT_DESCRIPTION "The SSH library")
  40. if (CMAKE_VERSION VERSION_LESS "3.1")
  41. if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
  42. set (CMAKE_C_FLAGS "--std=gnu90 ${CMAKE_C_FLAGS}")
  43. endif()
  44. else()
  45. set (CMAKE_C_STANDARD 90)
  46. endif()
  47. option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
  48. # Parse version
  49. file(READ ${CMAKE_CURRENT_SOURCE_DIR}/include/libssh2.h _HEADER_CONTENTS)
  50. string(
  51. REGEX REPLACE ".*#define LIBSSH2_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
  52. LIBSSH2_VERSION "${_HEADER_CONTENTS}")
  53. string(
  54. REGEX REPLACE ".*#define LIBSSH2_VERSION_MAJOR[ \t]+([0-9]+).*" "\\1"
  55. LIBSSH2_VERSION_MAJOR "${_HEADER_CONTENTS}")
  56. string(
  57. REGEX REPLACE ".*#define LIBSSH2_VERSION_MINOR[ \t]+([0-9]+).*" "\\1"
  58. LIBSSH2_VERSION_MINOR "${_HEADER_CONTENTS}")
  59. string(
  60. REGEX REPLACE ".*#define LIBSSH2_VERSION_PATCH[ \t]+([0-9]+).*" "\\1"
  61. LIBSSH2_VERSION_PATCH "${_HEADER_CONTENTS}")
  62. if(NOT LIBSSH2_VERSION OR
  63. NOT LIBSSH2_VERSION_MAJOR MATCHES "^[0-9]+$" OR
  64. NOT LIBSSH2_VERSION_MINOR MATCHES "^[0-9]+$" OR
  65. NOT LIBSSH2_VERSION_PATCH MATCHES "^[0-9]+$")
  66. message(
  67. FATAL_ERROR
  68. "Unable to parse version from"
  69. "${CMAKE_CURRENT_SOURCE_DIR}/include/libssh2.h")
  70. endif()
  71. include(GNUInstallDirs)
  72. install(
  73. FILES docs/AUTHORS COPYING docs/HACKING README RELEASE-NOTES NEWS
  74. DESTINATION ${CMAKE_INSTALL_DOCDIR})
  75. include(max_warnings)
  76. include(FeatureSummary)
  77. add_subdirectory(src)
  78. option(BUILD_EXAMPLES "Build libssh2 examples" ON)
  79. if(BUILD_EXAMPLES)
  80. add_subdirectory(example)
  81. endif()
  82. option(BUILD_TESTING "Build libssh2 test suite" ON)
  83. if(BUILD_TESTING)
  84. enable_testing()
  85. add_subdirectory(tests)
  86. endif()
  87. add_subdirectory(docs)
  88. feature_summary(WHAT ALL)
  89. set(CPACK_PACKAGE_VERSION_MAJOR ${LIBSSH2_VERSION_MAJOR})
  90. set(CPACK_PACKAGE_VERSION_MINOR ${LIBSSH2_VERSION_MINOR})
  91. set(CPACK_PACKAGE_VERSION_PATCH ${LIBSSH2_VERSION_PATCH})
  92. set(CPACK_PACKAGE_VERSION ${LIBSSH2_VERSION})
  93. include(CPack)