summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuha Vuolle <juha.vuolle@insta.fi>2021-07-30 08:47:46 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-10 10:33:48 +0000
commit6a2ed39f250e94b4bdba0ee9131601b2efc16a0b (patch)
tree103a31432c1bd4fc63d154a2b6e2a711317d8f0e /src
parent2b67c147ebd3d2a3392bb5d3298c74dd137b2ee6 (diff)
Rename qscxmlc CMake options
Renaming as a result of CMake API review. The old option names are still supported but marked as deprecated. [ChangeLog] Rename QSCXMLC_ARGUMENTS and OUTPUT_DIR CMake variables to be better aligned with other CMake APIs (OPTIONS and OUTPUT_DIRECTORY respectively). Task-number: QTBUG-95178 Change-Id: I8500dd4e1d992ccba7378d37cda65d9760558dc5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 3baa625b2819fbf13dc6b512c377a1a5998ca7f9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/scxml/Qt6ScxmlMacros.cmake22
-rw-r--r--src/scxml/doc/qtscxml-instantiating-state-machines.qdoc8
2 files changed, 21 insertions, 9 deletions
diff --git a/src/scxml/Qt6ScxmlMacros.cmake b/src/scxml/Qt6ScxmlMacros.cmake
index a1559c5..f78155c 100644
--- a/src/scxml/Qt6ScxmlMacros.cmake
+++ b/src/scxml/Qt6ScxmlMacros.cmake
@@ -38,8 +38,8 @@
function(qt6_add_statecharts target_or_outfiles)
set(options)
- set(oneValueArgs OUTPUT_DIR NAMESPACE)
- set(multiValueArgs QSCXMLC_ARGUMENTS)
+ set(oneValueArgs OUTPUT_DIR OUTPUT_DIRECTORY NAMESPACE)
+ set(multiValueArgs QSCXMLC_ARGUMENTS OPTIONS)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
@@ -50,9 +50,21 @@ function(qt6_add_statecharts target_or_outfiles)
set(namespace "--namespace" ${ARGS_NAMESPACE})
endif()
- set(qscxmlcOutputDir ${CMAKE_CURRENT_BINARY_DIR})
if (ARGS_OUTPUT_DIR)
- set(qscxmlcOutputDir ${ARGS_OUTPUT_DIR})
+ message(AUTHOR_WARNING
+ "OUTPUT_DIR is deprecated. Please use OUTPUT_DIRECTORY instead.")
+ set(ARGS_OUTPUT_DIRECTORY ${ARGS_OUTPUT_DIR})
+ endif()
+
+ if (ARGS_QSCXMLC_ARGUMENTS)
+ message(AUTHOR_WARNING
+ "QSCXMLC_ARGUMENTS is deprecated. Please use OPTIONS instead.")
+ set(ARGS_OPTIONS ${ARGS_QSCXMLC_ARGUMENTS})
+ endif()
+
+ set(qscxmlcOutputDir ${CMAKE_CURRENT_BINARY_DIR})
+ if (ARGS_OUTPUT_DIRECTORY)
+ set(qscxmlcOutputDir ${ARGS_OUTPUT_DIRECTORY})
if (NOT EXISTS "${qscxmlcOutputDir}" OR NOT IS_DIRECTORY "${qscxmlcOutputDir}")
message(WARNING
"qt6_add_statecharts: output dir does not exist: \"" ${qscxmlcOutputDir} "\". "
@@ -70,7 +82,7 @@ function(qt6_add_statecharts target_or_outfiles)
add_custom_command(OUTPUT ${outfile_cpp} ${outfile_h}
${QT_TOOL_PATH_SETUP_COMMAND}
COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::qscxmlc
- ARGS ${namespace} ${ARGS_QSCXMLC_ARGUMENTS} --output ${outfile} ${infile}
+ ARGS ${namespace} ${ARGS_OPTIONS} --output ${outfile} ${infile}
MAIN_DEPENDENCY ${infile}
VERBATIM)
list(APPEND outfiles ${outfile_cpp})
diff --git a/src/scxml/doc/qtscxml-instantiating-state-machines.qdoc b/src/scxml/doc/qtscxml-instantiating-state-machines.qdoc
index 32710e7..0883e92 100644
--- a/src/scxml/doc/qtscxml-instantiating-state-machines.qdoc
+++ b/src/scxml/doc/qtscxml-instantiating-state-machines.qdoc
@@ -100,10 +100,10 @@
This will tell qmake to run \e qscxmlc which generates MyStatemachine.h
and MyStatemachine.cpp, and adds them to appropriately to the project
headers and sources. By default, the generated files are saved in
- the build directory. The qmake \e QSCXMLC_DIR or cmake \e OUTPUT_DIR variable
- can be set to specify another directory. The qmake \e QSCXMLC_NAMESPACE
- or cmake \e NAMESPACE variable can be set to put the state machine code into a
- C++ namespace.
+ the build directory. The qmake \e QSCXMLC_DIR or cmake \e OUTPUT_DIRECTORY
+ variable can be set to specify another directory. The qmake
+ \e QSCXMLC_NAMESPACE or cmake \e NAMESPACE variable can be set to put the
+ state machine code into a C++ namespace.
After instantiating a state machine, you can connect to any state's
active property as follows. For example, if the state machine for a