summaryrefslogtreecommitdiffstats
path: root/coin/instructions/qmake_examples
diff options
context:
space:
mode:
Diffstat (limited to 'coin/instructions/qmake_examples')
-rw-r--r--coin/instructions/qmake_examples/build_qmake_examples_inner_instructions.yaml71
-rw-r--r--coin/instructions/qmake_examples/build_qmake_examples_instructions.yaml31
-rw-r--r--coin/instructions/qmake_examples/get_examples_source_location.yaml16
3 files changed, 118 insertions, 0 deletions
diff --git a/coin/instructions/qmake_examples/build_qmake_examples_inner_instructions.yaml b/coin/instructions/qmake_examples/build_qmake_examples_inner_instructions.yaml
new file mode 100644
index 0000000000..9bb765642d
--- /dev/null
+++ b/coin/instructions/qmake_examples/build_qmake_examples_inner_instructions.yaml
@@ -0,0 +1,71 @@
+type: Group
+instructions:
+ - type: Group
+ instructions:
+ # Prepare directories to build examples with qmake.
+ - type: ChangeDirectory
+ directory: "{{.SourceDir}}"
+ - type: MakeDirectory
+ directory: "{{.SourceDir}}_qmake/examples"
+ - type: SetBuildDirectory
+ directory: "{{.SourceDir}}_qmake/examples"
+ - type: ChangeDirectory
+ directory: "{{.BuildDir}}"
+ - !include "{{qt/qtbase}}/qmake_examples/get_examples_source_location.yaml"
+
+ # Setup qemu cross-compiled qmake to work.
+ - !include "{{qt/qtbase}}/coin_module_test_qemu_env_vars.yaml"
+
+ # Set either host or target env prefix for qmake and make depending on
+ # tested configuration.
+ - type: Group
+ instructions:
+ - type: EnvironmentVariable
+ variableName: CALL_MAKE_ENV_PREFIX
+ variableValue: "{{.Env.ENV_PREFIX}}"
+ enable_if:
+ condition: runtime
+ env_var: COIN_CONFIG_TYPE
+ equals_value: "Host"
+ - type: EnvironmentVariable
+ variableName: CALL_MAKE_ENV_PREFIX
+ variableValue: "{{.Env.TARGET_ENV_PREFIX}}"
+ enable_if:
+ condition: runtime
+ env_var: COIN_CONFIG_TYPE
+ equals_value: "Target"
+
+ # Ensure that we have an examples/examples.pro file.
+ # If it doesn't exist, write a dummy project file.
+ # The CMake that does this is installed to INSTALL_LIBEXEC, which defaults to "bin" on Windows.
+ - type: ExecuteCommand
+ enable_if:
+ condition: property
+ property: host.os
+ equals_value: Windows
+ command: "cmake --trace-expand -DPRO_FILE={{.SourceDir}}\\examples\\examples.pro -P {{.InstallDir}}\\bin\\ensure_pro_file.cmake"
+ maxTimeInSeconds: 20
+ maxTimeBetweenOutput: 20
+ userMessageOnFailure: >
+ Failed to run cmake -P ensure_pro_file.cmake
+ - type: ExecuteCommand
+ disable_if:
+ condition: property
+ property: host.os
+ equals_value: Windows
+ command: "cmake --trace-expand -DPRO_FILE={{.SourceDir}}/examples/examples.pro -P {{.InstallDir}}/libexec/ensure_pro_file.cmake"
+ maxTimeInSeconds: 20
+ maxTimeBetweenOutput: 20
+ userMessageOnFailure: >
+ Failed to run cmake -P ensure_pro_file.cmake
+
+ # Run qmake to configure the examples. The env prefix is important for qemu.
+ - type: ExecuteCommand
+ command: "{{.Env.CALL_MAKE_ENV_PREFIX}} {{.Env.COIN_QMAKE_LOCATION}} {{.Env.COIN_EXAMPLES_SOURCE_LOCATION}}"
+ maxTimeInSeconds: 6000
+ maxTimeBetweenOutput: 1200
+ userMessageOnFailure: >
+ Failed to run qmake to build examples.
+
+ # Run make to build the examples.
+ - !include "{{qt/qtbase}}/qmake/call_make.yaml"
diff --git a/coin/instructions/qmake_examples/build_qmake_examples_instructions.yaml b/coin/instructions/qmake_examples/build_qmake_examples_instructions.yaml
new file mode 100644
index 0000000000..bbc31f7676
--- /dev/null
+++ b/coin/instructions/qmake_examples/build_qmake_examples_instructions.yaml
@@ -0,0 +1,31 @@
+type: Group
+instructions:
+ # Only enable building examples if -DQT_BUILD_EXAMPLES=ON was passed to the CMake config in some
+ # form. The variable to check unfortunately depends on host vs target, and qtbase vs non-qtbase.
+ - type: Group
+ instructions:
+ - !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_inner_instructions.yaml"
+ enable_if:
+ condition: or
+ conditions:
+ # qtbase host case
+ - condition: runtime
+ env_var: CONFIGURE_ARGS
+ contains_value: "QT_BUILD_EXAMPLES=ON"
+ # qtbase target case
+ - condition: runtime
+ env_var: TARGET_CONFIGURE_ARGS
+ contains_value: "QT_BUILD_EXAMPLES=ON"
+ # non-qtbase host case
+ # non-qtbase target case
+ - condition: runtime
+ env_var: COIN_CMAKE_ARGS
+ contains_value: "QT_BUILD_EXAMPLES=ON"
+ # host case
+ - condition: runtime
+ env_var: CONFIGURE_ARGS
+ contains_value: "-make examples"
+ # target case
+ - condition: runtime
+ env_var: TARGET_CONFIGURE_ARGS
+ contains_value: "-make examples"
diff --git a/coin/instructions/qmake_examples/get_examples_source_location.yaml b/coin/instructions/qmake_examples/get_examples_source_location.yaml
new file mode 100644
index 0000000000..ca360e8727
--- /dev/null
+++ b/coin/instructions/qmake_examples/get_examples_source_location.yaml
@@ -0,0 +1,16 @@
+type: Group
+instructions:
+ - type: EnvironmentVariable
+ variableName: COIN_EXAMPLES_SOURCE_LOCATION
+ variableValue: "{{.SourceDir}}\\examples"
+ enable_if:
+ condition: property
+ property: host.os
+ equals_value: Windows
+ - type: EnvironmentVariable
+ variableName: COIN_EXAMPLES_SOURCE_LOCATION
+ variableValue: "{{.SourceDir}}/examples"
+ disable_if:
+ condition: property
+ property: host.os
+ equals_value: Windows