Fix in-source build of MaxCtrl

The npm install command must generate the version.js file in order for the
in-source builds to work.
This commit is contained in:
Markus Mäkelä
2018-07-17 13:05:52 +03:00
parent 25e2e1b7c6
commit 8d9ccce2dd
3 changed files with 5 additions and 2 deletions

View File

@ -4,7 +4,7 @@ if (BUILD_MAXCTRL)
if (NPM_FOUND AND NODEJS_FOUND AND NODEJS_VERSION VERSION_GREATER "6.0.0")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lib/version.js.in ${CMAKE_CURRENT_BINARY_DIR}/lib/version.js @ONLY)
include(configure_version.cmake)
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/maxctrl/maxctrl
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.sh ${CMAKE_SOURCE_DIR}

View File

@ -0,0 +1,2 @@
include(../VERSION22.cmake)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lib/version.js.in ${CMAKE_CURRENT_BINARY_DIR}/lib/version.js @ONLY)

View File

@ -5,7 +5,8 @@
"repository": "https://github.com/mariadb-corporation/MaxScale",
"main": "maxctrl.js",
"scripts": {
"test": "nyc mocha --timeout 15000 --slow 10000"
"test": "nyc mocha --timeout 15000 --slow 10000",
"preinstall": "cmake -P configure_version.cmake"
},
"keywords": [
"maxscale"