aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2016-03-17 10:42:52 +0100
committerAndreas Schneider <asn@cryptomilk.org>2016-03-17 10:42:52 +0100
commit2384236849001fcbbe4b15df237cca0e512f61f7 (patch)
tree185f01970182c34e0abbd0b7a73107bc5021810a /cmake
parent252cd6eae92e19ac909a4354c42fca0f8c8b40a1 (diff)
downloadlibssh-2384236849001fcbbe4b15df237cca0e512f61f7.tar.gz
libssh-2384236849001fcbbe4b15df237cca0e512f61f7.tar.xz
libssh-2384236849001fcbbe4b15df237cca0e512f61f7.zip
cmake: Try to fix FindArgp module
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindArgp.cmake92
1 files changed, 49 insertions, 43 deletions
diff --git a/cmake/Modules/FindArgp.cmake b/cmake/Modules/FindArgp.cmake
index 8dedc855..454965ac 100644
--- a/cmake/Modules/FindArgp.cmake
+++ b/cmake/Modules/FindArgp.cmake
@@ -1,60 +1,66 @@
-# - Try to find Argp
+# - Try to find ARGP
# Once done this will define
#
-# ARGP_FOUND - system has Argp
-# ARGP_INCLUDE_DIRS - the Argp include directory
-# ARGP_LIBRARIES - Link these to use Argp
-# ARGP_DEFINITIONS - Compiler switches required for using Argp
+# ARGP_ROOT_DIR - Set this variable to the root installation of ARGP
#
-# Copyright (c) 2010 Andreas Schneider <asn@cryptomilk.org>
+# Read-Only variables:
+# ARGP_FOUND - system has ARGP
+# ARGP_INCLUDE_DIR - the ARGP include directory
+# ARGP_LIBRARIES - Link these to use ARGP
+# ARGP_DEFINITIONS - Compiler switches required for using ARGP
#
-# Redistribution and use is allowed according to the terms of the New
-# BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#=============================================================================
+# Copyright (c) 2011-2016 Andreas Schneider <asn@cryptomilk.org>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
#
+set(_ARGP_ROOT_HINTS
+)
-if (ARGP_LIBRARIES AND ARGP_INCLUDE_DIRS)
- # in cache already
- set(ARGP_FOUND TRUE)
-else (ARGP_LIBRARIES AND ARGP_INCLUDE_DIRS)
+set(_ARGP_ROOT_PATHS
+ "$ENV{PROGRAMFILES}/argp"
+)
- find_path(ARGP_INCLUDE_DIR
+find_path(ARGP_ROOT_DIR
NAMES
- argp.h
+ include/argp.h
+ HINTS
+ ${_ARGP_ROOT_HINTS}
PATHS
- /usr/include
- /usr/local/include
- /opt/local/include
- /sw/include
- )
+ ${_ARGP_ROOT_PATHS}
+)
+mark_as_advanced(ARGP_ROOT_DIR)
- find_library(ARGP_LIBRARY
+find_path(ARGP_INCLUDE_DIR
NAMES
- argp
+ argp.h
PATHS
- /usr/lib
- /usr/local/lib
- /opt/local/lib
- /sw/lib
- )
-
- set(ARGP_INCLUDE_DIRS
- ${ARGP_INCLUDE_DIR}
- )
-
- if (ARGP_LIBRARY)
- set(ARGP_LIBRARIES
- ${ARGP_LIBRARIES}
- ${ARGP_LIBRARY}
- )
- endif (ARGP_LIBRARY)
+ ${ARGP_ROOT_DIR}/include
+)
- include(FindPackageHandleStandardArgs)
- find_package_handle_standard_args(Argp DEFAULT_MSG ARGP_LIBRARIES ARGP_INCLUDE_DIRS)
+find_library(ARGP_LIBRARY
+ NAMES
+ argp
+ PATHS
+ ${ARGP_ROOT_DIR}/lib
+)
- # show the ARGP_INCLUDE_DIRS and ARGP_LIBRARIES variables only in the advanced view
- mark_as_advanced(ARGP_INCLUDE_DIRS ARGP_LIBRARIES)
+if (ARGP_LIBRARY)
+ set(ARGP_LIBRARIES
+ ${ARGP_LIBRARIES}
+ ${ARGP_LIBRARY}
+ )
+endif (ARGP_LIBRARY)
-endif (ARGP_LIBRARIES AND ARGP_INCLUDE_DIRS)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(ARGP DEFAULT_MSG ARGP_LIBRARIES ARGP_INCLUDE_DIR)
+# show the ARGP_INCLUDE_DIR and ARGP_LIBRARIES variables only in the advanced view
+mark_as_advanced(ARGP_INCLUDE_DIR ARGP_LIBRARIES)