Simplify MaxCtrl version extraction
Instead of using the correct version in in-source builds, a dummy file is copied in place. This removes the need to explicitly include the VERSION.cmake file.
This commit is contained in:
@ -4,7 +4,7 @@ if (BUILD_MAXCTRL)
|
|||||||
|
|
||||||
if (NPM_FOUND AND NODEJS_FOUND AND NODEJS_VERSION VERSION_GREATER "6.0.0")
|
if (NPM_FOUND AND NODEJS_FOUND AND NODEJS_VERSION VERSION_GREATER "6.0.0")
|
||||||
|
|
||||||
include(configure_version.cmake)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lib/version.js.in ${CMAKE_CURRENT_BINARY_DIR}/lib/version.js @ONLY)
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/maxctrl/maxctrl
|
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/maxctrl/maxctrl
|
||||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.sh ${CMAKE_SOURCE_DIR}
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.sh ${CMAKE_SOURCE_DIR}
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
include(../VERSION.cmake)
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lib/version.js.in ${CMAKE_CURRENT_BINARY_DIR}/lib/version.js @ONLY)
|
|
@ -6,7 +6,7 @@
|
|||||||
"main": "maxctrl.js",
|
"main": "maxctrl.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "nyc mocha --timeout 15000 --slow 10000",
|
"test": "nyc mocha --timeout 15000 --slow 10000",
|
||||||
"preinstall": "cmake -P configure_version.cmake"
|
"preinstall": "test -f lib/version.js || cp lib/version.js.in lib/version.js"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"maxscale"
|
"maxscale"
|
||||||
|
Reference in New Issue
Block a user