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 2ce89b454085b5432bdf05f0c86af0e3879f6c75 (commit) via c979c60c4386b844bfe0d2dc3a8e64da1318c561 (commit) via cf4a7eb0272555119489b7eacd88eb785c496ce2 (commit) from 0df50f497c4c4937e882b6ea7048980e52e855d0 (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=2ce89b454085b5432bdf05f0c86af0e3879f6c75 commit 2ce89b454085b5432bdf05f0c86af0e3879f6c75 Merge: 0df50f4 c979c60 Author: Clinton Stimpson <clin...@elemtech.com> AuthorDate: Mon Aug 4 11:08:40 2014 -0400 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Mon Aug 4 11:08:40 2014 -0400 Merge topic 'qt-automoc' into next c979c60c Qt: Enable running automoc test with Qt4 or Qt5. cf4a7eb0 Qt: Fix automoc when .h and .cpp are in different directories. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c979c60c4386b844bfe0d2dc3a8e64da1318c561 commit c979c60c4386b844bfe0d2dc3a8e64da1318c561 Author: Clinton Stimpson <clin...@elemtech.com> AuthorDate: Mon Aug 4 08:14:52 2014 -0600 Commit: Clinton Stimpson <clin...@elemtech.com> CommitDate: Mon Aug 4 09:08:16 2014 -0600 Qt: Enable running automoc test with Qt4 or Qt5. Previously, the automoc tests required both Qt4 and Qt5. diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index ca7fcdc..1402c95 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1201,7 +1201,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Targets") - if(Qt5Widgets_FOUND AND NOT Qt5Widgets_VERSION VERSION_LESS 5.1.0) + endif() + + if((QT4_WORKS AND QT_QTGUI_FOUND) OR + (Qt5Widgets_FOUND AND NOT Qt5Widgets_VERSION VERSION_LESS 5.1.0) ) add_test(Qt4And5Automoc ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Qt4And5Automoc" @@ -1226,7 +1229,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release --test-command ${CMAKE_CTEST_COMMAND} -V ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocReverse") - endif() endif() find_package(GTK2 QUIET) http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cf4a7eb0272555119489b7eacd88eb785c496ce2 commit cf4a7eb0272555119489b7eacd88eb785c496ce2 Author: Clinton Stimpson <clin...@elemtech.com> AuthorDate: Mon Aug 4 08:11:31 2014 -0600 Commit: Clinton Stimpson <clin...@elemtech.com> CommitDate: Mon Aug 4 09:08:00 2014 -0600 Qt: Fix automoc when .h and .cpp are in different directories. Thanks Lode Leroy for the patch. diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index d4d565c..76edad5 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1830,30 +1830,57 @@ cmQtAutoGenerators::SearchHeadersForCppFile(const std::string& absFilename, const std::string basename = cmsys::SystemTools::GetFilenameWithoutLastExtension(absFilename); const std::string absPath = cmsys::SystemTools::GetFilenamePath( - cmsys::SystemTools::GetRealPath(absFilename.c_str())) + '/'; + cmsys::SystemTools::GetRealPath(absFilename.c_str())); - for(std::vector<std::string>::const_iterator ext = headerExtensions.begin(); - ext != headerExtensions.end(); - ++ext) + std::vector<std::string> incPaths; + incPaths.push_back(absPath); + cmSystemTools::ExpandListArgument(this->MocIncludesStr, incPaths); + + for(std::vector<std::string>::const_iterator path = incPaths.begin(); + path != incPaths.end(); + ++path) + { + bool found = false; + for(std::vector<std::string>::const_iterator ext = + headerExtensions.begin(); + ext != headerExtensions.end(); + ++ext) { - const std::string headerName = absPath + basename + "." + (*ext); - if (cmsys::SystemTools::FileExists(headerName.c_str())) + const std::string headerName = (*path) + "/" + basename + "." + (*ext); + + if (cmsys::SystemTools::FileExists(headerName.c_str())) { - absHeaders.insert(headerName); - break; + absHeaders.insert(headerName); + found = true; + break; } } - for(std::vector<std::string>::const_iterator ext = headerExtensions.begin(); - ext != headerExtensions.end(); - ++ext) + if (found) + break; + } + for(std::vector<std::string>::const_iterator path = incPaths.begin(); + path != incPaths.end(); + ++path) + { + bool found = false; + for(std::vector<std::string>::const_iterator ext = + headerExtensions.begin(); + ext != headerExtensions.end(); + ++ext) { - const std::string privateHeaderName = absPath+basename+"_p."+(*ext); - if (cmsys::SystemTools::FileExists(privateHeaderName.c_str())) + const std::string privateHeaderName = (*path) + "/" + + basename + "_p." + (*ext); + + if (cmsys::SystemTools::FileExists(privateHeaderName.c_str())) { - absHeaders.insert(privateHeaderName); - break; + absHeaders.insert(privateHeaderName); + found = true; + break; } } + if (found) + break; + } } diff --git a/Tests/Qt4And5Automoc/AnObject.cpp b/Tests/Qt4And5Automoc/AnObject.cpp new file mode 100644 index 0000000..c1c93f1 --- /dev/null +++ b/Tests/Qt4And5Automoc/AnObject.cpp @@ -0,0 +1,4 @@ +#include "AnObject.h" + +void AnObject::activated() { +} diff --git a/Tests/Qt4And5Automoc/AnObject.h b/Tests/Qt4And5Automoc/AnObject.h new file mode 100644 index 0000000..b7c5409 --- /dev/null +++ b/Tests/Qt4And5Automoc/AnObject.h @@ -0,0 +1,9 @@ +#include <QObject> + +class AnObject : public QObject { + Q_OBJECT +public: + AnObject() {} +private slots: + void activated(); +}; diff --git a/Tests/Qt4And5Automoc/CMakeLists.txt b/Tests/Qt4And5Automoc/CMakeLists.txt index ad74961..7f3e81e 100644 --- a/Tests/Qt4And5Automoc/CMakeLists.txt +++ b/Tests/Qt4And5Automoc/CMakeLists.txt @@ -1,13 +1,13 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0.1) project(Qt4And5Automoc) if (QT_REVERSE_FIND_ORDER) - find_package(Qt5Core REQUIRED) - find_package(Qt4 REQUIRED) + find_package(Qt5Core) + find_package(Qt4) else() - find_package(Qt4 REQUIRED) - find_package(Qt5Core REQUIRED) + find_package(Qt4) + find_package(Qt5Core) endif() set(CMAKE_AUTOMOC ON) @@ -20,10 +20,16 @@ macro(generate_main_file VERSION) ) endmacro() -generate_main_file(4) -generate_main_file(5) +include_directories(include) -add_executable(qt4_exe "${CMAKE_CURRENT_BINARY_DIR}/main_qt4.cpp") +if (${QT4_FOUND}) +generate_main_file(4) +add_executable(qt4_exe "${CMAKE_CURRENT_BINARY_DIR}/main_qt4.cpp" AnObject.cpp src/OtherObject.cpp) target_link_libraries(qt4_exe Qt4::QtCore) -add_executable(qt5_exe "${CMAKE_CURRENT_BINARY_DIR}/main_qt5.cpp") +endif() + +if (${QT5_FOUND}) +generate_main_file(5) +add_executable(qt5_exe "${CMAKE_CURRENT_BINARY_DIR}/main_qt5.cpp" AnObject.cpp src/OtherObject.cpp) target_link_libraries(qt5_exe Qt5::Core) +endif() diff --git a/Tests/Qt4And5Automoc/include/OtherObject.h b/Tests/Qt4And5Automoc/include/OtherObject.h new file mode 100644 index 0000000..6d51cc1 --- /dev/null +++ b/Tests/Qt4And5Automoc/include/OtherObject.h @@ -0,0 +1,9 @@ +#include <QObject> + +class OtherObject : public QObject { + Q_OBJECT +public: + OtherObject() {} +private slots: + void activated(); +}; diff --git a/Tests/Qt4And5Automoc/main.cpp.in b/Tests/Qt4And5Automoc/main.cpp.in index 00fd641..7852cd6 100644 --- a/Tests/Qt4And5Automoc/main.cpp.in +++ b/Tests/Qt4And5Automoc/main.cpp.in @@ -1,5 +1,7 @@ #include <QObject> +#include "AnObject.h" +#include "OtherObject.h" class SomeObject : public QObject { @@ -14,5 +16,7 @@ public: int main(int argc, char **argv) { + AnObject a; + OtherObject o; return 0; } diff --git a/Tests/Qt4And5Automoc/src/OtherObject.cpp b/Tests/Qt4And5Automoc/src/OtherObject.cpp new file mode 100644 index 0000000..d4e724a --- /dev/null +++ b/Tests/Qt4And5Automoc/src/OtherObject.cpp @@ -0,0 +1,4 @@ +#include "OtherObject.h" + +void OtherObject::activated() { +} ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/mailman/listinfo/cmake-commits