mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
Cordova: Renamed cmake Find module for bindings
Renamed find module from FindCordova to FindUpmCordovaGenerator to be more descriptive with the intent of the find module. Updated the find module to use find_package_handle_standard_args so a version can be specified and handle REQUIRED keyword. Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
parent
b09944f4b8
commit
757683b2ca
@ -178,7 +178,7 @@ if (BUILDCORDOVA)
|
|||||||
|
|
||||||
find_package (Node REQUIRED)
|
find_package (Node REQUIRED)
|
||||||
find_package (Npm REQUIRED)
|
find_package (Npm REQUIRED)
|
||||||
find_package (Cordova REQUIRED)
|
find_package (UpmCordovaGenerator 0.2.1 REQUIRED)
|
||||||
endif (BUILDCORDOVA)
|
endif (BUILDCORDOVA)
|
||||||
|
|
||||||
# Find swig if any wrapper is enabled
|
# Find swig if any wrapper is enabled
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
find_program(UPM_CORDOVA_BINDING NAMES upm-cordova-binding
|
|
||||||
)
|
|
||||||
|
|
||||||
if(UPM_CORDOVA_BINDING)
|
|
||||||
message(STATUS "The npm package to build cordova bindings found at ${UPM_CORDOVA_BINDING}")
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "Unable to find the npm package for building cordova bindings, please install by 'npm install -g upm-cordova-binding'")
|
|
||||||
endif()
|
|
20
cmake/modules/FindUpmCordovaGenerator.cmake
Normal file
20
cmake/modules/FindUpmCordovaGenerator.cmake
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
find_program (UPM_CORDOVA_BINDING NAMES upm-cordova-binding
|
||||||
|
DOC "UPM Cordova binding generator")
|
||||||
|
|
||||||
|
include (FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
# Get version
|
||||||
|
if (UPM_CORDOVA_BINDING)
|
||||||
|
execute_process(COMMAND ${NPM_EXECUTABLE} info upm-cordova-binding version
|
||||||
|
OUTPUT_VARIABLE UPM_CORDOVA_BINDING_VERSION
|
||||||
|
ERROR_VARIABLE UPM_CORDOVA_BINDING_VERSION
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
ERROR_STRIP_TRAILING_WHITESPACE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package_handle_standard_args(UpmCordovaGenerator
|
||||||
|
REQUIRED_VARS UPM_CORDOVA_BINDING
|
||||||
|
VERSION_VAR UPM_CORDOVA_BINDING_VERSION
|
||||||
|
FAIL_MESSAGE "Unable to find the npm package for generating UPM Cordova bindings. The generator can be installed via: 'npm install -g upm-cordova-binding'")
|
||||||
|
|
||||||
|
mark_as_advanced (UPM_CORDOVA_BINDING UPM_CORDOVA_BINDING_VERSION)
|
Loading…
x
Reference in New Issue
Block a user