From f52f496138380a65790e25ef5c75a114fa4cfd79 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 Mar 2020 13:47:45 -0400 Subject: FindRuby: Provide Ruby_LIBRARIES result variable The `cmake-developer(7)` manual documents that a plural non-cached name should be used for results. --- Modules/FindRuby.cmake | 8 ++++++-- Tests/FindRuby/Test/CMakeLists.txt | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index 5df242b..acd67ba 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -21,8 +21,8 @@ the following variables: full path to the ruby binary ``Ruby_INCLUDE_DIRS`` include dirs to be used when using the ruby library -``Ruby_LIBRARY`` - full path to the ruby library +``Ruby_LIBRARIES`` + libraries needed to use ruby from C. ``Ruby_VERSION`` the version of ruby which was found, e.g. "1.8.7" ``Ruby_FOUND`` @@ -298,6 +298,10 @@ endif() FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby REQUIRED_VARS ${_Ruby_REQUIRED_VARS} VERSION_VAR Ruby_VERSION ) +if(Ruby_FOUND) + set(Ruby_LIBRARIES ${Ruby_LIBRARY}) +endif() + mark_as_advanced( Ruby_EXECUTABLE Ruby_LIBRARY diff --git a/Tests/FindRuby/Test/CMakeLists.txt b/Tests/FindRuby/Test/CMakeLists.txt index be8c67f..dcf3ec3 100644 --- a/Tests/FindRuby/Test/CMakeLists.txt +++ b/Tests/FindRuby/Test/CMakeLists.txt @@ -9,6 +9,6 @@ endif() add_executable(ruby_version ruby_version.c) target_include_directories(ruby_version PRIVATE ${Ruby_INCLUDE_DIRS}) -target_link_libraries(ruby_version PRIVATE ${Ruby_LIBRARY}) +target_link_libraries(ruby_version PRIVATE ${Ruby_LIBRARIES}) add_test(NAME ruby_version COMMAND ruby_version) -- cgit v0.12