2019-03-18 14:37:52 +00:00
|
|
|
#=============================================================================
|
2020-08-25 17:07:38 +00:00
|
|
|
# SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>
|
2019-03-18 14:37:52 +00:00
|
|
|
#
|
2020-08-25 17:07:38 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2019-03-18 14:37:52 +00:00
|
|
|
#=============================================================================
|
|
|
|
|
|
|
|
find_program(RUBY_EXE ruby)
|
|
|
|
if(NOT RUBY_EXE)
|
|
|
|
message(WARNING "Could not find ruby program")
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${RUBY_EXE} -e "require '@GEM_NAME@'"
|
|
|
|
ERROR_VARIABLE ERROR_VAR
|
|
|
|
RESULT_VARIABLE RESULT_VAR
|
|
|
|
)
|
|
|
|
|
|
|
|
if(RESULT_VAR EQUAL 0)
|
|
|
|
set(@GEM_PACKAGE@_FOUND TRUE)
|
|
|
|
else()
|
|
|
|
message(WARNING ${ERROR_VAR})
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(@GEM_PACKAGE@
|
|
|
|
FOUND_VAR
|
|
|
|
@GEM_PACKAGE@_FOUND
|
|
|
|
REQUIRED_VARS
|
|
|
|
@GEM_PACKAGE@_FOUND
|
|
|
|
)
|