summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-10-11 18:16:43 (GMT)
committerStephen Kelly <steveire@gmail.com>2013-10-24 09:50:58 (GMT)
commit18fb7588df5b380340423eb36a90a7aefc1fa6ca (patch)
tree74aa97dc12bab52f5b1577b3ba9d227b95ce39c3 /Tests/CMakeLists.txt
parente485ba12193d36ffc4faee89bb80dbe611ad7e82 (diff)
downloadCMake-18fb7588df5b380340423eb36a90a7aefc1fa6ca.zip
CMake-18fb7588df5b380340423eb36a90a7aefc1fa6ca.tar.gz
CMake-18fb7588df5b380340423eb36a90a7aefc1fa6ca.tar.bz2
Run the main executable created in the autogen tests.
Don't try to show the windows, which would require a gui capable test machine, and that's not guaranteed. Automatically link to qtmain.a on Windows to avoid a policy warning. Set policy CMP0020 to NEW by increasing the required version. Don't attempt to run the test when using Windows.
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r--Tests/CMakeLists.txt13
1 files changed, 11 insertions, 2 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 38b2a0c..cf98a41 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1029,6 +1029,15 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt")
+ # On Windows there is no RPATH, so while Qt might be available for building,
+ # the required dlls may not be in the PATH, so we can't run the executables
+ # on that platform.
+ if(WIN32)
+ set(run_autogen_test ${CMAKE_CTEST_COMMAND} -V)
+ else()
+ set(run_autogen_test QtAutogen)
+ endif()
+
find_package(Qt5Widgets QUIET NO_MODULE)
if(Qt5Widgets_FOUND)
add_test(Qt5Autogen ${CMAKE_CTEST_COMMAND}
@@ -1040,7 +1049,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5Autogen"
--force-new-ctest-process
--build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=5
- --test-command ${CMAKE_CTEST_COMMAND} -V
+ --test-command ${run_autogen_test}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5Autogen")
endif()
@@ -1054,7 +1063,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Autogen"
--force-new-ctest-process
--build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=4
- --test-command ${CMAKE_CTEST_COMMAND} -V
+ --test-command ${run_autogen_test}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Autogen")