[Cmake-commits] CMake branch, next, updated. v2.8.10-761-g8316b91
Alexander Neundorf
neundorf at kde.org
Mon Nov 5 14:28:30 EST 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 8316b91b9740f79d9a4250534d6fce5adbd73b34 (commit)
via 3a0ffa6225ec4b6f95dc691a91dec7f7e04cb7ec (commit)
via 2ae9d03fa64b49d708e489db0275f6893dfc05b4 (commit)
via 53c42cb4eab9f1e975b287e5b6784fb83f48be1f (commit)
via daf1c4d5a7edbf046a4a3d324f2ca01fb1d1a856 (commit)
via b878cd6fb4fee4c32bc97a7e63b8d25d2eab30cf (commit)
via 3fe2bc622e75c052e75c351621a8c876070481a3 (commit)
via 314e7fb6e9a8fe48531c8c04de6eadd9333360ee (commit)
from 4bb7d79e6967a30e5aa9c65e77fb3a7b49d6c249 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8316b91b9740f79d9a4250534d6fce5adbd73b34
commit 8316b91b9740f79d9a4250534d6fce5adbd73b34
Merge: 4bb7d79 3a0ffa6
Author: Alexander Neundorf <neundorf at kde.org>
AuthorDate: Mon Nov 5 14:28:29 2012 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Nov 5 14:28:29 2012 -0500
Merge topic 'MakeSquish4Work' into next
3a0ffa6 Squish: add support for squish 4 (#9734)
2ae9d03 Squish: use ${CMAKE_CURRENT_LIST_DIR}
53c42cb Squish: rename squish_add_test() to squish_v3_add_test() and fix docs a bit
daf1c4d Squish: find executables also under Windows
b878cd6 Squish: use FPHSA
3fe2bc6 Squish: detect version
314e7fb CMake Nightly Date Stamp
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a0ffa6225ec4b6f95dc691a91dec7f7e04cb7ec
commit 3a0ffa6225ec4b6f95dc691a91dec7f7e04cb7ec
Author: Alex Neundorf <neundorf at kde.org>
AuthorDate: Sun Nov 4 21:06:20 2012 +0100
Commit: Alex Neundorf <neundorf at kde.org>
CommitDate: Mon Nov 5 19:20:13 2012 +0100
Squish: add support for squish 4 (#9734)
This patch adds support for Squish 4.x.
The changes are basically what is attached to
http://public.kitware.com/Bug/view.php?id=9734.
When adding a test for squish 4.x, use squish_v4_add_test().
Alex
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index 10d287b..ad72958 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -1,6 +1,6 @@
#
# ---- Find Squish
-# This module can be used to find Squish. Currently Squish version 3 is supported.
+# This module can be used to find Squish. Currently Squish versions 3 and 4 are supported.
#
# ---- Variables and Macros
# SQUISH_FOUND If false, don't try to use Squish
@@ -17,14 +17,43 @@
# SQUISH_SERVER_EXECUTABLE_FOUND Was the server executable found?
# SQUISH_CLIENT_EXECUTABLE_FOUND Was the client executable found?
#
-# macro SQUISH_V3_ADD_TEST(testName applicationUnderTest testCase envVars testWrapper)
+# It provides the function squish_v4_add_test() for adding a squish test to cmake using Squish 4.x:
+#
+# squish_v4_add_test(cmakeTestName AUT targetName SUITE suiteName TEST squishTestName
+# [SETTINGSGROUP group] [PRE_COMMAND command] [POST_COMMAND command] )
+#
+# The arguments have the following meaning:
+# cmakeTestName: this will be used as the first argument for add_test()
+# AUT targetName: the name of the cmake target which will be used as AUT, i.e. the
+# executable which will be tested.
+# SUITE suiteName: this is either the full path to the squish suite, or just the
+# last directory of the suite, i.e. the suite name. In this case
+# the CMakeLists.txt which calls squish_add_test() must be located
+# in the parent directory of the suite directory.
+# TEST squishTestName: the name of the squish test, i.e. the name of the subdirectory
+# of the test inside the suite directory.
+# SETTINGSGROUP group: if specified, the given settings group will be used for executing the test.
+# If not specified, the groupname will be "CTest_<username>"
+# PRE_COMMAND command: if specified, the given command will be executed before starting the squish test.
+# POST_COMMAND command: same as PRE_COMMAND, but after the squish test has been executed.
+#
+# ---- Typical Use
+# enable_testing()
+# find_package(Squish 4.0)
+# if (SQUISH_FOUND)
+# squish_v4_add_test(myTestName AUT myApp SUITE ${CMAKE_SOURCE_DIR}/tests/mySuite TEST someSquishTest SETTINGSGROUP myGroup )
+# endif ()
+#
+#
+# For users of Squish version 3.x the macro squish_v3_add_test() is provided:
+# squish_v3_add_test(testName applicationUnderTest testCase envVars testWrapper)
# Use this macro to add a test using Squish 3.x.
#
# ---- Typical Use
# enable_testing()
# find_package(Squish)
# if (SQUISH_FOUND)
-# SQUISH_ADD_TEST(myTestName myApplication testCase envVars testWrapper)
+# squish_v3_add_test(myTestName myApplication testCase envVars testWrapper)
# endif ()
#
# macro SQUISH_ADD_TEST(testName applicationUnderTest testCase envVars testWrapper)
@@ -33,6 +62,7 @@
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
+# Copyright 2012 Alexander Neundorf
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -44,6 +74,9 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+
+include(CMakeParseArguments)
+
set(SQUISH_INSTALL_DIR_STRING "Directory containing the bin, doc, and lib directories for Squish; this should be the root of the installation directory.")
set(SQUISH_SERVER_EXECUTABLE_STRING "The squishserver executable program.")
set(SQUISH_CLIENT_EXECUTABLE_STRING "The squishclient executable program.")
@@ -131,8 +164,13 @@ find_package_handle_standard_args(Squish REQUIRED_VARS SQUISH_INSTALL_DIR SQUI
set(_SQUISH_MODULE_DIR "${CMAKE_CURRENT_LIST_DIR}")
macro(SQUISH_V3_ADD_TEST testName testAUT testCase envVars testWraper)
+ if("${SQUISH_VERSION_MAJOR}" STREQUAL "4")
+ message(STATUS "Using squish_v3_add_test(), but SQUISH_VERSION_MAJOR is ${SQUISH_VERSION_MAJOR}.\nThis may not work.")
+ endif()
+
add_test(${testName}
${CMAKE_COMMAND} -V -VV
+ "-Dsquish_version:STRING=3"
"-Dsquish_aut:STRING=${testAUT}"
"-Dsquish_server_executable:STRING=${SQUISH_SERVER_EXECUTABLE}"
"-Dsquish_client_executable:STRING=${SQUISH_CLIENT_EXECUTABLE}"
@@ -140,6 +178,7 @@ macro(SQUISH_V3_ADD_TEST testName testAUT testCase envVars testWraper)
"-Dsquish_test_case:STRING=${testCase}"
"-Dsquish_env_vars:STRING=${envVars}"
"-Dsquish_wrapper:STRING=${testWraper}"
+ "-Dsquish_module_dir:STRING=${_SQUISH_MODULE_DIR}"
-P "${_SQUISH_MODULE_DIR}/SquishTestScript.cmake"
)
set_tests_properties(${testName}
@@ -152,3 +191,71 @@ macro(SQUISH_ADD_TEST)
message(STATUS "Using squish_add_test() is deprecated, use squish_v3_add_test() instead.")
squish_v3_add_test(${ARGV})
endmacro()
+
+
+function(SQUISH_V4_ADD_TEST testName)
+
+ if(NOT "${SQUISH_VERSION_MAJOR}" STREQUAL "4")
+ message(STATUS "Using squish_v4_add_test(), but SQUISH_VERSION_MAJOR is ${SQUISH_VERSION_MAJOR}.\nThis may not work.")
+ endif()
+
+ set(oneValueArgs AUT SUITE TEST SETTINGSGROUP PRE_COMMAND POST_COMMAND)
+
+ cmake_parse_arguments(_SQUISH "" "${oneValueArgs}" "" ${ARGN} )
+
+ if(_SQUISH_UNPARSED_ARGUMENTS)
+ message(FATAL_ERROR "Unknown keywords given to SQUISH_ADD_TEST(): \"${_SQUISH_UNPARSED_ARGUMENTS}\"")
+ endif()
+
+ if(NOT _SQUISH_AUT)
+ message(FATAL_ERROR "Required argument AUT not given for SQUISH_ADD_TEST()")
+ endif()
+
+ if(NOT _SQUISH_SUITE)
+ message(FATAL_ERROR "Required argument SUITE not given for SQUISH_ADD_TEST()")
+ endif()
+
+ if(NOT _SQUISH_TEST)
+ message(FATAL_ERROR "Required argument TEST not given for SQUISH_ADD_TEST()")
+ endif()
+
+ get_target_property(testAUTLocation ${_SQUISH_AUT} LOCATION)
+ get_filename_component(testAUTDir ${testAUTLocation} PATH)
+ get_target_property(testAUTName ${_SQUISH_AUT} OUTPUT_NAME)
+
+ get_filename_component(absTestSuite "${_SQUISH_SUITE}" ABSOLUTE)
+ if(NOT EXISTS "${absTestSuite}")
+ message(FATAL_ERROR "Could not find squish test suite ${_SQUISH_SUITE} (checked ${absTestSuite})")
+ endif()
+
+ set(absTestCase "${absTestSuite}/${_SQUISH_TEST}")
+ if(NOT EXISTS "${absTestCase}")
+ message(FATAL_ERROR "Could not find squish testcase ${_SQUISH_TEST} (checked ${absTestCase})")
+ endif()
+
+ if(NOT _SQUISH_SETTINGSGROUP)
+ set(_SQUISH_SETTINGSGROUP "CTest_$ENV{LOGNAME}")
+ endif()
+
+ add_test(${testName}
+ ${CMAKE_COMMAND} -V -VV
+ "-Dsquish_version:STRING=4"
+ "-Dsquish_aut:STRING=${testAUTName}"
+ "-Dsquish_aut_dir:STRING=${testAUTDir}"
+ "-Dsquish_server_executable:STRING=${SQUISH_SERVER_EXECUTABLE}"
+ "-Dsquish_client_executable:STRING=${SQUISH_CLIENT_EXECUTABLE}"
+ "-Dsquish_libqtdir:STRING=${QT_LIBRARY_DIR}"
+ "-Dsquish_test_suite:STRING=${absTestSuite}"
+ "-Dsquish_test_case:STRING=${_SQUISH_TEST}"
+ "-Dsquish_env_vars:STRING=${envVars}"
+ "-Dsquish_wrapper:STRING=${testWraper}"
+ "-Dsquish_module_dir:STRING=${_SQUISH_MODULE_DIR}"
+ "-Dsquish_settingsgroup:STRING=${_SQUISH_SETTINGSGROUP}"
+ "-Dsquish_pre_command:STRING=${_SQUISH_PRE_COMMAND}"
+ "-Dsquish_post_command:STRING=${_SQUISH_POST_COMMAND}"
+ -P "${_SQUISH_MODULE_DIR}/SquishTestScript.cmake"
+ )
+ set_tests_properties(${testName}
+ PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL;FAILED;ERROR;FATAL"
+ )
+endfunction()
diff --git a/Modules/Squish4RunTestCase.bat b/Modules/Squish4RunTestCase.bat
new file mode 100755
index 0000000..ad1cc8c
--- /dev/null
+++ b/Modules/Squish4RunTestCase.bat
@@ -0,0 +1,24 @@
+set SQUISHSERVER=%1
+set SQUISHRUNNER=%2
+set TESTSUITE=%3
+set TESTCASE=%4
+set AUT=%5
+set AUTDIR=%6
+set SETTINGSGROUP=%7
+
+%SQUISHSERVER% --stop
+
+echo "Adding AUT... %SQUISHSERVER% --config addAUT %AUT% %AUTDIR%"
+%SQUISHSERVER% --config addAUT "%AUT%" "%AUTDIR%"
+
+echo "Starting the squish server... %SQUISHSERVER%"
+start /B %SQUISHSERVER%
+
+echo "Running the test case...%SQUISHRUNNER% --testsuite %TESTSUITE% --testcase %TESTCASE%"
+%SQUISHRUNNER% --testsuite "%TESTSUITE%" --testcase "%TESTCASE%"
+set returnValue=%ERRORLEVEL%
+
+echo "Stopping the squish server... %SQUISHSERVER% --stop"
+%SQUISHSERVER% --stop
+
+exit /B %returnValue%
diff --git a/Modules/Squish4RunTestCase.sh b/Modules/Squish4RunTestCase.sh
new file mode 100755
index 0000000..abd5deb
--- /dev/null
+++ b/Modules/Squish4RunTestCase.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+SQUISHSERVER=$1
+SQUISHRUNNER=$2
+TESTSUITE=$3
+TESTCASE=$4
+AUT=$5
+AUTDIR=$6
+SETTINGSGROUP=$7
+
+$SQUISHSERVER --stop > /dev/null 2>&1
+
+echo "Adding AUT... $SQUISHSERVER --settingsGroup $SETTINGSGROUP --config addAUT $AUT $AUTDIR"
+$SQUISHSERVER --settingsGroup "$SETTINGSGROUP" --config addAUT "$AUT" "$AUTDIR" || exit -1
+# sleep 1
+
+echo "Starting the squish server... $SQUISHSERVER --daemon"
+$SQUISHSERVER --daemon || exit -1
+# sleep 2
+
+echo "Running the test case...$SQUISHRUNNER --settingsGroup $SETTINGSGROUP --testsuite $TESTSUITE --testcase $TESTCASE"
+$SQUISHRUNNER --settingsGroup "$SETTINGSGROUP" --testsuite "$TESTSUITE" --testcase "$TESTCASE"
+returnValue=$?
+
+echo "Stopping the squish server... $SQUISHSERVER --stop"
+$SQUISHSERVER --stop
+
+exit $returnValue
diff --git a/Modules/SquishTestScript.cmake b/Modules/SquishTestScript.cmake
index d565305..f794b3e 100644
--- a/Modules/SquishTestScript.cmake
+++ b/Modules/SquishTestScript.cmake
@@ -22,17 +22,22 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
-
# print out the variable that we are using
message(STATUS "squish_aut='${squish_aut}'")
+message(STATUS "squish_aut_dir='${squish_aut_dir}'")
+message(STATUS "squish_version='${squish_version}'")
message(STATUS "squish_server_executable='${squish_server_executable}'")
message(STATUS "squish_client_executable='${squish_client_executable}'")
message(STATUS "squish_libqtdir ='${squish_libqtdir}'")
+message(STATUS "squish_test_suite='${squish_test_suite}'")
message(STATUS "squish_test_case='${squish_test_case}'")
message(STATUS "squish_wrapper='${squish_wrapper}'")
message(STATUS "squish_env_vars='${squish_env_vars}'")
+message(STATUS "squish_module_dir='${squish_module_dir}'")
+message(STATUS "squish_settingsgroup='${squish_settingsgroup}'")
+message(STATUS "squish_pre_command='${squish_pre_command}'")
+message(STATUS "squish_post_command='${squish_post_command}'")
# parse enviornment variables
foreach(i ${squish_env_vars})
@@ -48,25 +53,38 @@ if (QT4_INSTALLED)
set ( ENV{${SQUISH_LIBQTDIR}} ${squish_libqtdir} )
endif ()
+if(squish_pre_command)
+ message(STATUS "Executing pre command: ${squish_pre_command}")
+ execute_process(COMMAND "${squish_pre_command}")
+endif()
+
# run the test
-if (WIN32)
- execute_process(
- COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.bat ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
- RESULT_VARIABLE test_rv
- )
-endif ()
+if("${squish_version}" STREQUAL "4")
+ if (WIN32)
+ execute_process(COMMAND ${squish_module_dir}/Squish4RunTestCase.bat ${squish_server_executable} ${squish_client_executable} ${squish_test_suite} ${squish_test_case} ${squish_aut} ${squish_aut_dir} ${squish_settingsgroup}
+ RESULT_VARIABLE test_rv )
+ elseif(UNIX)
+ execute_process(COMMAND ${squish_module_dir}/Squish4RunTestCase.sh ${squish_server_executable} ${squish_client_executable} ${squish_test_suite} ${squish_test_case} ${squish_aut} ${squish_aut_dir} ${squish_settingsgroup}
+ RESULT_VARIABLE test_rv )
+ endif ()
-if (UNIX)
- execute_process(
- COMMAND ${CMAKE_ROOT}/Modules/SquishRunTestCase.sh ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
- RESULT_VARIABLE test_rv
- )
-endif ()
+else()
+
+ if (WIN32)
+ execute_process(COMMAND ${squish_module_dir}/SquishRunTestCase.bat ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
+ RESULT_VARIABLE test_rv )
+ elseif(UNIX)
+ execute_process(COMMAND ${squish_module_dir}/SquishRunTestCase.sh ${squish_server_executable} ${squish_client_executable} ${squish_test_case} ${squish_wrapper} ${squish_aut}
+ RESULT_VARIABLE test_rv )
+ endif ()
+endif()
+
+if(squish_post_command)
+ message(STATUS "Executing post command: ${squish_post_command}")
+ execute_process(COMMAND "${squish_post_command}")
+endif()
# check for an error with running the test
if(NOT "${test_rv}" STREQUAL "0")
message(FATAL_ERROR "Error running Squish test")
endif()
-
-
-
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2ae9d03fa64b49d708e489db0275f6893dfc05b4
commit 2ae9d03fa64b49d708e489db0275f6893dfc05b4
Author: Alex Neundorf <neundorf at kde.org>
AuthorDate: Sun Nov 4 19:45:25 2012 +0100
Commit: Alex Neundorf <neundorf at kde.org>
CommitDate: Mon Nov 5 19:17:24 2012 +0100
Squish: use ${CMAKE_CURRENT_LIST_DIR}
Use ${CMAKE_CURRENT_LIST_DIR} instead of constructing the dir from pieces.
Alex
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index 8fb8c37..10d287b 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -128,6 +128,7 @@ find_package_handle_standard_args(Squish REQUIRED_VARS SQUISH_INSTALL_DIR SQUI
VERSION_VAR SQUISH_VERSION )
+set(_SQUISH_MODULE_DIR "${CMAKE_CURRENT_LIST_DIR}")
macro(SQUISH_V3_ADD_TEST testName testAUT testCase envVars testWraper)
add_test(${testName}
@@ -139,7 +140,7 @@ macro(SQUISH_V3_ADD_TEST testName testAUT testCase envVars testWraper)
"-Dsquish_test_case:STRING=${testCase}"
"-Dsquish_env_vars:STRING=${envVars}"
"-Dsquish_wrapper:STRING=${testWraper}"
- -P "${CMAKE_ROOT}/Modules/SquishTestScript.cmake"
+ -P "${_SQUISH_MODULE_DIR}/SquishTestScript.cmake"
)
set_tests_properties(${testName}
PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED;ERROR;FATAL"
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=53c42cb4eab9f1e975b287e5b6784fb83f48be1f
commit 53c42cb4eab9f1e975b287e5b6784fb83f48be1f
Author: Alex Neundorf <neundorf at kde.org>
AuthorDate: Sun Nov 4 19:41:34 2012 +0100
Commit: Alex Neundorf <neundorf at kde.org>
CommitDate: Mon Nov 5 19:17:20 2012 +0100
Squish: rename squish_add_test() to squish_v3_add_test() and fix docs a bit
There is still a wrapper macro squish_add_test(), but this now
mentions that you should use squish_v3_add_test() instead.
Also, the docs for the macro were just wrong. They are at least
correct now, but still hard to understand (I don't have squish 3 around,
so I can't improve them).
Alex
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index 667060c..8fb8c37 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -1,6 +1,6 @@
#
# ---- Find Squish
-# This module can be used to find Squish (currently support is aimed at version 3).
+# This module can be used to find Squish. Currently Squish version 3 is supported.
#
# ---- Variables and Macros
# SQUISH_FOUND If false, don't try to use Squish
@@ -17,15 +17,19 @@
# SQUISH_SERVER_EXECUTABLE_FOUND Was the server executable found?
# SQUISH_CLIENT_EXECUTABLE_FOUND Was the client executable found?
#
-# macro SQUISH_ADD_TEST(testName applicationUnderTest testSuite testCase)
+# macro SQUISH_V3_ADD_TEST(testName applicationUnderTest testCase envVars testWrapper)
+# Use this macro to add a test using Squish 3.x.
#
# ---- Typical Use
# enable_testing()
# find_package(Squish)
# if (SQUISH_FOUND)
-# SQUISH_ADD_TEST(myTestName myApplication testSuiteName testCaseName)
+# SQUISH_ADD_TEST(myTestName myApplication testCase envVars testWrapper)
# endif ()
#
+# macro SQUISH_ADD_TEST(testName applicationUnderTest testCase envVars testWrapper)
+# This is deprecated. Use SQUISH_V3_ADD_TEST() if you are using Squish 3.x instead.
+
#=============================================================================
# Copyright 2008-2009 Kitware, Inc.
@@ -124,7 +128,8 @@ find_package_handle_standard_args(Squish REQUIRED_VARS SQUISH_INSTALL_DIR SQUI
VERSION_VAR SQUISH_VERSION )
-macro(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper)
+
+macro(SQUISH_V3_ADD_TEST testName testAUT testCase envVars testWraper)
add_test(${testName}
${CMAKE_COMMAND} -V -VV
"-Dsquish_aut:STRING=${testAUT}"
@@ -141,3 +146,8 @@ macro(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper)
)
endmacro()
+
+macro(SQUISH_ADD_TEST)
+ message(STATUS "Using squish_add_test() is deprecated, use squish_v3_add_test() instead.")
+ squish_v3_add_test(${ARGV})
+endmacro()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=daf1c4d5a7edbf046a4a3d324f2ca01fb1d1a856
commit daf1c4d5a7edbf046a4a3d324f2ca01fb1d1a856
Author: Alex Neundorf <neundorf at kde.org>
AuthorDate: Sun Nov 4 19:25:43 2012 +0100
Commit: Alex Neundorf <neundorf at kde.org>
CommitDate: Sun Nov 4 19:25:43 2012 +0100
Squish: find executables also under Windows
This is required according to Volker Krause
(see http://public.kitware.com/Bug/view.php?id=9734)
Alex
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index 6f34ccc..667060c 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -78,12 +78,12 @@ if(SQUISH_INSTALL_DIR)
# find the client program
if(NOT SQUISH_CLIENT_EXECUTABLE)
- find_program(SQUISH_CLIENT_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishrunner DOC "The ${SQUISH_CLIENT_EXECUTABLE_STRING}")
+ find_program(SQUISH_CLIENT_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishrunner${CMAKE_EXECUTABLE_SUFFIX} DOC "The ${SQUISH_CLIENT_EXECUTABLE_STRING}")
endif()
# find the server program
if(NOT SQUISH_SERVER_EXECUTABLE)
- find_program(SQUISH_SERVER_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishserver DOC "The ${SQUISH_SERVER_EXECUTABLE_STRING}")
+ find_program(SQUISH_SERVER_EXECUTABLE ${SQUISH_INSTALL_DIR}/bin/squishserver${CMAKE_EXECUTABLE_SUFFIX} DOC "The ${SQUISH_SERVER_EXECUTABLE_STRING}")
endif()
else()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b878cd6fb4fee4c32bc97a7e63b8d25d2eab30cf
commit b878cd6fb4fee4c32bc97a7e63b8d25d2eab30cf
Author: Alex Neundorf <neundorf at kde.org>
AuthorDate: Sun Nov 4 19:22:27 2012 +0100
Commit: Alex Neundorf <neundorf at kde.org>
CommitDate: Sun Nov 4 19:22:27 2012 +0100
Squish: use FPHSA
Alex
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index 032ed97..6f34ccc 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -119,12 +119,10 @@ else()
endif()
# record if Squish was found
-set(SQUISH_FOUND 1)
-foreach(var SQUISH_INSTALL_DIR_FOUND SQUISH_CLIENT_EXECUTABLE_FOUND SQUISH_SERVER_EXECUTABLE_FOUND)
- if(NOT ${var})
- set(SQUISH_FOUND 0)
- endif()
-endforeach()
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Squish REQUIRED_VARS SQUISH_INSTALL_DIR SQUISH_CLIENT_EXECUTABLE SQUISH_SERVER_EXECUTABLE
+ VERSION_VAR SQUISH_VERSION )
+
macro(SQUISH_ADD_TEST testName testAUT testCase envVars testWraper)
add_test(${testName}
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3fe2bc622e75c052e75c351621a8c876070481a3
commit 3fe2bc622e75c052e75c351621a8c876070481a3
Author: Alex Neundorf <neundorf at kde.org>
AuthorDate: Sun Nov 4 19:11:43 2012 +0100
Commit: Alex Neundorf <neundorf at kde.org>
CommitDate: Sun Nov 4 19:19:40 2012 +0100
Squish: detect version
Alex
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index a032496..032ed97 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -4,6 +4,10 @@
#
# ---- Variables and Macros
# SQUISH_FOUND If false, don't try to use Squish
+# SQUISH_VERSION The full version of Squish found
+# SQUISH_VERSION_MAJOR The major version of Squish found
+# SQUISH_VERSION_MINOR The minor version of Squish found
+# SQUISH_VERSION_PATCH The patch version of Squish found
#
# SQUISH_INSTALL_DIR The Squish installation directory (containing bin, lib, etc)
# SQUISH_SERVER_EXECUTABLE The squishserver executable
@@ -86,9 +90,24 @@ else()
set(SQUISH_INSTALL_DIR_FOUND 0)
endif()
+
+set(SQUISH_VERSION)
+set(SQUISH_VERSION_MAJOR )
+set(SQUISH_VERSION_MINOR )
+set(SQUISH_VERSION_PATCH )
+
# record if executables are set
if(SQUISH_CLIENT_EXECUTABLE)
set(SQUISH_CLIENT_EXECUTABLE_FOUND 1)
+ execute_process(COMMAND "${SQUISH_CLIENT_EXECUTABLE}" --version
+ OUTPUT_VARIABLE _squishVersionOutput
+ ERROR_QUIET )
+ if("${_squishVersionOutput}" MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+).*$")
+ set(SQUISH_VERSION_MAJOR "${CMAKE_MATCH_1}")
+ set(SQUISH_VERSION_MINOR "${CMAKE_MATCH_2}")
+ set(SQUISH_VERSION_PATCH "${CMAKE_MATCH_3}")
+ set(SQUISH_VERSION "${SQUISH_VERSION_MAJOR}.${SQUISH_VERSION_MINOR}.${SQUISH_VERSION_PATCH}" )
+ endif()
else()
set(SQUISH_CLIENT_EXECUTABLE_FOUND 0)
endif()
-----------------------------------------------------------------------
Summary of changes:
Modules/FindSquish.cmake | 159 +++++++++++++++++++++++++++++++++++++---
Modules/Squish4RunTestCase.bat | 24 ++++++
Modules/Squish4RunTestCase.sh | 28 +++++++
Modules/SquishTestScript.cmake | 52 +++++++++----
Source/CMakeVersion.cmake | 2 +-
5 files changed, 235 insertions(+), 30 deletions(-)
create mode 100755 Modules/Squish4RunTestCase.bat
create mode 100755 Modules/Squish4RunTestCase.sh
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list