diff options
-rw-r--r-- | Modules/DeployQt4.cmake | 72 | ||||
-rw-r--r-- | Modules/FindQt3.cmake | 91 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 10 | ||||
-rw-r--r-- | Source/cmMakefile.h | 8 | ||||
-rw-r--r-- | Source/kwsys/kwsysDateStamp.cmake | 2 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 92 | ||||
-rw-r--r-- | Tests/CMakeTests/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/CMakeTests/CheckSourceTreeTest.cmake.in | 87 | ||||
-rw-r--r-- | Tests/CTestUpdateHG.cmake.in | 2 | ||||
-rw-r--r-- | Tests/Qt4Deploy/CMakeLists.txt | 70 | ||||
-rw-r--r-- | Tests/Qt4Deploy/testdeploy.cpp | 29 | ||||
-rw-r--r-- | Utilities/cmcurl/CMakeLists.txt | 4 |
12 files changed, 243 insertions, 229 deletions
diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake index 83f322c..8a5e9c5 100644 --- a/Modules/DeployQt4.cmake +++ b/Modules/DeployQt4.cmake @@ -82,6 +82,7 @@ include(BundleUtilities) set(DeployQt4_cmake_dir "${CMAKE_CURRENT_LIST_DIR}") +set(DeployQt4_apple_plugins_dir "PlugIns") function(write_qt4_conf qt_conf_dir qt_conf_contents) set(qt_conf_path "${qt_conf_dir}/qt.conf") @@ -130,6 +131,9 @@ function(fixup_qt4_executable executable) set(qt_conf_dir "${executable}/Contents/Resources") set(executable_path "${executable}") set(write_qt_conf TRUE) + if(NOT plugins_dir) + set(plugins_dir "${DeployQt4_apple_plugins_dir}") + endif() else() get_filename_component(executable_path "${executable}" PATH) if(NOT executable_path) @@ -141,7 +145,7 @@ function(fixup_qt4_executable executable) foreach(plugin ${qtplugins}) set(installed_plugin_path "") - install_qt4_plugin("${plugin}" "${plugins_dir}" "${executable}" 1 installed_plugin_path) + install_qt4_plugin("${plugin}" "${executable}" 1 installed_plugin_path) list(APPEND libs ${installed_plugin_path}) endforeach() @@ -166,23 +170,19 @@ function(install_qt4_plugin_path plugin executable copy installed_plugin_path_va set(component ${ARGV5}) set(configurations ${ARGV6}) if(EXISTS "${plugin}") - if(plugins_dir) - set(plugins_dir "${plugins_dir}") - else() - if(APPLE) - set(plugins_dir "PlugIns") - else() - set(plugins_dir "plugins") - endif() - endif() if(APPLE) + if(NOT plugins_dir) + set(plugins_dir "${DeployQt4_apple_plugins_dir}") + endif() set(plugins_path "${executable}/Contents/${plugins_dir}") else() - get_filename_component(executable_path "${executable}" PATH) - if(NOT executable_path) - set(executable_path ".") + get_filename_component(plugins_path "${executable}" PATH) + if(NOT plugins_path) + set(plugins_path ".") + endif() + if(plugins_dir) + set(plugins_path "${plugins_path}/${plugins_dir}") endif() - set(plugins_path "${executable_path}/${plugins_dir}") endif() set(plugin_group "") @@ -210,7 +210,7 @@ function(install_qt4_plugin_path plugin executable copy installed_plugin_path_va endif() install(FILES "${plugin}" DESTINATION "${plugins_path}" ${configurations} ${component}) endif() - set(${installed_plugin_path_var} ${${installed_path_var}} "${plugins_path}/${plugin_name}" PARENT_SCOPE) + set(${installed_plugin_path_var} "${plugins_path}/${plugin_name}" PARENT_SCOPE) endif() endfunction() @@ -220,11 +220,7 @@ function(install_qt4_plugin plugin executable copy installed_plugin_path_var) if(EXISTS "${plugin}") install_qt4_plugin_path("${plugin}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}") else() - if(QT_IS_STATIC) - string(TOUPPER "QT_${plugin}_LIBRARY" plugin_var) - else() - string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var) - endif() + string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var) set(plugin_release_var "${plugin_var}_RELEASE") set(plugin_debug_var "${plugin_var}_DEBUG") set(plugin_release "${${plugin_release_var}}") @@ -232,10 +228,24 @@ function(install_qt4_plugin plugin executable copy installed_plugin_path_var) if(DEFINED "${plugin_release_var}" AND DEFINED "${plugin_debug_var}" AND NOT EXISTS "${plugin_release}" AND NOT EXISTS "${plugin_debug}") message(WARNING "Qt plugin \"${plugin}\" not recognized or found.") endif() - install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel") - install_qt4_plugin_path("${plugin_debug}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Debug") + if(NOT EXISTS "${${plugin_debug_var}}") + set(plugin_debug "${plugin_release}") + endif() + + if(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}_release" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel") + install_qt4_plugin_path("${plugin_debug}" "${executable}" "${copy}" "${installed_plugin_path_var}_debug" "${plugins_dir}" "${component}" "Debug") + + if(CMAKE_BUILD_TYPE MATCHES "^Debug$") + set(${installed_plugin_path_var} ${${installed_plugin_path_var}_debug}) + else() + set(${installed_plugin_path_var} ${${installed_plugin_path_var}_release}) + endif() + else() + install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}") + endif() endif() - set(installed_plugin_path_var "${installed_plugin_path_var}" PARENT_SCOPE) + set(${installed_plugin_path_var} ${${installed_plugin_path_var}} PARENT_SCOPE) endfunction() function(install_qt4_executable executable) @@ -264,16 +274,16 @@ function(install_qt4_executable executable) set(qt_plugins_dir "") endif() - if(NOT qtplugins AND QT_LIBRARIES_PLUGINS) - set(qtplugins "${QT_LIBRARIES_PLUGINS}") + if(QT_IS_STATIC) + message(WARNING "Qt built statically: not installing plugins.") + else() + foreach(plugin ${qtplugins}) + set(installed_plugin_paths "") + install_qt4_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${component}") + list(APPEND libs ${installed_plugin_paths}) + endforeach() endif() - foreach(plugin ${qtplugins}) - set(installed_plugin_paths "") - install_qt4_plugin("${plugin}" "${executable}" 0 installed_plugin_paths "${plugins_dir}" "${component}") - list(APPEND libs ${installed_plugin_paths}) - endforeach() - resolve_qt4_paths(libs) install(CODE diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake index 86236cc..2d8dbde 100644 --- a/Modules/FindQt3.cmake +++ b/Modules/FindQt3.cmake @@ -1,10 +1,11 @@ # - Locate Qt include paths and libraries # This module defines: -# QT_INCLUDE_DIR - where to find qt.h, etc. -# QT_LIBRARIES - the libraries to link against to use Qt. -# QT_DEFINITIONS - definitions to use when -# compiling code that uses Qt. -# QT_FOUND - If false, don't try to use Qt. +# QT_INCLUDE_DIR - where to find qt.h, etc. +# QT_LIBRARIES - the libraries to link against to use Qt. +# QT_DEFINITIONS - definitions to use when +# compiling code that uses Qt. +# QT_FOUND - If false, don't try to use Qt. +# QT_VERSION_STRING - the version of Qt found # # If you need the multithreaded version of Qt, set QT_MT_REQUIRED to TRUE # @@ -46,13 +47,16 @@ IF(QT4_FOUND) ENDIF(QT4_FOUND) -FILE(GLOB GLOB_PATHS_BIN /usr/lib/qt-3*/bin/) +FILE(GLOB GLOB_PATHS /usr/lib/qt-3*) +FOREACH(GLOB_PATH ${GLOB_PATHS}) + LIST(APPEND GLOB_PATHS_BIN "${GLOB_PATH}/bin") +ENDFOREACH(GLOB_PATH) FIND_PATH(QT_INCLUDE_DIR qt.h "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt" $ENV{QTDIR}/include - ${GLOB_PATHS_BIN} + ${GLOB_PATHS} /usr/local/qt/include /usr/lib/qt/include /usr/lib/qt3/include @@ -71,12 +75,13 @@ ENDIF(NOT EXISTS ${QT_INCLUDE_DIR}/qglobal.h) IF(QT_INCLUDE_DIR) #extract the version string from qglobal.h FILE(READ ${QT_INCLUDE_DIR}/qglobal.h QGLOBAL_H) - STRING(REGEX MATCH "#define[\t ]+QT_VERSION_STR[\t ]+\"([0-9]+.[0-9]+.[0-9]+)\"" QGLOBAL_H "${QGLOBAL_H}") - STRING(REGEX REPLACE ".*\"([0-9]+.[0-9]+.[0-9]+)\".*" "\\1" qt_version_str "${QGLOBAL_H}") + STRING(REGEX MATCH "#define[\t ]+QT_VERSION_STR[\t ]+\"[0-9]+.[0-9]+.[0-9]+[a-z]*\"" QGLOBAL_H "${QGLOBAL_H}") + STRING(REGEX REPLACE ".*\"([0-9]+.[0-9]+.[0-9]+[a-z]*)\".*" "\\1" qt_version_str "${QGLOBAL_H}") # Under windows the qt library (MSVC) has the format qt-mtXYZ where XYZ is the # version X.Y.Z, so we need to remove the dots from version STRING(REGEX REPLACE "\\." "" qt_version_str_lib "${qt_version_str}") + SET(QT_VERSION_STRING "${qt_version_str}") ENDIF(QT_INCLUDE_DIR) FILE(GLOB GLOB_PATHS_LIB /usr/lib/qt-3*/lib/) @@ -195,58 +200,16 @@ IF (WIN32) ) ENDIF (WIN32) - -IF (QT_MIN_VERSION) - - STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" qt_major_vers "${qt_version_str}") - STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" qt_minor_vers "${qt_version_str}") - STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" qt_patch_vers "${qt_version_str}") - - #now parse the parts of the user given version string into variables - STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+$" req_qt_major_vers "${QT_MIN_VERSION}") - IF (NOT req_qt_major_vers) - error_message( "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"3.1.5\"") - ENDIF (NOT req_qt_major_vers) - - STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_qt_major_vers "${QT_MIN_VERSION}") - STRING(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" req_qt_minor_vers "${QT_MIN_VERSION}") - STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}") - - # req = "6.5.4", qt = "3.2.1" - MACRO(error_message msg) - IF(QT3_REQUIRED) - MESSAGE( FATAL_ERROR ${msg}) - ELSE(QT3_REQUIRED) - MESSAGE( STATUS ${msg}) - ENDIF(QT3_REQUIRED) - ENDMACRO(error_message) - - IF (req_qt_major_vers GREATER qt_major_vers) # (6 > 3) ? - ERROR_MESSAGE( "Qt major version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes - ELSE (req_qt_major_vers GREATER qt_major_vers) # no - IF (req_qt_major_vers LESS qt_major_vers) # (6 < 3) ? - SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes - ELSE (req_qt_major_vers LESS qt_major_vers) # ( 6==3) ? - IF (req_qt_minor_vers GREATER qt_minor_vers) # (5>2) ? - ERROR_MESSAGE( "Qt minor version not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes - ELSE (req_qt_minor_vers GREATER qt_minor_vers) # no - IF (req_qt_minor_vers LESS qt_minor_vers) # (5<2) ? - SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes - ELSE (req_qt_minor_vers LESS qt_minor_vers) # (5==2) - IF (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ? - ERROR_MESSAGE( "Qt patch level not matched (required: ${QT_MIN_VERSION}, found: ${qt_version_str})") # yes - ELSE (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ? - SET( QT_VERSION_BIG_ENOUGH "YES" ) # yes - ENDIF (req_qt_patch_vers GREATER qt_patch_vers) # (4>1) ? - ENDIF (req_qt_minor_vers LESS qt_minor_vers) - ENDIF (req_qt_minor_vers GREATER qt_minor_vers) - ENDIF (req_qt_major_vers LESS qt_major_vers) - ENDIF (req_qt_major_vers GREATER qt_major_vers) -ENDIF (QT_MIN_VERSION) +#support old QT_MIN_VERSION if set, but not if version is supplied by find_package() +IF(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION) + SET(Qt3_FIND_VERSION ${QT_MIN_VERSION}) +ENDIF(NOT Qt3_FIND_VERSION AND QT_MIN_VERSION) # if the include a library are found then we have it INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt3 DEFAULT_MSG QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt3 + REQUIRED_VARS QT_QT_LIBRARY QT_INCLUDE_DIR QT_MOC_EXECUTABLE + VERSION_VAR QT_VERSION_STRING) SET(QT_FOUND ${QT3_FOUND} ) IF(QT_FOUND) @@ -296,8 +259,16 @@ IF(QT_FOUND) ENDIF(QT_QT_LIBRARY MATCHES "qt-mt") ENDIF(QT_FOUND) -EXEC_PROGRAM(${QT_MOC_EXECUTABLE} ARGS "-v" OUTPUT_VARIABLE QTVERSION_MOC) -EXEC_PROGRAM(${QT_UIC_EXECUTABLE} ARGS "-version" OUTPUT_VARIABLE QTVERSION_UIC) +IF(QT_MOC_EXECUTABLE) + EXECUTE_PROCESS(COMMAND ${QT_MOC_EXECUTABLE} "-v" + OUTPUT_VARIABLE QTVERSION_MOC + ERROR_QUIET) +ENDIF(QT_MOC_EXECUTABLE) +IF(QT_UIC_EXECUTABLE) + EXECUTE_PROCESS(COMMAND ${QT_UIC_EXECUTABLE} "-version" + OUTPUT_VARIABLE QTVERSION_UIC + ERROR_QUIET) +ENDIF(QT_UIC_EXECUTABLE) SET(_QT_UIC_VERSION_3 FALSE) IF("${QTVERSION_UIC}" MATCHES ".* 3..*") diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index fdf5b31..a715f06 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -210,9 +210,9 @@ cmMakefile::~cmMakefile() { delete *i; } - for(unsigned int i=0; i < this->UsedCommands.size(); i++) + for(unsigned int i=0; i < this->FinalPassCommands.size(); i++) { - delete this->UsedCommands[i]; + delete this->FinalPassCommands[i]; } std::vector<cmFunctionBlocker*>::iterator pos; for (pos = this->FunctionBlockers.begin(); @@ -421,7 +421,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, else if(pcmd->HasFinalPass()) { // use the command - this->UsedCommands.push_back(pcmd.release()); + this->FinalPassCommands.push_back(pcmd.release()); } } else if ( this->GetCMakeInstance()->GetWorkingMode() == cmake::SCRIPT_MODE @@ -813,8 +813,8 @@ void cmMakefile::FinalPass() // give all the commands a chance to do something // after the file has been parsed before generation - for(std::vector<cmCommand*>::iterator i = this->UsedCommands.begin(); - i != this->UsedCommands.end(); ++i) + for(std::vector<cmCommand*>::iterator i = this->FinalPassCommands.begin(); + i != this->FinalPassCommands.end(); ++i) { (*i)->FinalPass(); } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 1c46a73..f1f318a 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -620,12 +620,6 @@ public: */ bool CanIWriteThisFile(const char* fileName); - /** - * Get the vector of used command instances. - */ - const std::vector<cmCommand*>& GetUsedCommands() const - {return this->UsedCommands;} - #if defined(CMAKE_BUILD_WITH_CMAKE) /** * Get the vector source groups. @@ -913,7 +907,7 @@ protected: std::vector<cmSourceGroup> SourceGroups; #endif - std::vector<cmCommand*> UsedCommands; + std::vector<cmCommand*> FinalPassCommands; cmLocalGenerator* LocalGenerator; bool IsFunctionBlocked(const cmListFileFunction& lff, cmExecutionStatus &status); diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 4c91b5c..617f126 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2012) SET(KWSYS_DATE_STAMP_MONTH 03) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 02) +SET(KWSYS_DATE_STAMP_DAY 06) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 00cac94..53c59cc 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -233,12 +233,35 @@ IF(BUILD_TESTING) LIST(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX}) + IF(NOT QT4_FOUND) + FIND_PACKAGE(Qt4) + ENDIF(NOT QT4_FOUND) + + IF(QT4_FOUND) + # test whether the Qt4 which has been found works, on some machines + # which run nightly builds there were errors like "wrong file format" + # for libQtCore.so. So first check it works, and only if it does add + # the automoc test. + INCLUDE(CheckCXXSourceCompiles) + SET(_save_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") + SET(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") + + SET(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES}) + SET(CMAKE_REQUIRED_LIBRARIES ${QT_QTCORE_LIBRARIES}) + + CHECK_CXX_SOURCE_COMPILES("#include <QCoreApplication>\n int main() {return (qApp == 0 ? 0 : 1); }\n" + QT4_WORKS) + + SET(CMAKE_REQUIRED_INCLUDES "${_save_CMAKE_REQUIRED_INCLUDES}") + SET(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}") + ENDIF() # run test for BundleUtilities on supported platforms/compilers if(MSVC OR CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin") if(NOT "${CMAKE_TEST_GENERATOR}" STREQUAL "Watcom WMake") + ADD_TEST(BundleUtilities ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/BundleUtilities" @@ -248,6 +271,24 @@ IF(BUILD_TESTING) --build-project BundleUtilities ) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities") + + # run test for DeployQt4 on supported platforms/compilers (which depends on BundleUtilities) + # this test also depends on the existence of the standard qtiff plugin + if(QT4_WORKS AND QT_QTSQL_FOUND) + ADD_TEST(Qt4Deploy ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/Qt4Deploy" + "${CMake_BINARY_DIR}/Tests/Qt4Deploy" + --build-generator ${CMAKE_TEST_GENERATOR} + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project Qt4Deploy + --build-options + -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} + -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} + ) + LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Deploy") + endif() + endif() endif() @@ -861,43 +902,20 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment") - IF(NOT QT4_FOUND) - FIND_PACKAGE(Qt4) - ENDIF(NOT QT4_FOUND) - - IF(QT4_FOUND) - # test whether the Qt4 which has been found works, on some machines - # which run nightly builds there were errors like "wrong file format" - # for libQtCore.so. So first check it works, and only if it does add - # the automoc test. - INCLUDE(CheckCXXSourceCompiles) - SET(_save_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") - SET(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") - - SET(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES}) - SET(CMAKE_REQUIRED_LIBRARIES ${QT_QTCORE_LIBRARIES}) - - CHECK_CXX_SOURCE_COMPILES("#include <QCoreApplication>\n int main() {return (qApp == 0 ? 0 : 1); }\n" - QT4_WORKS_FOR_AUTOMOC_TEST) - - SET(CMAKE_REQUIRED_INCLUDES "${_save_CMAKE_REQUIRED_INCLUDES}") - SET(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}") - - IF(QT4_WORKS_FOR_AUTOMOC_TEST) - ADD_TEST(QtAutomoc ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/QtAutomoc" - "${CMake_BINARY_DIR}/Tests/QtAutomoc" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-project QtAutomoc - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} - --build-exe-dir "${CMake_BINARY_DIR}/Tests/QtAutomoc" - --force-new-ctest-process - --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} - --test-command ${CMAKE_CTEST_COMMAND} -V - ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomoc") - ENDIF() + IF(QT4_WORKS AND QT_QTGUI_FOUND) + ADD_TEST(QtAutomoc ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/QtAutomoc" + "${CMake_BINARY_DIR}/Tests/QtAutomoc" + --build-generator ${CMAKE_TEST_GENERATOR} + --build-project QtAutomoc + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-exe-dir "${CMake_BINARY_DIR}/Tests/QtAutomoc" + --force-new-ctest-process + --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} + --test-command ${CMAKE_CTEST_COMMAND} -V + ) + LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomoc") ENDIF() ADD_TEST(ExternalProject ${CMAKE_CTEST_COMMAND} diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt index aa4d52e..ea2c6f1 100644 --- a/Tests/CMakeTests/CMakeLists.txt +++ b/Tests/CMakeTests/CMakeLists.txt @@ -56,14 +56,13 @@ AddCMakeTest(GetPrerequisites "${GetPrerequisites_PreArgs}") # suite. It detects if any changes have been made to the CMake source tree # by any previous configure, build or test steps. # -if(do_cvs_tests OR GIT_EXECUTABLE) +if(GIT_EXECUTABLE) string(REPLACE "\\" "/" ENV_HOME "$ENV{HOME}") set(CheckSourceTree_PreArgs "-DCMake_BINARY_DIR:PATH=${CMake_BINARY_DIR}" "-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}" - "-DCVS_EXECUTABLE:STRING=${CVS_EXECUTABLE}" "-DGIT_EXECUTABLE:STRING=${GIT_EXECUTABLE}" "-DHOME:STRING=${ENV_HOME}" ) AddCMakeTest(CheckSourceTree "${CheckSourceTree_PreArgs}") -endif(do_cvs_tests OR GIT_EXECUTABLE) +endif() diff --git a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in index 73f8b01..59b2890 100644 --- a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in +++ b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in @@ -5,7 +5,6 @@ message("CTEST_FULL_OUTPUT (Avoid ctest truncation of output)") message("") message("CMake_BINARY_DIR='${CMake_BINARY_DIR}'") message("CMake_SOURCE_DIR='${CMake_SOURCE_DIR}'") -message("CVS_EXECUTABLE='${CVS_EXECUTABLE}'") message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'") message("HOME='${HOME}'") message("ENV{DASHBOARD_TEST_FROM_CTEST}='$ENV{DASHBOARD_TEST_FROM_CTEST}'") @@ -43,7 +42,7 @@ message("in_source_build='${in_source_build}'") message("") -# If this does not appear to be a git or CVS checkout, just pass the test here +# If this does not appear to be a git checkout, just pass the test here # and now. (Do not let the test fail if it is run in a tree *exported* from a # repository or unpacked from a .zip file source installer...) # @@ -52,29 +51,13 @@ if(EXISTS "${CMake_SOURCE_DIR}/.git") set(is_git_checkout 1) endif() -set(is_cvs_checkout 0) -if(EXISTS "${CMake_SOURCE_DIR}/CVS/Root") - set(is_cvs_checkout 1) -endif() - message("is_git_checkout='${is_git_checkout}'") -message("is_cvs_checkout='${is_cvs_checkout}'") message("") -if(NOT is_cvs_checkout) if(NOT is_git_checkout) - message("source tree is neither git nor CVS checkout... test passes by early return...") + message("source tree is not a git checkout... test passes by early return...") return() endif() -endif() - -if(is_cvs_checkout) -if(is_git_checkout) - message("warning: source tree has both git *and* CVS file system bits???") - # should this condition be a FATAL_ERROR test failure...? -endif() -endif() - # This test looks for the following types of changes in the source tree: # @@ -83,51 +66,13 @@ set(conflicts 0) set(modifications 0) set(nonadditions 0) -# ov == output variable... conditionally filled in by either cvs or git below: +# ov == output variable... conditionally filled in by either git below: # set(cmd "") set(ov "") set(ev "") set(rv "") - -if(is_cvs_checkout AND CVS_EXECUTABLE) - # Check with "cvs -q -n up -dP" if there are any local modifications to the - # CMake source tree: - # - message("=============================================================================") - message("This is a cvs checkout, using cvs to verify source tree....") - message("") - - execute_process(COMMAND ${CVS_EXECUTABLE} --version - WORKING_DIRECTORY ${CMake_SOURCE_DIR} - OUTPUT_VARIABLE version_output - OUTPUT_STRIP_TRAILING_WHITESPACE) - message("=== output of 'cvs --version' ===") - message("${version_output}") - message("=== end output ===") - message("") - - file(READ "${CMake_SOURCE_DIR}/CVS/Root" contents) - message("=== content of CVS/Root ===") - message("${contents}") - message("=== end content ===") - message("") - - file(READ "${CMake_SOURCE_DIR}/CVS/Repository" contents) - message("=== content of CVS/Repository ===") - message("${contents}") - message("=== end content ===") - message("") - - message("Copy/paste this command to reproduce:") - message("cd \"${CMake_SOURCE_DIR}\" && \"${CVS_EXECUTABLE}\" -q -n up -dP") - message("") - - set(cmd ${CVS_EXECUTABLE} -q -n up -dP) -endif() - - # If no GIT_EXECUTABLE, see if we can figure out which git was used # for the ctest_update step on this dashboard... # @@ -268,8 +213,8 @@ endif() if(cmd) - # Use the HOME value passed in to the script for calling cvs/git so it can - # find its .cvspass or user/global config settings... + # Use the HOME value passed in to the script for calling git so it can + # find its user/global config settings... # set(original_ENV_HOME "$ENV{HOME}") set(ENV{HOME} "${HOME}") @@ -322,28 +267,6 @@ if(NOT ov STREQUAL "") endif() if(consider) - if(is_cvs_checkout) - if(line MATCHES "^A ") - message(" locally added file/directory detected...") - set(additions 1) - endif() - - if(line MATCHES "^C ") - message(" conflict detected...") - set(conflicts 1) - endif() - - if(line MATCHES "^M ") - message(" locally modified file detected...") - set(modifications 1) - endif() - - if(line MATCHES "^\\? ") - message(" locally non-added file/directory detected...") - set(nonadditions 1) - endif() - endif() - if(is_git_checkout) if(line MATCHES "^#[ \t]*modified:") message(" locally modified file detected...") diff --git a/Tests/CTestUpdateHG.cmake.in b/Tests/CTestUpdateHG.cmake.in index 543ddd9..5a9daae 100644 --- a/Tests/CTestUpdateHG.cmake.in +++ b/Tests/CTestUpdateHG.cmake.in @@ -28,7 +28,7 @@ run_child( WORKING_DIRECTORY ${TOP}/repo.hg COMMAND ${HG} init ) -set(REPO file://${TOP}/repo.hg) +set(REPO file:///${TOP}/repo.hg) #----------------------------------------------------------------------------- # Import initial content into the repository. diff --git a/Tests/Qt4Deploy/CMakeLists.txt b/Tests/Qt4Deploy/CMakeLists.txt new file mode 100644 index 0000000..646ea9f --- /dev/null +++ b/Tests/Qt4Deploy/CMakeLists.txt @@ -0,0 +1,70 @@ +cmake_minimum_required(VERSION 2.8) + +project(Qt4Deploy) +set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/install) + +find_package(Qt4 REQUIRED QtMain QtCore QtSql) +include(${QT_USE_FILE}) + +add_executable(testdeploy MACOSX_BUNDLE testdeploy.cpp) +target_link_libraries(testdeploy ${QT_LIBRARIES}) +set_target_properties(testdeploy PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}") + +if(CMAKE_CONFIGURATION_TYPES AND QT_QTCORE_LIBRARY_RELEASE AND QT_QTCORE_LIBRARY_DEBUG) + # note: installing debug Qt libraries from a Qt installation configured with + # -debug-and-release not yet supported (very low priority). + install(CODE " + if(\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Dd][Ee][Bb][Uu][Gg])$\") + return() + endif() + ") +endif() + +# install the Qt4 app with qsqlite plugin +install(CODE "file(REMOVE_RECURSE \"${CMAKE_INSTALL_PREFIX}\")") +install(TARGETS testdeploy DESTINATION .) +include(../../Modules/DeployQt4.cmake) +if(APPLE) + install_qt4_executable(testdeploy.app "qsqlite") +elseif(WIN32) + install_qt4_executable(testdeploy.exe "qsqlite") +else() + install_qt4_executable(testdeploy "qsqlite") +endif() + + +# test depends on standard qsqlite plugin +if(QT_QSQLITE_PLUGIN_DEBUG OR QT_QSQLITE_PLUGIN_RELEASE) + + # test the deployed Qt application + if(APPLE) + install(CODE " + message(STATUS \"executing: ${CMAKE_INSTALL_PREFIX}/testdeploy.app/Contents/MacOS/testdeploy\") + execute_process(COMMAND \"${CMAKE_INSTALL_PREFIX}/testdeploy.app/Contents/MacOS/testdeploy\" + RESULT_VARIABLE result) + if(NOT result STREQUAL \"0\") + message(FATAL_ERROR \"error running testdeploy app\") + endif() + ") + else() + install(CODE " + message(STATUS \"executing: ${CMAKE_INSTALL_PREFIX}/testdeploy\") + execute_process(COMMAND \"${CMAKE_INSTALL_PREFIX}/testdeploy\" + RESULT_VARIABLE result) + if(NOT result STREQUAL \"0\") + message(FATAL_ERROR \"error running testdeploy app\") + endif() + ") + endif() + + # custom target to install and test the installation at build time + if(CMAKE_CONFIGURATION_TYPES) + set(install_config "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_CFG_INTDIR}") + endif() + + add_custom_target(testdeploy_test ALL + COMMAND ${CMAKE_COMMAND} ${install_config} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake + COMMENT "${CMAKE_COMMAND} ${install_config} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_install.cmake" + DEPENDS testdeploy) + +endif() diff --git a/Tests/Qt4Deploy/testdeploy.cpp b/Tests/Qt4Deploy/testdeploy.cpp new file mode 100644 index 0000000..8b9c8d6 --- /dev/null +++ b/Tests/Qt4Deploy/testdeploy.cpp @@ -0,0 +1,29 @@ +#include <QCoreApplication> +#include <QSqlDatabase> +#include <QLibraryInfo> +#include <QDebug> +#include <QStringList> + +int main(int argc, char** argv) +{ + QCoreApplication app(argc, argv); + + qDebug() << "App path:" << app.applicationDirPath(); + qDebug() << "Plugin path:" << QLibraryInfo::location(QLibraryInfo::PluginsPath); + + bool foundSqlite = false; + + qDebug() << "Supported Database Drivers:"; + foreach(const QString &sqlDriver, QSqlDatabase::drivers()) + { + qDebug() << " " << sqlDriver; + if(sqlDriver == "QSQLITE") + foundSqlite = true; + } + + if(foundSqlite) + qDebug() << "Found sqlite support from plugin."; + else + qDebug() << "Could not find sqlite support from plugin."; + return foundSqlite ? 0 : 1; +} diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt index 29ce25d6..caa44f1 100644 --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt @@ -126,9 +126,9 @@ IF(CURL_MALLOC_DEBUG) ENDIF(CURL_MALLOC_DEBUG) # On windows preload settings -IF(WIN32) +IF(WIN32 AND NOT MINGW) INCLUDE(${LIBCURL_SOURCE_DIR}/Platforms/WindowsCache.cmake) -ENDIF(WIN32) +ENDIF() # This macro checks if the symbol exists in the library and if it # does, it appends library to the list. |