aboutsummaryrefslogtreecommitdiff
path: root/libssh-config.cmake.in
diff options
context:
space:
mode:
authorChristophe Giboudeaux <christophe@krop.fr>2018-11-06 12:47:33 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-11-06 13:53:43 +0100
commitaa899f8ec06e21980403526fdb979071ecd9a65e (patch)
treed362d1793e148a7ba4018086a10ef0e9be3f1f78 /libssh-config.cmake.in
parentc88fb4c55b546eaa0063f651d470ed28daff0b2c (diff)
downloadlibssh-aa899f8ec06e21980403526fdb979071ecd9a65e.tar.gz
libssh-aa899f8ec06e21980403526fdb979071ecd9a65e.tar.xz
libssh-aa899f8ec06e21980403526fdb979071ecd9a65e.zip
cmake: Refresh the CMake Config files
This commit fixes a couple issues in the CMake configuration files and uses native features from CMake: * libssh-build-tree-settings.cmake is deleted. There was a typo that made this file unusable, anyway. * use the macros available in CMakePackageConfigHelpers.cmake to generate the version file and check that the files exist * Remove the LIBSSH_THREADS_LIBRARY variable, it used the non-existent LIBSSH_THREADS_LIBRARY_NAME variable. * Fix the in tree build. libssh can be used uninstalled again. Test plan: The values were tested after installing the new files and also without running 'make install'. Signed-off-by: Christophe Giboudeaux <christophe@krop.fr>
Diffstat (limited to 'libssh-config.cmake.in')
-rw-r--r--libssh-config.cmake.in20
1 files changed, 10 insertions, 10 deletions
diff --git a/libssh-config.cmake.in b/libssh-config.cmake.in
index b34cd4fa..11388f00 100644
--- a/libssh-config.cmake.in
+++ b/libssh-config.cmake.in
@@ -1,15 +1,15 @@
-get_filename_component(LIBSSH_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+@PACKAGE_INIT@
-if (EXISTS "${LIBSSH_CMAKE_DIR}/CMakeCache.txt")
- # In build tree
- include(${LIBSSH_CMAKE_DIR}/libssh-build-tree-settings.cmake)
+if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/CMakeCache.txt")
+ # In tree build
+ set_and_check(LIBSSH_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/include")
+ set_and_check(LIBSSH_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/lib/@LIBSSH_LIBRARY_NAME@")
else()
- set(LIBSSH_INCLUDE_DIR @INCLUDE_INSTALL_DIR@)
+ set_and_check(LIBSSH_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
+ set_and_check(LIBSSH_LIBRARIES "@PACKAGE_LIB_INSTALL_DIR@/@LIBSSH_LIBRARY_NAME@")
endif()
-set(LIBSSH_LIBRARY @LIB_INSTALL_DIR@/@LIBSSH_LIBRARY_NAME@)
-set(LIBSSH_LIBRARIES @LIB_INSTALL_DIR@/@LIBSSH_LIBRARY_NAME@)
+# For backward compatibility
+set(LIBSSH_LIBRARY ${LIBSSH_LIBRARIES})
-set(LIBSSH_THREADS_LIBRARY @LIB_INSTALL_DIR@/@LIBSSH_THREADS_LIBRARY_NAME@)
-
-mark_as_advanced(LIBSSH_LIBRARIES LIBSSH_INCLUDE_DIR)
+mark_as_advanced(LIBSSH_LIBRARIES LIBSSH_LIBRARY LIBSSH_INCLUDE_DIR)