diff options
-rw-r--r-- | CMakeCPack.cmake | 76 | ||||
-rw-r--r-- | CMakeCPackOptions.cmake.in | 58 | ||||
-rw-r--r-- | Help/generator/Visual Studio 15 2017.rst (renamed from Help/generator/Visual Studio 15.rst) | 12 | ||||
-rw-r--r-- | Help/manual/cmake-generators.7.rst | 2 | ||||
-rw-r--r-- | Help/manual/cmake-properties.7.rst | 2 | ||||
-rw-r--r-- | Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst | 6 | ||||
-rw-r--r-- | Help/prop_tgt/VS_USER_PROPS_CXX.rst | 12 | ||||
-rw-r--r-- | Help/release/3.7.rst | 6 | ||||
-rw-r--r-- | Help/release/dev/cpack-ifw-options.rst | 7 | ||||
-rw-r--r-- | Help/release/dev/vs-custom-msbuild-props.rst | 9 | ||||
-rw-r--r-- | Help/release/dev/vs-debugger-config.rst | 6 | ||||
-rw-r--r-- | Modules/CMakeGraphVizOptions.cmake | 13 | ||||
-rw-r--r-- | Modules/CPackIFW.cmake | 74 | ||||
-rw-r--r-- | Modules/FindPythonLibs.cmake | 8 | ||||
-rw-r--r-- | Modules/Platform/Darwin-PGI-C.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/Darwin-PGI-CXX.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/Darwin-PGI-Fortran.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/Darwin-PGI.cmake | 14 | ||||
-rw-r--r-- | Modules/UseSWIG.cmake | 7 | ||||
-rw-r--r-- | Source/CMakeLists.txt | 16 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWInstaller.cxx | 6 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWPackage.cxx | 82 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWPackage.h | 3 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 18 | ||||
-rw-r--r-- | Source/CPack/cmCPackGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmCommands.cxx | 43 | ||||
-rw-r--r-- | Source/cmElseCommand.cxx | 14 | ||||
-rw-r--r-- | Source/cmElseCommand.h | 45 | ||||
-rw-r--r-- | Source/cmElseIfCommand.cxx | 13 | ||||
-rw-r--r-- | Source/cmElseIfCommand.h | 45 | ||||
-rw-r--r-- | Source/cmEndForEachCommand.cxx | 15 | ||||
-rw-r--r-- | Source/cmEndForEachCommand.h | 56 | ||||
-rw-r--r-- | Source/cmEndFunctionCommand.cxx | 15 | ||||
-rw-r--r-- | Source/cmEndFunctionCommand.h | 56 | ||||
-rw-r--r-- | Source/cmEndIfCommand.cxx | 24 | ||||
-rw-r--r-- | Source/cmEndIfCommand.h | 45 | ||||
-rw-r--r-- | Source/cmEndMacroCommand.cxx | 15 | ||||
-rw-r--r-- | Source/cmEndMacroCommand.h | 56 | ||||
-rw-r--r-- | Source/cmEndWhileCommand.cxx | 22 | ||||
-rw-r--r-- | Source/cmEndWhileCommand.h | 56 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio15Generator.cxx | 11 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmServerProtocol.cxx | 2 | ||||
-rw-r--r-- | Source/cmUnexpectedCommand.cxx | 22 | ||||
-rw-r--r-- | Source/cmUnexpectedCommand.h | 40 | ||||
-rw-r--r-- | Source/cmVS140CLFlagTable.h | 2 | ||||
-rw-r--r-- | Source/cmVS141CLFlagTable.h | 1 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 44 | ||||
-rw-r--r-- | Source/cmake.cxx | 2 | ||||
-rw-r--r-- | Source/kwsys/CMakeLists.txt | 15 | ||||
-rw-r--r-- | Source/kwsys/ConsoleBuf.hxx.in | 71 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/CMakeLists.txt | 132 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/Adir/CMakeLists.txt (renamed from Tests/QtAutogen/Adir/CMakeLists.txt) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/Adir/libA.cpp (renamed from Tests/QtAutogen/Adir/libA.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/Adir/libA.h (renamed from Tests/QtAutogen/Adir/libA.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/Bdir/CMakeLists.txt (renamed from Tests/QtAutogen/Bdir/CMakeLists.txt) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/Bdir/libB.cpp (renamed from Tests/QtAutogen/Bdir/libB.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/Bdir/libB.h (renamed from Tests/QtAutogen/Bdir/libB.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/CMakeLists.txt | 81 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/abc.cpp (renamed from Tests/QtAutogen/abc.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/abc.h (renamed from Tests/QtAutogen/abc.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/abc_p.h (renamed from Tests/QtAutogen/abc_p.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/bar.cpp (renamed from Tests/QtAutogen/bar.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/blub.cpp (renamed from Tests/QtAutogen/blub.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/blub.h (renamed from Tests/QtAutogen/blub.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/calwidget.cpp (renamed from Tests/QtAutogen/calwidget.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/calwidget.h (renamed from Tests/QtAutogen/calwidget.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/calwidget.ui (renamed from Tests/QtAutogen/calwidget.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/codeeditor.cpp (renamed from Tests/QtAutogen/codeeditor.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/codeeditor.h (renamed from Tests/QtAutogen/codeeditor.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/debug_class.cpp (renamed from Tests/QtAutogen/debug_class.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/debug_class.h (renamed from Tests/QtAutogen/debug_class.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/debug_class.ui (renamed from Tests/QtAutogen/debug_class.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/debug_resource.qrc (renamed from Tests/QtAutogen/debug_resource.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/foo.cpp (renamed from Tests/QtAutogen/foo.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/foo.h (renamed from Tests/QtAutogen/foo.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/gadget.cpp (renamed from Tests/QtAutogen/gadget.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/gadget.h (renamed from Tests/QtAutogen/gadget.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/generated.cpp (renamed from Tests/QtAutogen/generated.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/generated.h (renamed from Tests/QtAutogen/generated.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/generated.txt.in (renamed from Tests/QtAutogen/generated.txt.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/generated_resource.qrc.in (renamed from Tests/QtAutogen/generated_resource.qrc.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/libC.cpp (renamed from Tests/QtAutogen/libC.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/libC.h (renamed from Tests/QtAutogen/libC.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/main.cpp (renamed from Tests/QtAutogen/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/multiplewidgets.cpp (renamed from Tests/QtAutogen/multiplewidgets.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/multiplewidgets.h (renamed from Tests/QtAutogen/multiplewidgets.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/myinterface.h.in (renamed from Tests/QtAutogen/myinterface.h.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/myotherinterface.h.in (renamed from Tests/QtAutogen/myotherinterface.h.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/private_slot.cpp (renamed from Tests/QtAutogen/private_slot.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/private_slot.h (renamed from Tests/QtAutogen/private_slot.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/resourcetester.cpp (renamed from Tests/QtAutogen/resourcetester.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/resourcetester.h (renamed from Tests/QtAutogen/resourcetester.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/second_resource.qrc (renamed from Tests/QtAutogen/second_resource.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/second_widget.cpp (renamed from Tests/QtAutogen/second_widget.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/second_widget.h (renamed from Tests/QtAutogen/second_widget.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/second_widget.ui (renamed from Tests/QtAutogen/second_widget.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/sub/bar.h (renamed from Tests/QtAutogen/sub/bar.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/targetObjectsTest.cpp (renamed from Tests/QtAutogen/targetObjectsTest.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/test.qrc (renamed from Tests/QtAutogen/test.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/widget1.ui (renamed from Tests/QtAutogen/widget1.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/widget2.ui (renamed from Tests/QtAutogen/widget2.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/xyz.cpp (renamed from Tests/QtAutogen/xyz.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/xyz.h (renamed from Tests/QtAutogen/xyz.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/yaf.cpp (renamed from Tests/QtAutogen/yaf.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/yaf.h (renamed from Tests/QtAutogen/yaf.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/complex/yaf_p.h (renamed from Tests/QtAutogen/yaf_p.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/rccEmpty.cpp (renamed from Tests/QtAutogen/rcconly.cpp) | 4 | ||||
-rw-r--r-- | Tests/QtAutogen/rccEmptyRes.qrc (renamed from Tests/QtAutogen/rcc_empty_resource.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/rccOnly.cpp (renamed from Tests/QtAutogen/rcc_empty.cpp) | 4 | ||||
-rw-r--r-- | Tests/QtAutogen/rccOnlyRes.qrc | 5 | ||||
-rw-r--r-- | Tests/QtAutogen/uicOnlySource/uiconly.cpp (renamed from Tests/QtAutogen/sub/uiconly.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/uicOnlySource/uiconly.h (renamed from Tests/QtAutogen/sub/uiconly.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/uicOnlySource/uiconly.ui (renamed from Tests/QtAutogen/sub/uiconly.ui) | 0 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/RunCMakeTest.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsCustomProps-check.cmake | 25 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsCustomProps.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake | 22 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/VS10Project/my.props | 5 | ||||
-rw-r--r-- | Tests/RunCMake/while/EndAlone-stderr.txt | 2 | ||||
-rwxr-xr-x | bootstrap | 7 |
125 files changed, 756 insertions, 738 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index fc042bc..ba858bd 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -54,6 +54,47 @@ if(${CPACK_SYSTEM_NAME} MATCHES Windows) endif() endif() +# Advanced IFW configuration +set(_cpifwrc CPACK_IFW_COMPONENT_GROUP_CMAKE_) +set(_cpifwrcconf _CPACK_IFW_COMPONENT_GROUP_CMAKE) +set(${_cpifwrcconf} "# CMake IFW configuration\n") +macro(_cmifwarg DESCRIPTION TYPE NAME DEFAULT) + set(_var CMake_IFW_ROOT_COMPONENT_${NAME}) + if(DEFINED ${_var}) + set(${_var} ${${_var}} CACHE ${TYPE} ${DESCRIPTION}) + mark_as_advanced(${_var}) + elseif(NOT "${DEFAULT}" STREQUAL "") + set(${_var} ${DEFAULT}) + endif() + if(DEFINED ${_var}) + set(${_cpifwrcconf} + "${${_cpifwrcconf}} set(${_cpifwrc}${NAME}\n \"${${_var}}\")\n") + endif() +endmacro() + +_cmifwarg("Package <Name> tag (domen-like)" + STRING NAME "") +_cmifwarg("Package <DisplayName> tag" + STRING DISPLAY_NAME "") +_cmifwarg("Package <Description> tag" + STRING DESCRIPTION "") +_cmifwarg("Package <ReleaseDate> tag (keep empty to auto generate)" + STRING RELEASE_DATE "") +_cmifwarg("Package <Default> tag (values: TRUE, FALSE, SCRIPT)" + STRING DEFAULT "") +_cmifwarg("Package <Version> tag" + STRING VERSION + "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}") +_cmifwarg("Package <Script> tag" + FILEPATH SCRIPT "${CMake_BINARY_DIR}/installscript.qs") +_cmifwarg("Package <SortingPriority> tag" + STRING PRIORITY "100") +_cmifwarg("Package <ForsedInstallation> tag" + STRING FORCED_INSTALLATION "") + +set(${_cpifwrc}LICENSES_DEFAULT + "${CPACK_PACKAGE_NAME} Copyright;${CPACK_RESOURCE_FILE_LICENSE}") + # Components if(CMake_INSTALL_COMPONENTS) set(_CPACK_IFW_COMPONENTS_ALL cmake ctest cpack) @@ -103,20 +144,31 @@ if(CMake_INSTALL_COMPONENTS) endif() endif() set(_CPACK_IFW_COMPONENTS_CONFIGURATION " -# Components -set(CPACK_COMPONENTS_ALL \"${_CPACK_IFW_COMPONENTS_ALL}\") -set(CPACK_COMPONENTS_GROUPING IGNORE) -") + # Components + set(CPACK_COMPONENTS_ALL \"${_CPACK_IFW_COMPONENTS_ALL}\") + set(CPACK_COMPONENTS_GROUPING IGNORE) + ") else() if(BUILD_QtDialog AND USE_LGPL) - set(_CPACK_IFW_ADDITIONAL_LICENSES - "\"LGPLv${USE_LGPL}\" \"${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt\"") + set(${_cpifwrc}LICENSES_DEFAULT + "${${_cpifwrc}LICENSES_DEFAULT};LGPLv${USE_LGPL};${CMake_SOURCE_DIR}/Licenses/LGPLv${USE_LGPL}.txt") endif() endif() +_cmifwarg("Package <Licenses> tag (pairs of <display_name> <file_path>)" + STRING LICENSES "${${_cpifwrc}LICENSES_DEFAULT}") + # Components scripts configuration +if(CMake_INSTALL_COMPONENTS) + configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/CMake.qs.in" + "${CMake_BINARY_DIR}/installscript.qs" @ONLY + ) +else() + configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/installscript.qs.in" + "${CMake_BINARY_DIR}/installscript.qs" @ONLY + ) +endif() foreach(_script - CMake CMake.Documentation.SphinxHTML CMake.DeveloperReference.HTML) configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/${_script}.qs.in" @@ -137,17 +189,9 @@ if(${CMAKE_SYSTEM_NAME} MATCHES Windows) set(_CPACK_IFW_SHORTCUT_OPTIONAL "${_CPACK_IFW_SHORTCUT_OPTIONAL}component.addOperation(\"CreateShortcut\", \"@TargetDir@/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}/developer-reference/html/index.html\", \"@StartMenuDir@/CMake Developer Reference.lnk\");\n") endif() endif() - configure_file("${CMake_SOURCE_DIR}/Source/QtIFW/installscript.qs.in" - "${CMake_BINARY_DIR}/installscript.qs" @ONLY - ) install(FILES "${CMake_SOURCE_DIR}/Source/QtIFW/cmake.org.html" DESTINATION "${CMAKE_DOC_DIR}" ) - if(CMake_INSTALL_COMPONENTS) - set(_CPACK_IFW_PACKAGE_SCRIPT "${CMake_BINARY_DIR}/CMake.qs") - else() - set(_CPACK_IFW_PACKAGE_SCRIPT "${CMake_BINARY_DIR}/installscript.qs") - endif() endif() if(${CMAKE_SYSTEM_NAME} MATCHES Linux) @@ -155,8 +199,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES Linux) set(CPACK_IFW_ADMIN_TARGET_DIRECTORY "@ApplicationsDir@/${CMAKE_PROJECT_NAME}") endif() -set(_CPACK_IFW_PACKAGE_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}) - if(NOT DEFINED CPACK_PACKAGE_FILE_NAME) # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache # default to source package - system, on cygwin system is not diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index d7a33bc..99746b0 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -47,7 +47,7 @@ if(CPACK_GENERATOR MATCHES "IFW") @_CPACK_IFW_COMPONENTS_CONFIGURATION@ # Unspecified set(CPACK_IFW_COMPONENT_@_CPACK_IFW_COMPONENT_UNSPECIFIED_UNAME@_VERSION - "@_CPACK_IFW_PACKAGE_VERSION@") + "@CMake_IFW_ROOT_COMPONENT_VERSION@") # Package configuration group set(CPACK_IFW_PACKAGE_GROUP CMake) @@ -59,13 +59,7 @@ if(CPACK_GENERATOR MATCHES "IFW") "@CPACK_PACKAGE_NAME@") set(CPACK_COMPONENT_GROUP_CMAKE_DESCRIPTION "@CPACK_PACKAGE_DESCRIPTION_SUMMARY@") - set(CPACK_IFW_COMPONENT_GROUP_CMAKE_VERSION - "@_CPACK_IFW_PACKAGE_VERSION@") - set(CPACK_IFW_COMPONENT_GROUP_CMAKE_LICENSES - "@CPACK_PACKAGE_NAME@ Copyright" "@CPACK_RESOURCE_FILE_LICENSE@" - @_CPACK_IFW_ADDITIONAL_LICENSES@) - set(CPACK_IFW_COMPONENT_GROUP_CMAKE_SCRIPT "@_CPACK_IFW_PACKAGE_SCRIPT@") - set(CPACK_IFW_COMPONENT_GROUP_CMAKE_PRIORITY 100) + @_CPACK_IFW_COMPONENT_GROUP_CMAKE@ # Tools set(CPACK_COMPONENT_GROUP_TOOLS_DISPLAY_NAME "Command-Line Tools") @@ -73,7 +67,8 @@ if(CPACK_GENERATOR MATCHES "IFW") "Command-Line Tools: cmake, ctest and cpack") set(CPACK_COMPONENT_GROUP_TOOLS_PARENT_GROUP CMake) set(CPACK_IFW_COMPONENT_GROUP_TOOLS_PRIORITY 90) - set(CPACK_IFW_COMPONENT_GROUP_TOOLS_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_GROUP_TOOLS_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CMAKE_DISPLAY_NAME "cmake") set(CPACK_COMPONENT_CMAKE_DESCRIPTION @@ -82,7 +77,8 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_CMAKE_GROUP Tools) set(CPACK_IFW_COMPONENT_CMAKE_NAME "CMake") set(CPACK_IFW_COMPONENT_CMAKE_PRIORITY 89) - set(CPACK_IFW_COMPONENT_CMAKE_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CMAKE_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CTEST_DISPLAY_NAME "ctest") set(CPACK_COMPONENT_CTEST_DESCRIPTION @@ -91,7 +87,8 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_CTEST_GROUP Tools) set(CPACK_IFW_COMPONENT_CTEST_NAME "CTest") set(CPACK_IFW_COMPONENT_CTEST_PRIORITY 88) - set(CPACK_IFW_COMPONENT_CTEST_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CTEST_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CPACK_DISPLAY_NAME "cpack") set(CPACK_COMPONENT_CPACK_DESCRIPTION @@ -100,7 +97,8 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_CPACK_GROUP Tools) set(CPACK_IFW_COMPONENT_CPACK_NAME "CPack") set(CPACK_IFW_COMPONENT_CPACK_PRIORITY 87) - set(CPACK_IFW_COMPONENT_CPACK_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CPACK_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CMCLDEPS_DISPLAY_NAME "cmcldeps") set(CPACK_COMPONENT_CMCLDEPS_DESCRIPTION @@ -108,7 +106,8 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_CMCLDEPS_GROUP Tools) set(CPACK_IFW_COMPONENT_CMCLDEPS_NAME "CMClDeps") set(CPACK_IFW_COMPONENT_CMCLDEPS_PRIORITY 86) - set(CPACK_IFW_COMPONENT_CMCLDEPS_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CMCLDEPS_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CMAKEXBUILD_DISPLAY_NAME "cmakexbuild") set(CPACK_COMPONENT_CMAKEXBUILD_DESCRIPTION @@ -117,7 +116,8 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_CMAKEXBUILD_GROUP Tools) set(CPACK_IFW_COMPONENT_CMAKEXBUILD_NAME "CMakeXBuild") set(CPACK_IFW_COMPONENT_CMAKEXBUILD_PRIORITY 85) - set(CPACK_IFW_COMPONENT_CMAKEXBUILD_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CMAKEXBUILD_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") # Dialogs set(CPACK_COMPONENT_GROUP_DIALOGS_DISPLAY_NAME "Interactive Dialogs") @@ -125,20 +125,23 @@ if(CPACK_GENERATOR MATCHES "IFW") "Interactive Dialogs with Console and GUI interfaces") set(CPACK_COMPONENT_GROUP_DIALOGS_PARENT_GROUP CMake) set(CPACK_IFW_COMPONENT_GROUP_DIALOGS_PRIORITY 80) - set(CPACK_IFW_COMPONENT_GROUP_DIALOGS_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_GROUP_DIALOGS_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CMAKE-GUI_DISPLAY_NAME "cmake-gui") set(CPACK_COMPONENT_CMAKE-GUI_GROUP Dialogs) set(CPACK_IFW_COMPONENT_CMAKE-GUI_NAME "QtGUI") set(CPACK_IFW_COMPONENT_CMAKE-GUI_SCRIPT "@CMake_SOURCE_DIR@/Source/QtIFW/CMake.Dialogs.QtGUI.qs") - set(CPACK_IFW_COMPONENT_CMAKE-GUI_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CMAKE-GUI_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") @_CPACK_IFW_COMPONENT_CMAKE-GUI_LICENSES@ set(CPACK_COMPONENT_CCMAKE_DISPLAY_NAME "ccmake") set(CPACK_COMPONENT_CCMAKE_GROUP Dialogs) set(CPACK_IFW_COMPONENT_CCMAKE_NAME "CursesGUI") - set(CPACK_IFW_COMPONENT_CCMAKE_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CCMAKE_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") # Documentation set(CPACK_COMPONENT_GROUP_DOCUMENTATION_DISPLAY_NAME "Documentation") @@ -147,33 +150,36 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_GROUP_DOCUMENTATION_PARENT_GROUP CMake) set(CPACK_IFW_COMPONENT_GROUP_DOCUMENTATION_PRIORITY 60) set(CPACK_IFW_COMPONENT_GROUP_DOCUMENTATION_VERSION - "@_CPACK_IFW_PACKAGE_VERSION@") + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_SPHINX-MAN_DISPLAY_NAME "man") set(CPACK_COMPONENT_SPHINX-MAN_GROUP Documentation) set(CPACK_COMPONENT_SPHINX-MAN_DISABLED TRUE) set(CPACK_IFW_COMPONENT_SPHINX-MAN_NAME "SphinxMan") - set(CPACK_IFW_COMPONENT_SPHINX-MAN_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_SPHINX-MAN_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_SPHINX-HTML_DISPLAY_NAME "HTML") set(CPACK_COMPONENT_SPHINX-HTML_GROUP Documentation) set(CPACK_IFW_COMPONENT_SPHINX-HTML_NAME "SphinxHTML") set(CPACK_IFW_COMPONENT_SPHINX-HTML_SCRIPT "@CMake_BINARY_DIR@/CMake.Documentation.SphinxHTML.qs") - set(CPACK_IFW_COMPONENT_SPHINX-HTML_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_SPHINX-HTML_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_SPHINX-SINGLEHTML_DISPLAY_NAME "Single HTML") set(CPACK_COMPONENT_SPHINX-SINGLEHTML_GROUP Documentation) set(CPACK_COMPONENT_SPHINX-SINGLEHTML_DISABLED TRUE) set(CPACK_IFW_COMPONENT_SPHINX-SINGLEHTML_NAME "SphinxSingleHTML") set(CPACK_IFW_COMPONENT_SPHINX-SINGLEHTML_VERSION - "@_CPACK_IFW_PACKAGE_VERSION@") + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_SPHINX-QTHELP_DISPLAY_NAME "Qt Compressed Help") set(CPACK_COMPONENT_SPHINX-QTHELP_GROUP Documentation) set(CPACK_COMPONENT_SPHINX-QTHELP_DISABLED TRUE) set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_NAME "SphinxQtHelp") - set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_SPHINX-QTHELP_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") # Developer Reference set(CPACK_COMPONENT_GROUP_DEVELOPERREFERENCE_DISPLAY_NAME "Developer Reference") @@ -182,7 +188,7 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_COMPONENT_GROUP_DEVELOPERREFERENCE_PARENT_GROUP CMake) set(CPACK_IFW_COMPONENT_GROUP_DEVELOPERREFERENCE_PRIORITY 50) set(CPACK_IFW_COMPONENT_GROUP_DEVELOPERREFERENCE_VERSION - "@_CPACK_IFW_PACKAGE_VERSION@") + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_DISPLAY_NAME "HTML") set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_GROUP DeveloperReference) @@ -190,13 +196,15 @@ if(CPACK_GENERATOR MATCHES "IFW") set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_NAME "HTML") set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_SCRIPT "@CMake_BINARY_DIR@/CMake.DeveloperReference.HTML.qs") - set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-HTML_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_DISPLAY_NAME "Qt Compressed Help") set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_GROUP DeveloperReference) set(CPACK_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_DISABLED TRUE) set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_NAME "QtHelp") - set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_VERSION "@_CPACK_IFW_PACKAGE_VERSION@") + set(CPACK_IFW_COMPONENT_CMAKE-DEVELOPER-REFERENCE-QTHELP_VERSION + "@CMake_IFW_ROOT_COMPONENT_VERSION@") endif() diff --git a/Help/generator/Visual Studio 15.rst b/Help/generator/Visual Studio 15 2017.rst index 2eb9052..a88f8bc 100644 --- a/Help/generator/Visual Studio 15.rst +++ b/Help/generator/Visual Studio 15 2017.rst @@ -1,7 +1,7 @@ -Visual Studio 15 ----------------- +Visual Studio 15 2017 +--------------------- -Generates Visual Studio 15 project files. +Generates Visual Studio 15 (VS 2017) project files. The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set to specify a target platform name (architecture). @@ -9,16 +9,16 @@ to specify a target platform name (architecture). For compatibility with CMake versions prior to 3.1, one may specify a target platform name optionally at the end of this generator name: -``Visual Studio 15 Win64`` +``Visual Studio 15 2017 Win64`` Specify target platform ``x64``. -``Visual Studio 15 ARM`` +``Visual Studio 15 2017 ARM`` Specify target platform ``ARM``. Toolset Selection ^^^^^^^^^^^^^^^^^ -The ``v141`` toolset that comes with Visual Studio 15 is selected by +The ``v141`` toolset that comes with Visual Studio 15 2017 is selected by default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps via the :manual:`cmake(1)` ``-T`` option, to specify another toolset. diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst index 3df3a81..a37c65b 100644 --- a/Help/manual/cmake-generators.7.rst +++ b/Help/manual/cmake-generators.7.rst @@ -82,7 +82,7 @@ Visual Studio Generators /generator/Visual Studio 11 2012 /generator/Visual Studio 12 2013 /generator/Visual Studio 14 2015 - /generator/Visual Studio 15 + /generator/Visual Studio 15 2017 Other Generators ^^^^^^^^^^^^^^^^ diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 5da00ed..e55524c 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -269,6 +269,7 @@ Properties on Targets /prop_tgt/VERSION /prop_tgt/VISIBILITY_INLINES_HIDDEN /prop_tgt/VS_CONFIGURATION_TYPE + /prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY /prop_tgt/VS_DESKTOP_EXTENSIONS_VERSION /prop_tgt/VS_DOTNET_REFERENCES /prop_tgt/VS_DOTNET_TARGET_FRAMEWORK_VERSION @@ -285,6 +286,7 @@ Properties on Targets /prop_tgt/VS_SCC_PROJECTNAME /prop_tgt/VS_SCC_PROVIDER /prop_tgt/VS_SDK_REFERENCES + /prop_tgt/VS_USER_PROPS_CXX /prop_tgt/VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION /prop_tgt/VS_WINRT_COMPONENT /prop_tgt/VS_WINRT_EXTENSIONS diff --git a/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst new file mode 100644 index 0000000..0af85cb --- /dev/null +++ b/Help/prop_tgt/VS_DEBUGGER_WORKING_DIRECTORY.rst @@ -0,0 +1,6 @@ +VS_DEBUGGER_WORKING_DIRECTORY +----------------------------- + +Sets the local debugger working directory for Visual Studio C++ targets. +This is defined in ``<LocalDebuggerWorkingDirectory>`` in the Visual Studio +project file. diff --git a/Help/prop_tgt/VS_USER_PROPS_CXX.rst b/Help/prop_tgt/VS_USER_PROPS_CXX.rst new file mode 100644 index 0000000..083ce03 --- /dev/null +++ b/Help/prop_tgt/VS_USER_PROPS_CXX.rst @@ -0,0 +1,12 @@ +VS_USER_PROPS_CXX +----------------- + +Sets the user props file to be included in the visual studio +C++ project file. The standard path is +``$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props``, which is +in most cases the same as +``%LOCALAPPDATA%\\Microsoft\\MSBuild\\v4.0\\Microsoft.Cpp.Win32.user.props`` +or ``%LOCALAPPDATA%\\Microsoft\\MSBuild\\v4.0\\Microsoft.Cpp.x64.user.props``. + +The ``*.user.props`` files can be used for Visual Studio wide +configuration which is independent from cmake. diff --git a/Help/release/3.7.rst b/Help/release/3.7.rst index 3b8ade6..4c51af4 100644 --- a/Help/release/3.7.rst +++ b/Help/release/3.7.rst @@ -31,9 +31,9 @@ Generators This is equivalent to ``cd sub/dir; make {test,install,package}`` with :ref:`Makefile Generators`. -* The :generator:`Visual Studio 15` generator was added. This is - experimental and based on Preview 5 because this version of VS - has not been released. +* The :generator:`Visual Studio 15 2017` generator was added. This is + experimental and based on "Visual Studio 2017 RC" because this version + of VS has not been released. * :ref:`Visual Studio Generators` for VS 2010 and above learned to place ``.natvis`` source files into VS project files properly. diff --git a/Help/release/dev/cpack-ifw-options.rst b/Help/release/dev/cpack-ifw-options.rst new file mode 100644 index 0000000..cbe0f63 --- /dev/null +++ b/Help/release/dev/cpack-ifw-options.rst @@ -0,0 +1,7 @@ +cpack-ifw-options +----------------- + +* The :module:`CPackIFW` module :command:`cpack_ifw_configure_component` and + :command:`cpack_ifw_configure_component_group` commands gained a new + ``DEFAULT``, ``VIRTUAL``, ``FORCED_INSTALLATION``, ``DISPLAY_NAME``, + ``DESCRIPTION`` and ``RELEASE_DATE`` options to more specific configuration. diff --git a/Help/release/dev/vs-custom-msbuild-props.rst b/Help/release/dev/vs-custom-msbuild-props.rst new file mode 100644 index 0000000..15a5b0a --- /dev/null +++ b/Help/release/dev/vs-custom-msbuild-props.rst @@ -0,0 +1,9 @@ +vs-custom-msbuild-props +----------------------- + +* The :ref:`Visual Studio Generators` for VS 2010 and above can + now be fine tuned using custom msbuild .props files. + :prop_tgt:`VS_USER_PROPS_CXX` can be + used to change the default path of the user .props file from + ``$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props`` to + an arbitrary filename. diff --git a/Help/release/dev/vs-debugger-config.rst b/Help/release/dev/vs-debugger-config.rst new file mode 100644 index 0000000..58873a5 --- /dev/null +++ b/Help/release/dev/vs-debugger-config.rst @@ -0,0 +1,6 @@ +vs-debugger-configuration +------------------------- + +* For the :ref:`Visual Studio Generators` for VS 2010 and above + the working directory for debugging can be set using a new + :prop_tgt:`VS_DEBUGGER_WORKING_DIRECTORY` target property. diff --git a/Modules/CMakeGraphVizOptions.cmake b/Modules/CMakeGraphVizOptions.cmake index e7c4de6..420e3a9 100644 --- a/Modules/CMakeGraphVizOptions.cmake +++ b/Modules/CMakeGraphVizOptions.cmake @@ -13,8 +13,8 @@ # CMake # can generate graphviz files, showing the dependencies between the # targets in a project and also external libraries which are linked -# against. When CMake is run with the --graphviz=foo option, it will -# produce +# against. When CMake is run with the --graphviz=foo.dot option, it will +# produce: # # * a foo.dot file showing all dependencies in the project # * a foo.dot.<target> file for each target, file showing on which other targets the respective target depends @@ -29,11 +29,18 @@ # # .. variable:: GRAPHVIZ_GRAPH_TYPE # -# The graph type +# The graph type. # # * Mandatory : NO # * Default : "digraph" # +# Valid graph types are: +# +# * "graph" : Nodes are joined with lines +# * "digraph" : Nodes are joined with arrows showing direction +# * "strict graph" : Like "graph" but max one line between each node +# * "strict digraph" : Like "graph" but max one line between each node in each direction +# # .. variable:: GRAPHVIZ_GRAPH_NAME # # The graph name. diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 08078cb..d0d24ba 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -198,13 +198,18 @@ # # :: # -# cpack_ifw_configure_component(<compname> [COMMON] [ESSENTIAL] +# cpack_ifw_configure_component(<compname> [COMMON] [ESSENTIAL] [VIRTUAL] +# [FORCED_INSTALLATION] # [NAME <name>] +# [DISPLAY_NAME <display_name>] +# [DESCRIPTION <description>] # [VERSION <version>] +# [RELEASE_DATE <release_date>] # [SCRIPT <script>] # [PRIORITY <priority>] # [DEPENDS <com_id> ...] # [LICENSES <display_name> <file_path> ...] +# [DEFAULT <value>] # [USER_INTERFACES <file_path> <file_path> ...]) # # This command should be called after :command:`cpack_add_component` command. @@ -217,14 +222,35 @@ # if set, then the package manager stays disabled until that # component is updated. # +# ``VIRTUAL`` +# if set, then the component will be hidden from the installer. +# It is a equivalent of the ``HIDDEN`` option from the +# :command:`cpack_add_component` command. +# +# ``FORCED_INSTALLATION`` +# if set, then the component must always be installed. +# It is a equivalent of the ``REQUARED`` option from the +# :command:`cpack_add_component` command. +# # ``NAME`` # is used to create domain-like identification for this component. # By default used origin component name. # +# ``DISPLAY_NAME`` +# set to rewrite original name configured by +# :command:`cpack_add_component` command. +# +# ``DESCRIPTION`` +# set to rewrite original description configured by +# :command:`cpack_add_component` command. +# # ``VERSION`` # is version of component. # By default used :variable:`CPACK_PACKAGE_VERSION`. # +# ``RELEASE_DATE`` +# keep empty to auto generate. +# # ``SCRIPT`` # is a relative or absolute path to operations script # for this component. @@ -239,6 +265,12 @@ # pair of <display_name> and <file_path> of license text for this # component. You can specify more then one license. # +# ``DEFAULT`` +# Possible values are: TRUE, FALSE, and SCRIPT. +# Set to FALSE to disable the component in the installer or to SCRIPT +# to resolved during runtime (don't forget add the file of the script +# as a value of the ``SCRIPT`` option). +# # ``USER_INTERFACES`` # a list of <file_path> representing pages to load # @@ -249,25 +281,48 @@ # # :: # -# cpack_ifw_configure_component_group(<groupname> +# cpack_ifw_configure_component_group(<groupname> [VIRTUAL] +# [FORCED_INSTALLATION] # [NAME <name>] +# [DISPLAY_NAME <display_name>] +# [DESCRIPTION <description>] # [VERSION <version>] +# [RELEASE_DATE <release_date>] # [SCRIPT <script>] # [PRIORITY <priority>] # [LICENSES <display_name> <file_path> ...] +# [DEFAULT <value>] # [USER_INTERFACES <file_path> <file_path> ...]) # # This command should be called after :command:`cpack_add_component_group` # command. # +# ``VIRTUAL`` +# if set, then the group will be hidden from the installer. +# Note that setting this on a root component does not work. +# +# ``FORCED_INSTALLATION`` +# if set, then the group must always be installed. +# # ``NAME`` # is used to create domain-like identification for this component group. # By default used origin component group name. # +# ``DISPLAY_NAME`` +# set to rewrite original name configured by +# :command:`cpack_add_component_group` command. +# +# ``DESCRIPTION`` +# set to rewrite original description configured by +# :command:`cpack_add_component_group` command. +# # ``VERSION`` # is version of component group. # By default used :variable:`CPACK_PACKAGE_VERSION`. # +# ``RELEASE_DATE`` +# keep empty to auto generate. +# # ``SCRIPT`` # is a relative or absolute path to operations script # for this component group. @@ -279,6 +334,13 @@ # pair of <display_name> and <file_path> of license text for this # component group. You can specify more then one license. # +# ``DEFAULT`` +# Possible values are: TRUE, FALSE, and SCRIPT. +# Set to TRUE to preselect the group in the installer +# (this takes effect only on groups that have no visible child components) +# or to SCRIPT to resolved during runtime (don't forget add the file of +# the script as a value of the ``SCRIPT`` option). +# # ``USER_INTERFACES`` # a list of <file_path> representing pages to load # @@ -625,8 +687,8 @@ macro(cpack_ifw_configure_component compname) string(TOUPPER ${compname} _CPACK_IFWCOMP_UNAME) - set(_IFW_OPT COMMON ESSENTIAL) - set(_IFW_ARGS NAME VERSION SCRIPT PRIORITY) + set(_IFW_OPT COMMON ESSENTIAL VIRTUAL FORCED_INSTALLATION) + set(_IFW_ARGS NAME DISPLAY_NAME DESCRIPTION VERSION RELEASE_DATE SCRIPT PRIORITY DEFAULT) set(_IFW_MULTI_ARGS DEPENDS LICENSES USER_INTERFACES) cmake_parse_arguments(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN}) @@ -665,8 +727,8 @@ macro(cpack_ifw_configure_component_group grpname) string(TOUPPER ${grpname} _CPACK_IFWGRP_UNAME) - set(_IFW_OPT) - set(_IFW_ARGS NAME VERSION SCRIPT PRIORITY) + set(_IFW_OPT VIRTUAL FORCED_INSTALLATION) + set(_IFW_ARGS NAME DISPLAY_NAME DESCRIPTION VERSION RELEASE_DATE SCRIPT PRIORITY DEFAULT) set(_IFW_MULTI_ARGS LICENSES USER_INTERFACES) cmake_parse_arguments(CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN}) diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index 1ebbf29..cd623cf 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -42,16 +42,16 @@ # Use the executable's path as a hint set(_Python_LIBRARY_PATH_HINT) -if(PYTHON_EXECUTABLE) +if(IS_ABSOLUTE "${PYTHON_EXECUTABLE}") if(WIN32) - get_filename_component(_Python_PREFIX ${PYTHON_EXECUTABLE} PATH) + get_filename_component(_Python_PREFIX "${PYTHON_EXECUTABLE}" PATH) if(_Python_PREFIX) set(_Python_LIBRARY_PATH_HINT ${_Python_PREFIX}/libs) endif() unset(_Python_PREFIX) else() - get_filename_component(_Python_PREFIX ${PYTHON_EXECUTABLE} PATH) - get_filename_component(_Python_PREFIX ${_Python_PREFIX} PATH) + get_filename_component(_Python_PREFIX "${PYTHON_EXECUTABLE}" PATH) + get_filename_component(_Python_PREFIX "${_Python_PREFIX}" PATH) if(_Python_PREFIX) set(_Python_LIBRARY_PATH_HINT ${_Python_PREFIX}/lib) endif() diff --git a/Modules/Platform/Darwin-PGI-C.cmake b/Modules/Platform/Darwin-PGI-C.cmake new file mode 100644 index 0000000..790919b --- /dev/null +++ b/Modules/Platform/Darwin-PGI-C.cmake @@ -0,0 +1,2 @@ +include(Platform/Darwin-PGI) +__darwin_compiler_pgi(C) diff --git a/Modules/Platform/Darwin-PGI-CXX.cmake b/Modules/Platform/Darwin-PGI-CXX.cmake new file mode 100644 index 0000000..ceaed71 --- /dev/null +++ b/Modules/Platform/Darwin-PGI-CXX.cmake @@ -0,0 +1,2 @@ +include(Platform/Darwin-PGI) +__darwin_compiler_pgi(CXX) diff --git a/Modules/Platform/Darwin-PGI-Fortran.cmake b/Modules/Platform/Darwin-PGI-Fortran.cmake new file mode 100644 index 0000000..146807b --- /dev/null +++ b/Modules/Platform/Darwin-PGI-Fortran.cmake @@ -0,0 +1,2 @@ +include(Platform/Darwin-PGI) +__darwin_compiler_pgi(Fortran) diff --git a/Modules/Platform/Darwin-PGI.cmake b/Modules/Platform/Darwin-PGI.cmake new file mode 100644 index 0000000..04479a8 --- /dev/null +++ b/Modules/Platform/Darwin-PGI.cmake @@ -0,0 +1,14 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +# This module is shared by multiple languages; use include blocker. +if(__DARWIN_COMPILER_PGI) + return() +endif() +set(__DARWIN_COMPILER_PGI 1) + +macro(__darwin_compiler_pgi lang) + set(CMAKE_${lang}_OSX_COMPATIBILITY_VERSION_FLAG "-Wl,-compatibility_version,") + set(CMAKE_${lang}_OSX_CURRENT_VERSION_FLAG "-Wl,-current_version,") + set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,-install_name") +endmacro() diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index c5912f8..651f9f1 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -57,7 +57,8 @@ set(SWIG_CXX_EXTENSION "cxx") set(SWIG_EXTRA_LIBRARIES "") -set(SWIG_PYTHON_EXTRA_FILE_EXTENSION "py") +set(SWIG_PYTHON_EXTRA_FILE_EXTENSIONS ".py") +set(SWIG_JAVA_EXTRA_FILE_EXTENSIONS ".java" "JNI.java") # # For given swig module initialize variables associated with it @@ -123,9 +124,9 @@ macro(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile) endif () endif() - foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSION}) + foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSIONS}) set(${outfiles} ${${outfiles}} - "${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}.${it}") + "${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}${it}") endforeach() endmacro() diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index f7e0944..5b381b4 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -440,24 +440,10 @@ set(SRCS cmCreateTestSourceList.h cmDefinePropertyCommand.cxx cmDefinePropertyCommand.h - cmElseCommand.cxx - cmElseCommand.h - cmElseIfCommand.cxx - cmElseIfCommand.h cmEnableLanguageCommand.cxx cmEnableLanguageCommand.h cmEnableTestingCommand.cxx cmEnableTestingCommand.h - cmEndForEachCommand.cxx - cmEndForEachCommand.h - cmEndFunctionCommand.cxx - cmEndFunctionCommand.h - cmEndIfCommand.cxx - cmEndIfCommand.h - cmEndMacroCommand.cxx - cmEndMacroCommand.h - cmEndWhileCommand.cxx - cmEndWhileCommand.h cmExecProgramCommand.cxx cmExecProgramCommand.h cmExecuteProcessCommand.cxx @@ -612,6 +598,8 @@ set(SRCS cmTryCompileCommand.h cmTryRunCommand.cxx cmTryRunCommand.h + cmUnexpectedCommand.cxx + cmUnexpectedCommand.h cmUnsetCommand.cxx cmUnsetCommand.h cmUseMangledMesaCommand.cxx diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 3086639..d5f5724 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 7) -set(CMake_VERSION_PATCH 20161129) +set(CMake_VERSION_PATCH 20161202) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index ba3248f..a6d443b 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -405,7 +405,11 @@ void cmCPackIFWInstaller::GeneratePackageFiles() // Check package group if (const char* option = GetOption("CPACK_IFW_PACKAGE_GROUP")) { package.ConfigureFromGroup(option); - package.ForcedInstallation = "true"; + std::string forcedOption = "CPACK_IFW_COMPONENT_GROUP_" + + cmsys::SystemTools::UpperCase(option) + "_FORCED_INSTALLATION"; + if (!GetOption(forcedOption)) { + package.ForcedInstallation = "true"; + } } else { package.ConfigureFromOptions(); } diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index 4d46120..902c85d 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -109,6 +109,16 @@ bool cmCPackIFWPackage::IsOn(const std::string& op) const return Generator ? Generator->IsOn(op) : false; } +bool cmCPackIFWPackage::IsSetToOff(const std::string& op) const +{ + return Generator ? Generator->IsSetToOff(op) : false; +} + +bool cmCPackIFWPackage::IsSetToEmpty(const std::string& op) const +{ + return Generator ? Generator->IsSetToEmpty(op) : false; +} + bool cmCPackIFWPackage::IsVersionLess(const char* version) { return Generator ? Generator->IsVersionLess(version) : false; @@ -286,7 +296,7 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component) // ForcedInstallation ForcedInstallation = component->IsRequired ? "true" : "false"; - return 1; + return ConfigureFromPrefix(prefix); } int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group) @@ -344,7 +354,7 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group) SortingPriority = option; } - return 1; + return ConfigureFromPrefix(prefix); } int cmCPackIFWPackage::ConfigureFromGroup(const std::string& groupName) @@ -380,6 +390,74 @@ int cmCPackIFWPackage::ConfigureFromGroup(const std::string& groupName) return ConfigureFromGroup(&group); } +// Common options for components and groups +int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) +{ + // Temporary variable for full option name + std::string option; + + // Display name + option = prefix + "DISPLAY_NAME"; + if (IsSetToEmpty(option)) { + DisplayName.clear(); + } else if (const char* value = GetOption(option)) { + DisplayName = value; + } + + // Description + option = prefix + "DESCRIPTION"; + if (IsSetToEmpty(option)) { + Description.clear(); + } else if (const char* value = GetOption(option)) { + Description = value; + } + + // Release date + option = prefix + "RELEASE_DATE"; + if (IsSetToEmpty(option)) { + ReleaseDate.clear(); + } else if (const char* value = GetOption(option)) { + ReleaseDate = value; + } + + // Visibility + option = prefix + "VIRTUAL"; + if (IsSetToEmpty(option)) { + Virtual.clear(); + } else if (IsOn(option)) { + Virtual = "true"; + } + + // Default selection + option = prefix + "DEFAULT"; + if (IsSetToEmpty(option)) { + Default.clear(); + } else if (const char* value = GetOption(option)) { + std::string lowerValue = cmsys::SystemTools::LowerCase(value); + if (lowerValue.compare("true") == 0) { + Default = "true"; + } else if (lowerValue.compare("false") == 0) { + Default = "false"; + } else if (lowerValue.compare("script") == 0) { + Default = "script"; + } else { + Default = value; + } + } + + // Forsed installation + option = prefix + "FORCED_INSTALLATION"; + if (IsSetToEmpty(option)) { + ForcedInstallation.clear(); + } else if (IsOn(option)) { + ForcedInstallation = "true"; + } else if (IsSetToOff(option)) { + ForcedInstallation = "false"; + } + + return 1; +} + void cmCPackIFWPackage::GeneratePackageFile() { // Lazy directory initialization diff --git a/Source/CPack/IFW/cmCPackIFWPackage.h b/Source/CPack/IFW/cmCPackIFWPackage.h index d1af2bd..76ed540 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.h +++ b/Source/CPack/IFW/cmCPackIFWPackage.h @@ -112,6 +112,8 @@ public: const char* GetOption(const std::string& op) const; bool IsOn(const std::string& op) const; + bool IsSetToOff(const std::string& op) const; + bool IsSetToEmpty(const std::string& op) const; bool IsVersionLess(const char* version); bool IsVersionGreater(const char* version); @@ -125,6 +127,7 @@ public: int ConfigureFromComponent(cmCPackComponent* component); int ConfigureFromGroup(cmCPackComponentGroup* group); int ConfigureFromGroup(const std::string& groupName); + int ConfigureFromPrefix(const std::string& prefix); void GeneratePackageFile(); diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 3878a32..21eda79 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -1074,6 +1074,24 @@ bool cmCPackGenerator::IsOn(const std::string& name) const return cmSystemTools::IsOn(GetOption(name)); } +bool cmCPackGenerator::IsSetToOff(const std::string& op) const +{ + const char* ret = this->MakefileMap->GetDefinition(op); + if (ret && *ret) { + return cmSystemTools::IsOff(ret); + } + return false; +} + +bool cmCPackGenerator::IsSetToEmpty(const std::string& op) const +{ + const char* ret = this->MakefileMap->GetDefinition(op); + if (ret) { + return !*ret; + } + return false; +} + const char* cmCPackGenerator::GetOption(const std::string& op) const { const char* ret = this->MakefileMap->GetDefinition(op); diff --git a/Source/CPack/cmCPackGenerator.h b/Source/CPack/cmCPackGenerator.h index b43bf8a..10a5a36 100644 --- a/Source/CPack/cmCPackGenerator.h +++ b/Source/CPack/cmCPackGenerator.h @@ -92,6 +92,8 @@ public: std::vector<std::string> GetOptions() const; bool IsSet(const std::string& name) const; bool IsOn(const std::string& name) const; + bool IsSetToOff(const std::string& op) const; + bool IsSetToEmpty(const std::string& op) const; //! Set the logger void SetLogger(cmCPackLog* log) { this->Logger = log; } diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index 103e72c..4c5b093 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -18,14 +18,8 @@ #include "cmContinueCommand.h" #include "cmCreateTestSourceList.h" #include "cmDefinePropertyCommand.h" -#include "cmElseCommand.h" #include "cmEnableLanguageCommand.h" #include "cmEnableTestingCommand.h" -#include "cmEndForEachCommand.h" -#include "cmEndFunctionCommand.h" -#include "cmEndIfCommand.h" -#include "cmEndMacroCommand.h" -#include "cmEndWhileCommand.h" #include "cmExecProgramCommand.h" #include "cmExecuteProcessCommand.h" #include "cmFileCommand.h" @@ -74,6 +68,7 @@ #include "cmTargetLinkLibrariesCommand.h" #include "cmTryCompileCommand.h" #include "cmTryRunCommand.h" +#include "cmUnexpectedCommand.h" #include "cmUnsetCommand.h" #include "cmWhileCommand.h" @@ -82,7 +77,6 @@ #include "cmAuxSourceDirectoryCommand.h" #include "cmBuildNameCommand.h" #include "cmCMakeHostSystemInformationCommand.h" -#include "cmElseIfCommand.h" #include "cmExportCommand.h" #include "cmExportLibraryDependenciesCommand.h" #include "cmFLTKWrapUICommand.h" @@ -130,14 +124,8 @@ std::vector<cmCommand*> GetPredefinedCommands() commands.push_back(new cmContinueCommand); commands.push_back(new cmCreateTestSourceList); commands.push_back(new cmDefinePropertyCommand); - commands.push_back(new cmElseCommand); commands.push_back(new cmEnableLanguageCommand); commands.push_back(new cmEnableTestingCommand); - commands.push_back(new cmEndForEachCommand); - commands.push_back(new cmEndFunctionCommand); - commands.push_back(new cmEndIfCommand); - commands.push_back(new cmEndMacroCommand); - commands.push_back(new cmEndWhileCommand); commands.push_back(new cmExecProgramCommand); commands.push_back(new cmExecuteProcessCommand); commands.push_back(new cmFileCommand); @@ -189,12 +177,39 @@ std::vector<cmCommand*> GetPredefinedCommands() commands.push_back(new cmUnsetCommand); commands.push_back(new cmWhileCommand); + commands.push_back(new cmUnexpectedCommand( + "else", "An ELSE command was found outside of a proper " + "IF ENDIF structure. Or its arguments did not match " + "the opening IF command.")); + commands.push_back(new cmUnexpectedCommand( + "elseif", "An ELSEIF command was found outside of a proper " + "IF ENDIF structure.")); + commands.push_back(new cmUnexpectedCommand( + "endforeach", "An ENDFOREACH command was found outside of a proper " + "FOREACH ENDFOREACH structure. Or its arguments did " + "not match the opening FOREACH command.")); + commands.push_back(new cmUnexpectedCommand( + "endfunction", "An ENDFUNCTION command was found outside of a proper " + "FUNCTION ENDFUNCTION structure. Or its arguments did not " + "match the opening FUNCTION command.")); + commands.push_back(new cmUnexpectedCommand( + "endif", "An ENDIF command was found outside of a proper " + "IF ENDIF structure. Or its arguments did not match " + "the opening IF command.")); + commands.push_back(new cmUnexpectedCommand( + "endmacro", "An ENDMACRO command was found outside of a proper " + "MACRO ENDMACRO structure. Or its arguments did not " + "match the opening MACRO command.")); + commands.push_back(new cmUnexpectedCommand( + "endwhile", "An ENDWHILE command was found outside of a proper " + "WHILE ENDWHILE structure. Or its arguments did not " + "match the opening WHILE command.")); + #if defined(CMAKE_BUILD_WITH_CMAKE) commands.push_back(new cmAddCompileOptionsCommand); commands.push_back(new cmAuxSourceDirectoryCommand); commands.push_back(new cmBuildNameCommand); commands.push_back(new cmCMakeHostSystemInformationCommand); - commands.push_back(new cmElseIfCommand); commands.push_back(new cmExportCommand); commands.push_back(new cmExportLibraryDependenciesCommand); commands.push_back(new cmFLTKWrapUICommand); diff --git a/Source/cmElseCommand.cxx b/Source/cmElseCommand.cxx deleted file mode 100644 index 207777e..0000000 --- a/Source/cmElseCommand.cxx +++ /dev/null @@ -1,14 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmElseCommand.h" - -class cmExecutionStatus; - -bool cmElseCommand::InitialPass(std::vector<std::string> const&, - cmExecutionStatus&) -{ - this->SetError("An ELSE command was found outside of a proper " - "IF ENDIF structure. Or its arguments did not match " - "the opening IF command."); - return false; -} diff --git a/Source/cmElseCommand.h b/Source/cmElseCommand.h deleted file mode 100644 index c0162ad..0000000 --- a/Source/cmElseCommand.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmElseCommand_h -#define cmElseCommand_h - -#include <cmConfigure.h> -#include <string> -#include <vector> - -#include "cmCommand.h" - -class cmExecutionStatus; - -/** \class cmElseCommand - * \brief ends an if block - * - * cmElseCommand ends an if block - */ -class cmElseCommand : public cmCommand -{ -public: - /** - * This is a virtual constructor for the command. - */ - cmCommand* Clone() CM_OVERRIDE { return new cmElseCommand; } - - /** - * This is called when the command is first encountered in - * the CMakeLists.txt file. - */ - bool InitialPass(std::vector<std::string> const& args, - cmExecutionStatus& status) CM_OVERRIDE; - - /** - * This determines if the command is invoked when in script mode. - */ - bool IsScriptable() const CM_OVERRIDE { return true; } - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "else"; } -}; - -#endif diff --git a/Source/cmElseIfCommand.cxx b/Source/cmElseIfCommand.cxx deleted file mode 100644 index 1c32248..0000000 --- a/Source/cmElseIfCommand.cxx +++ /dev/null @@ -1,13 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmElseIfCommand.h" - -class cmExecutionStatus; - -bool cmElseIfCommand::InitialPass(std::vector<std::string> const&, - cmExecutionStatus&) -{ - this->SetError("An ELSEIF command was found outside of a proper " - "IF ENDIF structure."); - return false; -} diff --git a/Source/cmElseIfCommand.h b/Source/cmElseIfCommand.h deleted file mode 100644 index 3f1ddde..0000000 --- a/Source/cmElseIfCommand.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmElseIfCommand_h -#define cmElseIfCommand_h - -#include <cmConfigure.h> -#include <string> -#include <vector> - -#include "cmCommand.h" - -class cmExecutionStatus; - -/** \class cmElseIfCommand - * \brief ends an if block - * - * cmElseIfCommand ends an if block - */ -class cmElseIfCommand : public cmCommand -{ -public: - /** - * This is a virtual constructor for the command. - */ - cmCommand* Clone() CM_OVERRIDE { return new cmElseIfCommand; } - - /** - * This is called when the command is first encountered in - * the CMakeLists.txt file. - */ - bool InitialPass(std::vector<std::string> const& args, - cmExecutionStatus& status) CM_OVERRIDE; - - /** - * This determines if the command is invoked when in script mode. - */ - bool IsScriptable() const CM_OVERRIDE { return true; } - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "elseif"; } -}; - -#endif diff --git a/Source/cmEndForEachCommand.cxx b/Source/cmEndForEachCommand.cxx deleted file mode 100644 index fe6a7f3..0000000 --- a/Source/cmEndForEachCommand.cxx +++ /dev/null @@ -1,15 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmEndForEachCommand.h" - -class cmExecutionStatus; -struct cmListFileArgument; - -bool cmEndForEachCommand::InvokeInitialPass( - std::vector<cmListFileArgument> const&, cmExecutionStatus&) -{ - this->SetError("An ENDFOREACH command was found outside of a proper " - "FOREACH ENDFOREACH structure. Or its arguments did " - "not match the opening FOREACH command."); - return false; -} diff --git a/Source/cmEndForEachCommand.h b/Source/cmEndForEachCommand.h deleted file mode 100644 index 772a139..0000000 --- a/Source/cmEndForEachCommand.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmEndForEachCommand_h -#define cmEndForEachCommand_h - -#include <cmConfigure.h> -#include <string> -#include <vector> - -#include "cmCommand.h" - -class cmExecutionStatus; -struct cmListFileArgument; - -/** \class cmEndForEachCommand - * \brief ends an if block - * - * cmEndForEachCommand ends an if block - */ -class cmEndForEachCommand : public cmCommand -{ -public: - /** - * This is a virtual constructor for the command. - */ - cmCommand* Clone() CM_OVERRIDE { return new cmEndForEachCommand; } - - /** - * Override cmCommand::InvokeInitialPass to get arguments before - * expansion. - */ - bool InvokeInitialPass(std::vector<cmListFileArgument> const&, - cmExecutionStatus&) CM_OVERRIDE; - - /** - * This is called when the command is first encountered in - * the CMakeLists.txt file. - */ - bool InitialPass(std::vector<std::string> const&, - cmExecutionStatus&) CM_OVERRIDE - { - return false; - } - - /** - * This determines if the command is invoked when in script mode. - */ - bool IsScriptable() const CM_OVERRIDE { return true; } - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "endforeach"; } -}; - -#endif diff --git a/Source/cmEndFunctionCommand.cxx b/Source/cmEndFunctionCommand.cxx deleted file mode 100644 index 6adb42b..0000000 --- a/Source/cmEndFunctionCommand.cxx +++ /dev/null @@ -1,15 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmEndFunctionCommand.h" - -class cmExecutionStatus; -struct cmListFileArgument; - -bool cmEndFunctionCommand::InvokeInitialPass( - std::vector<cmListFileArgument> const&, cmExecutionStatus&) -{ - this->SetError("An ENDFUNCTION command was found outside of a proper " - "FUNCTION ENDFUNCTION structure. Or its arguments did not " - "match the opening FUNCTION command."); - return false; -} diff --git a/Source/cmEndFunctionCommand.h b/Source/cmEndFunctionCommand.h deleted file mode 100644 index 2599637..0000000 --- a/Source/cmEndFunctionCommand.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmEndFunctionCommand_h -#define cmEndFunctionCommand_h - -#include <cmConfigure.h> -#include <string> -#include <vector> - -#include "cmCommand.h" - -class cmExecutionStatus; -struct cmListFileArgument; - -/** \class cmEndFunctionCommand - * \brief ends an if block - * - * cmEndFunctionCommand ends an if block - */ -class cmEndFunctionCommand : public cmCommand -{ -public: - /** - * This is a virtual constructor for the command. - */ - cmCommand* Clone() CM_OVERRIDE { return new cmEndFunctionCommand; } - - /** - * Override cmCommand::InvokeInitialPass to get arguments before - * expansion. - */ - bool InvokeInitialPass(std::vector<cmListFileArgument> const&, - cmExecutionStatus&) CM_OVERRIDE; - - /** - * This is called when the command is first encountered in - * the CMakeLists.txt file. - */ - bool InitialPass(std::vector<std::string> const&, - cmExecutionStatus&) CM_OVERRIDE - { - return false; - } - - /** - * This determines if the command is invoked when in script mode. - */ - bool IsScriptable() const CM_OVERRIDE { return true; } - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "endfunction"; } -}; - -#endif diff --git a/Source/cmEndIfCommand.cxx b/Source/cmEndIfCommand.cxx deleted file mode 100644 index 50c2b42..0000000 --- a/Source/cmEndIfCommand.cxx +++ /dev/null @@ -1,24 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmEndIfCommand.h" - -#include <stdlib.h> // required for atof - -#include "cmMakefile.h" - -class cmExecutionStatus; - -bool cmEndIfCommand::InitialPass(std::vector<std::string> const&, - cmExecutionStatus&) -{ - const char* versionValue = - this->Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION"); - if (!versionValue || (atof(versionValue) <= 1.4)) { - return true; - } - - this->SetError("An ENDIF command was found outside of a proper " - "IF ENDIF structure. Or its arguments did not match " - "the opening IF command."); - return false; -} diff --git a/Source/cmEndIfCommand.h b/Source/cmEndIfCommand.h deleted file mode 100644 index dfd6049..0000000 --- a/Source/cmEndIfCommand.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmEndIfCommand_h -#define cmEndIfCommand_h - -#include <cmConfigure.h> -#include <string> -#include <vector> - -#include "cmCommand.h" - -class cmExecutionStatus; - -/** \class cmEndIfCommand - * \brief ends an if block - * - * cmEndIfCommand ends an if block - */ -class cmEndIfCommand : public cmCommand -{ -public: - /** - * This is a virtual constructor for the command. - */ - cmCommand* Clone() CM_OVERRIDE { return new cmEndIfCommand; } - - /** - * This is called when the command is first encountered in - * the CMakeLists.txt file. - */ - bool InitialPass(std::vector<std::string> const& args, - cmExecutionStatus& status) CM_OVERRIDE; - - /** - * This determines if the command is invoked when in script mode. - */ - bool IsScriptable() const CM_OVERRIDE { return true; } - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "endif"; } -}; - -#endif diff --git a/Source/cmEndMacroCommand.cxx b/Source/cmEndMacroCommand.cxx deleted file mode 100644 index 046b0af..0000000 --- a/Source/cmEndMacroCommand.cxx +++ /dev/null @@ -1,15 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmEndMacroCommand.h" - -class cmExecutionStatus; -struct cmListFileArgument; - -bool cmEndMacroCommand::InvokeInitialPass( - std::vector<cmListFileArgument> const&, cmExecutionStatus&) -{ - this->SetError("An ENDMACRO command was found outside of a proper " - "MACRO ENDMACRO structure. Or its arguments did not " - "match the opening MACRO command."); - return false; -} diff --git a/Source/cmEndMacroCommand.h b/Source/cmEndMacroCommand.h deleted file mode 100644 index 3c462d4..0000000 --- a/Source/cmEndMacroCommand.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmEndMacroCommand_h -#define cmEndMacroCommand_h - -#include <cmConfigure.h> -#include <string> -#include <vector> - -#include "cmCommand.h" - -class cmExecutionStatus; -struct cmListFileArgument; - -/** \class cmEndMacroCommand - * \brief ends an if block - * - * cmEndMacroCommand ends an if block - */ -class cmEndMacroCommand : public cmCommand -{ -public: - /** - * This is a virtual constructor for the command. - */ - cmCommand* Clone() CM_OVERRIDE { return new cmEndMacroCommand; } - - /** - * Override cmCommand::InvokeInitialPass to get arguments before - * expansion. - */ - bool InvokeInitialPass(std::vector<cmListFileArgument> const&, - cmExecutionStatus&) CM_OVERRIDE; - - /** - * This is called when the command is first encountered in - * the CMakeLists.txt file. - */ - bool InitialPass(std::vector<std::string> const&, - cmExecutionStatus&) CM_OVERRIDE - { - return false; - } - - /** - * This determines if the command is invoked when in script mode. - */ - bool IsScriptable() const CM_OVERRIDE { return true; } - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "endmacro"; } -}; - -#endif diff --git a/Source/cmEndWhileCommand.cxx b/Source/cmEndWhileCommand.cxx deleted file mode 100644 index 5623f33..0000000 --- a/Source/cmEndWhileCommand.cxx +++ /dev/null @@ -1,22 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#include "cmEndWhileCommand.h" - -#include "cmListFileCache.h" - -class cmExecutionStatus; - -bool cmEndWhileCommand::InvokeInitialPass( - std::vector<cmListFileArgument> const& args, cmExecutionStatus&) -{ - if (args.empty()) { - this->SetError("An ENDWHILE command was found outside of a proper " - "WHILE ENDWHILE structure."); - } else { - this->SetError("An ENDWHILE command was found outside of a proper " - "WHILE ENDWHILE structure. Or its arguments did not " - "match the opening WHILE command."); - } - - return false; -} diff --git a/Source/cmEndWhileCommand.h b/Source/cmEndWhileCommand.h deleted file mode 100644 index d4e97b4..0000000 --- a/Source/cmEndWhileCommand.h +++ /dev/null @@ -1,56 +0,0 @@ -/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying - file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmEndWhileCommand_h -#define cmEndWhileCommand_h - -#include <cmConfigure.h> -#include <string> -#include <vector> - -#include "cmCommand.h" - -class cmExecutionStatus; -struct cmListFileArgument; - -/** \class cmEndWhileCommand - * \brief ends a while loop - * - * cmEndWhileCommand ends a while loop - */ -class cmEndWhileCommand : public cmCommand -{ -public: - /** - * This is a virtual constructor for the command. - */ - cmCommand* Clone() CM_OVERRIDE { return new cmEndWhileCommand; } - - /** - * Override cmCommand::InvokeInitialPass to get arguments before - * expansion. - */ - bool InvokeInitialPass(std::vector<cmListFileArgument> const& args, - cmExecutionStatus& status) CM_OVERRIDE; - - /** - * This is called when the command is first encountered in - * the CMakeLists.txt file. - */ - bool InitialPass(std::vector<std::string> const&, - cmExecutionStatus&) CM_OVERRIDE - { - return false; - } - - /** - * This determines if the command is invoked when in script mode. - */ - bool IsScriptable() const CM_OVERRIDE { return true; } - - /** - * The name of the command as specified in CMakeList.txt. - */ - std::string GetName() const CM_OVERRIDE { return "endwhile"; } -}; - -#endif diff --git a/Source/cmGlobalVisualStudio15Generator.cxx b/Source/cmGlobalVisualStudio15Generator.cxx index 19b48df..091a03e 100644 --- a/Source/cmGlobalVisualStudio15Generator.cxx +++ b/Source/cmGlobalVisualStudio15Generator.cxx @@ -8,16 +8,19 @@ #include "cmMakefile.h" #include "cmVS141CLFlagTable.h" -static const char vs15generatorName[] = "Visual Studio 15"; +static const char vs15generatorName[] = "Visual Studio 15 2017"; // Map generator name without year to name with year. static const char* cmVS15GenName(const std::string& name, std::string& genName) { if (strncmp(name.c_str(), vs15generatorName, - sizeof(vs15generatorName) - 1) != 0) { + sizeof(vs15generatorName) - 6) != 0) { return 0; } - const char* p = name.c_str() + sizeof(vs15generatorName) - 1; + const char* p = name.c_str() + sizeof(vs15generatorName) - 6; + if (cmHasLiteralPrefix(p, " 2017")) { + p += 5; + } genName = std::string(vs15generatorName) + p; return p; } @@ -52,7 +55,7 @@ public: virtual void GetDocumentation(cmDocumentationEntry& entry) const { entry.Name = std::string(vs15generatorName) + " [arch]"; - entry.Brief = "Generates Visual Studio 15 project files. " + entry.Brief = "Generates Visual Studio 2017 project files. " "Optional [arch] can be \"Win64\" or \"ARM\"."; } diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 2e5173d..6906a90 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -520,8 +520,15 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( targetFullPathCompilePDB = this->GeneratorTarget->GetCompilePDBPath(this->ConfigName); if (targetFullPathCompilePDB.empty()) { + // Match VS default: `$(IntDir)vc$(PlatformToolsetVersion).pdb`. + // A trailing slash tells the toolchain to add its default file name. targetFullPathCompilePDB = this->GeneratorTarget->GetSupportDirectory() + "/"; + if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) { + // Match VS default for static libs: `$(IntDir)$(ProjectName).pdb`. + targetFullPathCompilePDB += this->GeneratorTarget->GetName(); + targetFullPathCompilePDB += ".pdb"; + } } } diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index e47de97..8090542 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -359,7 +359,14 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const compilePdbPath = this->GeneratorTarget->GetCompilePDBPath(this->GetConfigName()); if (compilePdbPath.empty()) { + // Match VS default: `$(IntDir)vc$(PlatformToolsetVersion).pdb`. + // A trailing slash tells the toolchain to add its default file name. compilePdbPath = this->GeneratorTarget->GetSupportDirectory() + "/"; + if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) { + // Match VS default for static libs: `$(IntDir)$(ProjectName).pdb`. + compilePdbPath += this->GeneratorTarget->GetName(); + compilePdbPath += ".pdb"; + } } } diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index 9a06f05..3776538 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -936,7 +936,7 @@ cmServerResponse cmServerProtocol1_0::ProcessConfigure( } // Make sure the types of cacheArguments matches (if given): - std::vector<std::string> cacheArgs; + std::vector<std::string> cacheArgs = { "unused" }; bool cacheArgumentsError = false; const Json::Value passedArgs = request.Data[kCACHE_ARGUMENTS_KEY]; if (!passedArgs.isNull()) { diff --git a/Source/cmUnexpectedCommand.cxx b/Source/cmUnexpectedCommand.cxx new file mode 100644 index 0000000..a8de9e6 --- /dev/null +++ b/Source/cmUnexpectedCommand.cxx @@ -0,0 +1,22 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#include "cmUnexpectedCommand.h" + +#include <stdlib.h> + +#include "cmMakefile.h" + +class cmExecutionStatus; + +bool cmUnexpectedCommand::InitialPass(std::vector<std::string> const&, + cmExecutionStatus&) +{ + const char* versionValue = + this->Makefile->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION"); + if (this->Name == "endif" && (!versionValue || atof(versionValue) <= 1.4)) { + return true; + } + + this->SetError(this->Error); + return false; +} diff --git a/Source/cmUnexpectedCommand.h b/Source/cmUnexpectedCommand.h new file mode 100644 index 0000000..897dfb6 --- /dev/null +++ b/Source/cmUnexpectedCommand.h @@ -0,0 +1,40 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef cmUnexpectedCommand_h +#define cmUnexpectedCommand_h + +#include <cmConfigure.h> +#include <string> +#include <vector> + +#include "cmCommand.h" + +class cmExecutionStatus; + +class cmUnexpectedCommand : public cmCommand +{ +public: + cmUnexpectedCommand(std::string const& name, const char* error) + : Name(name) + , Error(error) + { + } + + cmCommand* Clone() CM_OVERRIDE + { + return new cmUnexpectedCommand(this->Name, this->Error); + } + + bool InitialPass(std::vector<std::string> const& args, + cmExecutionStatus& status) CM_OVERRIDE; + + bool IsScriptable() const CM_OVERRIDE { return true; } + + std::string GetName() const CM_OVERRIDE { return this->Name; } + +private: + std::string Name; + const char* Error; +}; + +#endif diff --git a/Source/cmVS140CLFlagTable.h b/Source/cmVS140CLFlagTable.h index 317cc18..60b4379 100644 --- a/Source/cmVS140CLFlagTable.h +++ b/Source/cmVS140CLFlagTable.h @@ -164,6 +164,8 @@ static cmVS7FlagTable cmVS140CLFlagTable[] = { { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 }, { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 }, { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 }, + { "RemoveUnreferencedCodeData", "Zc:inline-", "", "false", 0 }, + { "RemoveUnreferencedCodeData", "Zc:inline", "", "true", 0 }, { "RuntimeTypeInfo", "GR-", "", "false", 0 }, { "RuntimeTypeInfo", "GR", "", "true", 0 }, { "OpenMPSupport", "openmp-", "", "false", 0 }, diff --git a/Source/cmVS141CLFlagTable.h b/Source/cmVS141CLFlagTable.h index 895b3e8..f751fc8 100644 --- a/Source/cmVS141CLFlagTable.h +++ b/Source/cmVS141CLFlagTable.h @@ -171,6 +171,7 @@ static cmVS7FlagTable cmVS141CLFlagTable[] = { { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 }, { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 }, { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 }, + { "RemoveUnreferencedCodeData", "Zc:inline-", "", "false", 0 }, { "RemoveUnreferencedCodeData", "Zc:inline", "", "true", 0 }, { "EnforceTypeConversionRules", "Zc:rvalueCast-", "", "false", 0 }, { "EnforceTypeConversionRules", "Zc:rvalueCast", "", "true", 0 }, diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 4dabd51..3632663 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -139,7 +139,11 @@ void cmVisualStudio10TargetGenerator::WriteString(const char* line, (*this->BuildFileStream) << line; } -#define VS10_USER_PROPS "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" +#define VS10_CXX_DEFAULT_PROPS "$(VCTargetsPath)\\Microsoft.Cpp.Default.props" +#define VS10_CXX_PROPS "$(VCTargetsPath)\\Microsoft.Cpp.props" +#define VS10_CXX_USER_PROPS \ + "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props" +#define VS10_CXX_TARGETS "$(VCTargetsPath)\\Microsoft.Cpp.targets" void cmVisualStudio10TargetGenerator::Generate() { @@ -345,12 +349,9 @@ void cmVisualStudio10TargetGenerator::Generate() } this->WriteString("</PropertyGroup>\n", 1); - this->WriteString("<Import Project=" - "\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n", - 1); + this->WriteString("<Import Project=\"" VS10_CXX_DEFAULT_PROPS "\" />\n", 1); this->WriteProjectConfigurationValues(); - this->WriteString( - "<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n", 1); + this->WriteString("<Import Project=\"" VS10_CXX_PROPS "\" />\n", 1); this->WriteString("<ImportGroup Label=\"ExtensionSettings\">\n", 1); if (this->GlobalGenerator->IsMasmEnabled()) { this->WriteString("<Import Project=\"$(VCTargetsPath)\\" @@ -359,10 +360,19 @@ void cmVisualStudio10TargetGenerator::Generate() } this->WriteString("</ImportGroup>\n", 1); this->WriteString("<ImportGroup Label=\"PropertySheets\">\n", 1); - this->WriteString("<Import Project=\"" VS10_USER_PROPS "\"" - " Condition=\"exists('" VS10_USER_PROPS "')\"" - " Label=\"LocalAppDataPlatform\" />\n", - 2); + { + std::string props = VS10_CXX_USER_PROPS; + if (const char* p = + this->GeneratorTarget->GetProperty("VS_USER_PROPS_CXX")) { + props = p; + this->ConvertToWindowsSlash(props); + } + this->WriteString("", 2); + (*this->BuildFileStream) + << "<Import Project=\"" << cmVS10EscapeXML(props) << "\"" + << " Condition=\"exists('" << cmVS10EscapeXML(props) << "')\"" + << " Label=\"LocalAppDataPlatform\" />\n"; + } this->WritePlatformExtensions(); this->WriteString("</ImportGroup>\n", 1); this->WriteString("<PropertyGroup Label=\"UserMacros\" />\n", 1); @@ -377,10 +387,8 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteWinRTReferences(); this->WriteProjectReferences(); this->WriteSDKReferences(); - this->WriteString( - "<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\"" - " />\n", - 1); + this->WriteString("<Import Project=\"" VS10_CXX_TARGETS "\" />\n", 1); + this->WriteTargetSpecificReferences(); this->WriteString("<ImportGroup Label=\"ExtensionTargets\">\n", 1); this->WriteTargetsFileReferences(); @@ -1561,6 +1569,14 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() *this->BuildFileStream << cmVS10EscapeXML(intermediateDir) << "</IntDir>\n"; + if (const char* workingDir = this->GeneratorTarget->GetProperty( + "VS_DEBUGGER_WORKING_DIRECTORY")) { + this->WritePlatformConfigTag("LocalDebuggerWorkingDirectory", + config->c_str(), 3); + *this->BuildFileStream << cmVS10EscapeXML(workingDir) + << "</LocalDebuggerWorkingDirectory>\n"; + } + std::string name = cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull); this->WritePlatformConfigTag("TargetName", config->c_str(), 3); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 59290ff..733e0e4 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1457,7 +1457,7 @@ void cmake::CreateDefaultGlobalGenerator() const char* GeneratorName; }; static VSVersionedGenerator const vsGenerators[] = { - { "15.0", "Visual Studio 15" }, // + { "15.0", "Visual Studio 15 2017" }, // { "14.0", "Visual Studio 14 2015" }, // { "12.0", "Visual Studio 12 2013" }, // { "11.0", "Visual Studio 11 2012" }, // diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index a2d313c..b8a9a6b 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -67,12 +67,15 @@ # written. CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR) -IF(POLICY CMP0025) - CMAKE_POLICY(SET CMP0025 NEW) -ENDIF() -IF(POLICY CMP0056) - CMAKE_POLICY(SET CMP0056 NEW) -ENDIF() +FOREACH(p + CMP0025 # CMake 3.0, Compiler id for Apple Clang is now AppleClang. + CMP0056 # CMake 3.2, Honor link flags in try_compile() source-file signature. + CMP0063 # CMake 3.3, Honor visibility properties for all target types. + ) + IF(POLICY ${p}) + CMAKE_POLICY(SET ${p} NEW) + ENDIF() +ENDFOREACH() SET(CMAKE_LEGACY_CYGWIN_WIN32 0) #----------------------------------------------------------------------------- diff --git a/Source/kwsys/ConsoleBuf.hxx.in b/Source/kwsys/ConsoleBuf.hxx.in index 717462e..c45a351 100644 --- a/Source/kwsys/ConsoleBuf.hxx.in +++ b/Source/kwsys/ConsoleBuf.hxx.in @@ -147,42 +147,47 @@ protected: return Traits::eof(); } if (m_isConsoleInput) { - wchar_t wbuffer[128]; + // ReadConsole doesn't tell if there's more input available + // don't support reading more characters than this + wchar_t wbuffer[8192]; DWORD charsRead; - if (::ReadConsoleW(m_hInput, wbuffer, - (sizeof(wbuffer) / sizeof(wbuffer[0])) - 1, - &charsRead, NULL) == 0 || + if (ReadConsoleW(m_hInput, wbuffer, + (sizeof(wbuffer) / sizeof(wbuffer[0])), &charsRead, + NULL) == 0 || charsRead == 0) { _setg(true); return Traits::eof(); } - wbuffer[charsRead] = L'\0'; - setBuffer(wbuffer, m_ibuffer); + setBuffer(std::wstring(wbuffer, charsRead), m_ibuffer); } else { - std::wstring totalBuffer; std::wstring wbuffer; - char buffer[128]; + std::string strbuffer; DWORD bytesRead; - while (::ReadFile(m_hInput, buffer, - (sizeof(buffer) / sizeof(buffer[0])) - 1, &bytesRead, - NULL) == 0) { - if (::GetLastError() == ERROR_MORE_DATA) { - buffer[bytesRead] = '\0'; - if (decodeInputBuffer(buffer, wbuffer)) { - totalBuffer += wbuffer; - continue; - } + LARGE_INTEGER size; + if (GetFileSizeEx(m_hInput, &size) == 0) { + _setg(true); + return Traits::eof(); + } + char* buffer = new char[size.LowPart]; + while (ReadFile(m_hInput, buffer, size.LowPart, &bytesRead, NULL) == + 0) { + if (GetLastError() == ERROR_MORE_DATA) { + strbuffer += std::string(buffer, bytesRead); + continue; } _setg(true); + delete[] buffer; return Traits::eof(); } - buffer[bytesRead] = '\0'; - if (!decodeInputBuffer(buffer, wbuffer)) { + if (bytesRead > 0) { + strbuffer += std::string(buffer, bytesRead); + } + delete[] buffer; + if (!decodeInputBuffer(strbuffer, wbuffer)) { _setg(true); return Traits::eof(); } - totalBuffer += wbuffer; - setBuffer(totalBuffer, m_ibuffer); + setBuffer(wbuffer, m_ibuffer); } _setg(); } @@ -315,6 +320,10 @@ private: } bool encodeOutputBuffer(const std::wstring wbuffer, std::string& buffer) { + if (wbuffer.size() == 0) { + buffer = std::string(); + return true; + } const int length = WideCharToMultiByte(m_activeOutputCodepage, 0, wbuffer.c_str(), (int)wbuffer.size(), NULL, 0, NULL, NULL); @@ -329,23 +338,31 @@ private: delete[] buf; return success; } - bool decodeInputBuffer(const char* buffer, std::wstring& wbuffer) + bool decodeInputBuffer(const std::string buffer, std::wstring& wbuffer) { + int length = int(buffer.length()); + if (length == 0) { + wbuffer = std::wstring(); + return true; + } int actualCodepage = m_activeInputCodepage; const char BOM_UTF8[] = { char(0xEF), char(0xBB), char(0xBF) }; - if (std::memcmp(buffer, BOM_UTF8, sizeof(BOM_UTF8)) == 0) { + const char* data = buffer.data(); + const size_t BOMsize = sizeof(BOM_UTF8); + if (length >= BOMsize && std::memcmp(data, BOM_UTF8, BOMsize) == 0) { // PowerShell uses UTF-8 with BOM for pipes actualCodepage = CP_UTF8; - buffer += sizeof(BOM_UTF8); + data += BOMsize; + length -= BOMsize; } const int wlength = - MultiByteToWideChar(actualCodepage, 0, buffer, -1, NULL, 0); + MultiByteToWideChar(actualCodepage, 0, data, length, NULL, 0); wchar_t* wbuf = new wchar_t[wlength]; const bool success = - MultiByteToWideChar(actualCodepage, 0, buffer, -1, wbuf, wlength) > 0 + MultiByteToWideChar(actualCodepage, 0, data, length, wbuf, wlength) > 0 ? true : false; - wbuffer = wbuf; + wbuffer = std::wstring(wbuf, wlength); delete[] wbuf; return success; } diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 8b59e8f..fa5f3e8 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1245,7 +1245,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release set(run_autogen_test ${CMAKE_CTEST_COMMAND} -V) set(run_autouic_test ${CMAKE_CTEST_COMMAND} -V) else() - set(run_autogen_test QtAutogen) + set(run_autogen_test complex/QtAutogen) set(run_autouic_test QtAutoUicInterface) endif() if(NOT CMAKE_CONFIGURATION_TYPES) diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index c713d1c..c4d0567 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -44,114 +44,45 @@ else() endif() -# -- RCC only -add_executable(rcconly rcconly.cpp second_resource.qrc) -set_property(TARGET rcconly PROPERTY AUTORCC ON) -target_link_libraries(rcconly ${QT_QTCORE_TARGET}) - -# -- RCC empty -add_executable(rcc_empty rcc_empty.cpp rcc_empty_resource.qrc) -set_property(TARGET rcc_empty PROPERTY AUTORCC ON) -target_link_libraries(rcc_empty ${QT_QTCORE_TARGET}) - +get_property(QT_COMPILE_FEATURES TARGET ${QT_QTCORE_TARGET} PROPERTY INTERFACE_COMPILE_FEATURES) include_directories(${CMAKE_CURRENT_BINARY_DIR}) -add_definitions(-DFOO -DSomeDefine="Barx") - -# enable relaxed mode so automoc can handle all the special cases: -set(CMAKE_AUTOMOC_RELAXED_MODE TRUE) - -set(CMAKE_AUTOUIC ON) -set(CMAKE_AUTORCC ON) - -# create an executable and two library targets, each requiring automoc: -add_library(codeeditorLib STATIC codeeditor.cpp) - -add_library(privateSlot OBJECT private_slot.cpp) - -configure_file(generated_resource.qrc.in generated_resource.qrc @ONLY) -add_custom_command( - OUTPUT generated.txt - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/generated.txt.in" "${CMAKE_CURRENT_BINARY_DIR}/generated.txt" - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/generated.txt.in" - ) - -add_custom_target(generate_moc_input - DEPENDS generated.txt - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}" - COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h" -) - -add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h" - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in" -) - -if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_GENERATOR STREQUAL Ninja) - set(debug_srcs "$<$<CONFIG:Debug>:debug_class.cpp>" $<$<CONFIG:Debug>:debug_resource.qrc>) - set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:TEST_DEBUG_CLASS>) -endif() - -# The -no-protection option disables the generation of include guards. Verify -# that setting the source file property has an effect by using this and -# issue an error in the preprocessor in calwidget.cpp if the include guard -# is defined. -set_source_files_properties(calwidget.ui PROPERTIES AUTOUIC_OPTIONS "-no-protection") - -add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.cpp bar.cpp abc.cpp - multiplewidgets.cpp - xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot> - test.qrc second_resource.qrc resourcetester.cpp generated.cpp ${debug_srcs} - ${CMAKE_CURRENT_BINARY_DIR}/generated_resource.qrc -) -set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h") - -add_executable(targetObjectsTest targetObjectsTest.cpp $<TARGET_OBJECTS:privateSlot>) -target_link_libraries(targetObjectsTest ${QT_LIBRARIES}) - -set_target_properties( - QtAutogen codeeditorLib privateSlot targetObjectsTest - PROPERTIES - AUTOMOC TRUE -) - -# Test AUTOMOC and AUTORCC on source files with the same name -# but in different subdirectories -add_subdirectory(sameName) - -include(GenerateExportHeader) -# The order is relevant here. B depends on A, and B headers depend on A -# headers both subdirectories use CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE and we -# test that CMAKE_AUTOMOC successfully reads the include directories -# for the build interface from those targets. There has previously been -# a bug where caching of the include directories happened before -# extracting the includes to pass to moc. -add_subdirectory(Bdir) -add_subdirectory(Adir) -add_library(libC SHARED libC.cpp) -set_target_properties(libC PROPERTIES AUTOMOC TRUE) -generate_export_header(libC) -target_link_libraries(libC LINK_PUBLIC libB) - -target_link_libraries(QtAutogen codeeditorLib ${QT_LIBRARIES} libC) - +# -- Test: AUTORCC +# RCC only +add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc) +set_property(TARGET rccOnly PROPERTY AUTORCC ON) +target_link_libraries(rccOnly ${QT_QTCORE_TARGET}) + +# -- Test: AUTORCC +# RCC empty +add_executable(rccEmpty rccEmpty.cpp rccEmptyRes.qrc) +set_property(TARGET rccEmpty PROPERTY AUTORCC ON) +target_link_libraries(rccEmpty ${QT_QTCORE_TARGET}) + +# -- Test: AUTOUIC +# UIC only +qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h) +add_executable(uicOnly uicOnlySource/uiconly.cpp ${uicOnlyMoc}) +set_property(TARGET uicOnly PROPERTY AUTOUIC ON) +target_link_libraries(uicOnly ${QT_LIBRARIES}) + +# -- Test: AUTOMOC, AUTORCC # Add not_generated_file.qrc to the source list to get the file-level # dependency, but don't generate a c++ file from it. Disable the AUTORCC # feature for this target. This tests that qrc files in the sources don't # have an effect on generation if AUTORCC is off. add_library(empty STATIC empty.cpp not_generated_file.qrc) set_target_properties(empty PROPERTIES AUTORCC OFF) - set_target_properties(empty PROPERTIES AUTOMOC TRUE) target_link_libraries(empty no_link_language) add_library(no_link_language STATIC empty.h) set_target_properties(no_link_language PROPERTIES AUTOMOC TRUE) +# Pass Qt compiler features to targets that don't link against Qt +target_compile_features(no_link_language PRIVATE ${QT_COMPILE_FEATURES}) +target_compile_features(empty PRIVATE ${QT_COMPILE_FEATURES}) -qtx_wrap_cpp(uicOnlyMoc sub/uiconly.h) -add_executable(uiconly sub/uiconly.cpp ${uicOnlyMoc}) -target_link_libraries(uiconly ${QT_LIBRARIES}) - +# -- Test: AUTORCC +# When a file listed in a .qrc file changes the target must be rebuilt try_compile(RCC_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/autorcc_depends" "${CMAKE_CURRENT_SOURCE_DIR}/autorcc_depends" @@ -185,7 +116,8 @@ if (NOT file1_step1 GREATER file1_before) message(SEND_ERROR "file1 (${qrc_file1}) should have changed in the first step!") endif() -#----------------------------------------------------------------------------- +# -- Test: AUTOMOC +# Ensure a repeated build succeeds when a header containing a QObject changes try_compile(MOC_RERUN "${CMAKE_CURRENT_BINARY_DIR}/automoc_rerun" "${CMAKE_CURRENT_SOURCE_DIR}/automoc_rerun" @@ -207,3 +139,11 @@ execute_process(COMMAND "${CMAKE_COMMAND}" --build . if (automoc_rerun_result) message(SEND_ERROR "Second build of automoc_rerun failed.") endif() + +# -- Test: AUTOMOC AUTORCC +# Source files with the same basename in different subdirectories +add_subdirectory(sameName) + +# -- Test: AUTOMOC AUTORCC AUTOUIC +# Complex test case +add_subdirectory(complex) diff --git a/Tests/QtAutogen/Adir/CMakeLists.txt b/Tests/QtAutogen/complex/Adir/CMakeLists.txt index a1c36ff..a1c36ff 100644 --- a/Tests/QtAutogen/Adir/CMakeLists.txt +++ b/Tests/QtAutogen/complex/Adir/CMakeLists.txt diff --git a/Tests/QtAutogen/Adir/libA.cpp b/Tests/QtAutogen/complex/Adir/libA.cpp index f79f24a..f79f24a 100644 --- a/Tests/QtAutogen/Adir/libA.cpp +++ b/Tests/QtAutogen/complex/Adir/libA.cpp diff --git a/Tests/QtAutogen/Adir/libA.h b/Tests/QtAutogen/complex/Adir/libA.h index c4eb9f7..c4eb9f7 100644 --- a/Tests/QtAutogen/Adir/libA.h +++ b/Tests/QtAutogen/complex/Adir/libA.h diff --git a/Tests/QtAutogen/Bdir/CMakeLists.txt b/Tests/QtAutogen/complex/Bdir/CMakeLists.txt index d9d4aa7..d9d4aa7 100644 --- a/Tests/QtAutogen/Bdir/CMakeLists.txt +++ b/Tests/QtAutogen/complex/Bdir/CMakeLists.txt diff --git a/Tests/QtAutogen/Bdir/libB.cpp b/Tests/QtAutogen/complex/Bdir/libB.cpp index d3b6753..d3b6753 100644 --- a/Tests/QtAutogen/Bdir/libB.cpp +++ b/Tests/QtAutogen/complex/Bdir/libB.cpp diff --git a/Tests/QtAutogen/Bdir/libB.h b/Tests/QtAutogen/complex/Bdir/libB.h index e4ab788..e4ab788 100644 --- a/Tests/QtAutogen/Bdir/libB.h +++ b/Tests/QtAutogen/complex/Bdir/libB.h diff --git a/Tests/QtAutogen/complex/CMakeLists.txt b/Tests/QtAutogen/complex/CMakeLists.txt new file mode 100644 index 0000000..0d44f50 --- /dev/null +++ b/Tests/QtAutogen/complex/CMakeLists.txt @@ -0,0 +1,81 @@ +cmake_minimum_required(VERSION 3.1) + +# -- Test: AUTOMOC AUTORCC AUTOUIC +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +add_definitions(-DFOO -DSomeDefine="Barx") + +# enable relaxed mode so automoc can handle all the special cases: +set(CMAKE_AUTOMOC_RELAXED_MODE TRUE) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +# create an executable and two library targets, each requiring automoc: +add_library(codeeditorLib STATIC codeeditor.cpp) +add_library(privateSlot OBJECT private_slot.cpp) +# Pass Qt compiler features to targets that don't link against Qt +target_compile_features(codeeditorLib PRIVATE ${QT_COMPILE_FEATURES}) +target_compile_features(privateSlot PRIVATE ${QT_COMPILE_FEATURES}) + +configure_file(generated_resource.qrc.in generated_resource.qrc @ONLY) +add_custom_command( + OUTPUT generated.txt + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/generated.txt.in" "${CMAKE_CURRENT_BINARY_DIR}/generated.txt" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/generated.txt.in" + ) + +add_custom_target(generate_moc_input + DEPENDS generated.txt + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}" + COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myinterface.h" +) + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h" + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in" "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/myotherinterface.h.in" +) + +if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_GENERATOR STREQUAL Ninja) + set(debug_srcs "$<$<CONFIG:Debug>:debug_class.cpp>" $<$<CONFIG:Debug>:debug_resource.qrc>) + set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:TEST_DEBUG_CLASS>) +endif() + +# The -no-protection option disables the generation of include guards. Verify +# that setting the source file property has an effect by using this and +# issue an error in the preprocessor in calwidget.cpp if the include guard +# is defined. +set_source_files_properties(calwidget.ui PROPERTIES AUTOUIC_OPTIONS "-no-protection") + +add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.cpp bar.cpp abc.cpp + multiplewidgets.cpp + xyz.cpp yaf.cpp gadget.cpp $<TARGET_OBJECTS:privateSlot> + test.qrc second_resource.qrc resourcetester.cpp generated.cpp ${debug_srcs} + ${CMAKE_CURRENT_BINARY_DIR}/generated_resource.qrc +) +set_property(TARGET QtAutogen APPEND PROPERTY AUTOGEN_TARGET_DEPENDS generate_moc_input "${CMAKE_CURRENT_BINARY_DIR}/myotherinterface.h") + +add_executable(targetObjectsTest targetObjectsTest.cpp $<TARGET_OBJECTS:privateSlot>) +target_link_libraries(targetObjectsTest ${QT_LIBRARIES}) + +set_target_properties( + QtAutogen codeeditorLib privateSlot targetObjectsTest + PROPERTIES + AUTOMOC TRUE +) + + +include(GenerateExportHeader) +# The order is relevant here. B depends on A, and B headers depend on A +# headers both subdirectories use CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE and we +# test that CMAKE_AUTOMOC successfully reads the include directories +# for the build interface from those targets. There has previously been +# a bug where caching of the include directories happened before +# extracting the includes to pass to moc. +add_subdirectory(Bdir) +add_subdirectory(Adir) +add_library(libC SHARED libC.cpp) +set_target_properties(libC PROPERTIES AUTOMOC TRUE) +generate_export_header(libC) +target_link_libraries(libC LINK_PUBLIC libB) + +target_link_libraries(QtAutogen codeeditorLib ${QT_LIBRARIES} libC) diff --git a/Tests/QtAutogen/abc.cpp b/Tests/QtAutogen/complex/abc.cpp index 2929b92..2929b92 100644 --- a/Tests/QtAutogen/abc.cpp +++ b/Tests/QtAutogen/complex/abc.cpp diff --git a/Tests/QtAutogen/abc.h b/Tests/QtAutogen/complex/abc.h index ec5f411..ec5f411 100644 --- a/Tests/QtAutogen/abc.h +++ b/Tests/QtAutogen/complex/abc.h diff --git a/Tests/QtAutogen/abc_p.h b/Tests/QtAutogen/complex/abc_p.h index be98487..be98487 100644 --- a/Tests/QtAutogen/abc_p.h +++ b/Tests/QtAutogen/complex/abc_p.h diff --git a/Tests/QtAutogen/bar.cpp b/Tests/QtAutogen/complex/bar.cpp index 734bd7a..734bd7a 100644 --- a/Tests/QtAutogen/bar.cpp +++ b/Tests/QtAutogen/complex/bar.cpp diff --git a/Tests/QtAutogen/blub.cpp b/Tests/QtAutogen/complex/blub.cpp index 1c497e0..1c497e0 100644 --- a/Tests/QtAutogen/blub.cpp +++ b/Tests/QtAutogen/complex/blub.cpp diff --git a/Tests/QtAutogen/blub.h b/Tests/QtAutogen/complex/blub.h index ff79878..ff79878 100644 --- a/Tests/QtAutogen/blub.h +++ b/Tests/QtAutogen/complex/blub.h diff --git a/Tests/QtAutogen/calwidget.cpp b/Tests/QtAutogen/complex/calwidget.cpp index 380e982..380e982 100644 --- a/Tests/QtAutogen/calwidget.cpp +++ b/Tests/QtAutogen/complex/calwidget.cpp diff --git a/Tests/QtAutogen/calwidget.h b/Tests/QtAutogen/complex/calwidget.h index 084d959..084d959 100644 --- a/Tests/QtAutogen/calwidget.h +++ b/Tests/QtAutogen/complex/calwidget.h diff --git a/Tests/QtAutogen/calwidget.ui b/Tests/QtAutogen/complex/calwidget.ui index 1c245ca..1c245ca 100644 --- a/Tests/QtAutogen/calwidget.ui +++ b/Tests/QtAutogen/complex/calwidget.ui diff --git a/Tests/QtAutogen/codeeditor.cpp b/Tests/QtAutogen/complex/codeeditor.cpp index 0caf8a7..0caf8a7 100644 --- a/Tests/QtAutogen/codeeditor.cpp +++ b/Tests/QtAutogen/complex/codeeditor.cpp diff --git a/Tests/QtAutogen/codeeditor.h b/Tests/QtAutogen/complex/codeeditor.h index b410bd4..b410bd4 100644 --- a/Tests/QtAutogen/codeeditor.h +++ b/Tests/QtAutogen/complex/codeeditor.h diff --git a/Tests/QtAutogen/debug_class.cpp b/Tests/QtAutogen/complex/debug_class.cpp index 46b09e7..46b09e7 100644 --- a/Tests/QtAutogen/debug_class.cpp +++ b/Tests/QtAutogen/complex/debug_class.cpp diff --git a/Tests/QtAutogen/debug_class.h b/Tests/QtAutogen/complex/debug_class.h index c02f0ed..c02f0ed 100644 --- a/Tests/QtAutogen/debug_class.h +++ b/Tests/QtAutogen/complex/debug_class.h diff --git a/Tests/QtAutogen/debug_class.ui b/Tests/QtAutogen/complex/debug_class.ui index dc2e1ac..dc2e1ac 100644 --- a/Tests/QtAutogen/debug_class.ui +++ b/Tests/QtAutogen/complex/debug_class.ui diff --git a/Tests/QtAutogen/debug_resource.qrc b/Tests/QtAutogen/complex/debug_resource.qrc index db98b9b..db98b9b 100644 --- a/Tests/QtAutogen/debug_resource.qrc +++ b/Tests/QtAutogen/complex/debug_resource.qrc diff --git a/Tests/QtAutogen/foo.cpp b/Tests/QtAutogen/complex/foo.cpp index f665eee..f665eee 100644 --- a/Tests/QtAutogen/foo.cpp +++ b/Tests/QtAutogen/complex/foo.cpp diff --git a/Tests/QtAutogen/foo.h b/Tests/QtAutogen/complex/foo.h index 3e03fe6..3e03fe6 100644 --- a/Tests/QtAutogen/foo.h +++ b/Tests/QtAutogen/complex/foo.h diff --git a/Tests/QtAutogen/gadget.cpp b/Tests/QtAutogen/complex/gadget.cpp index 23d95fa..23d95fa 100644 --- a/Tests/QtAutogen/gadget.cpp +++ b/Tests/QtAutogen/complex/gadget.cpp diff --git a/Tests/QtAutogen/gadget.h b/Tests/QtAutogen/complex/gadget.h index 3253e31..3253e31 100644 --- a/Tests/QtAutogen/gadget.h +++ b/Tests/QtAutogen/complex/gadget.h diff --git a/Tests/QtAutogen/generated.cpp b/Tests/QtAutogen/complex/generated.cpp index d514c61..d514c61 100644 --- a/Tests/QtAutogen/generated.cpp +++ b/Tests/QtAutogen/complex/generated.cpp diff --git a/Tests/QtAutogen/generated.h b/Tests/QtAutogen/complex/generated.h index 62e1607..62e1607 100644 --- a/Tests/QtAutogen/generated.h +++ b/Tests/QtAutogen/complex/generated.h diff --git a/Tests/QtAutogen/generated.txt.in b/Tests/QtAutogen/complex/generated.txt.in index 77507bb..77507bb 100644 --- a/Tests/QtAutogen/generated.txt.in +++ b/Tests/QtAutogen/complex/generated.txt.in diff --git a/Tests/QtAutogen/generated_resource.qrc.in b/Tests/QtAutogen/complex/generated_resource.qrc.in index da5fa62..da5fa62 100644 --- a/Tests/QtAutogen/generated_resource.qrc.in +++ b/Tests/QtAutogen/complex/generated_resource.qrc.in diff --git a/Tests/QtAutogen/libC.cpp b/Tests/QtAutogen/complex/libC.cpp index a3acff1..a3acff1 100644 --- a/Tests/QtAutogen/libC.cpp +++ b/Tests/QtAutogen/complex/libC.cpp diff --git a/Tests/QtAutogen/libC.h b/Tests/QtAutogen/complex/libC.h index 3bc2bad..3bc2bad 100644 --- a/Tests/QtAutogen/libC.h +++ b/Tests/QtAutogen/complex/libC.h diff --git a/Tests/QtAutogen/main.cpp b/Tests/QtAutogen/complex/main.cpp index d557c70..d557c70 100644 --- a/Tests/QtAutogen/main.cpp +++ b/Tests/QtAutogen/complex/main.cpp diff --git a/Tests/QtAutogen/multiplewidgets.cpp b/Tests/QtAutogen/complex/multiplewidgets.cpp index fda36ea..fda36ea 100644 --- a/Tests/QtAutogen/multiplewidgets.cpp +++ b/Tests/QtAutogen/complex/multiplewidgets.cpp diff --git a/Tests/QtAutogen/multiplewidgets.h b/Tests/QtAutogen/complex/multiplewidgets.h index a4d0a50..a4d0a50 100644 --- a/Tests/QtAutogen/multiplewidgets.h +++ b/Tests/QtAutogen/complex/multiplewidgets.h diff --git a/Tests/QtAutogen/myinterface.h.in b/Tests/QtAutogen/complex/myinterface.h.in index c6c0ba1..c6c0ba1 100644 --- a/Tests/QtAutogen/myinterface.h.in +++ b/Tests/QtAutogen/complex/myinterface.h.in diff --git a/Tests/QtAutogen/myotherinterface.h.in b/Tests/QtAutogen/complex/myotherinterface.h.in index d21e7af..d21e7af 100644 --- a/Tests/QtAutogen/myotherinterface.h.in +++ b/Tests/QtAutogen/complex/myotherinterface.h.in diff --git a/Tests/QtAutogen/private_slot.cpp b/Tests/QtAutogen/complex/private_slot.cpp index ab1682a..ab1682a 100644 --- a/Tests/QtAutogen/private_slot.cpp +++ b/Tests/QtAutogen/complex/private_slot.cpp diff --git a/Tests/QtAutogen/private_slot.h b/Tests/QtAutogen/complex/private_slot.h index 8041eb2..8041eb2 100644 --- a/Tests/QtAutogen/private_slot.h +++ b/Tests/QtAutogen/complex/private_slot.h diff --git a/Tests/QtAutogen/resourcetester.cpp b/Tests/QtAutogen/complex/resourcetester.cpp index 4ecb6b4..4ecb6b4 100644 --- a/Tests/QtAutogen/resourcetester.cpp +++ b/Tests/QtAutogen/complex/resourcetester.cpp diff --git a/Tests/QtAutogen/resourcetester.h b/Tests/QtAutogen/complex/resourcetester.h index dbdb3ad..dbdb3ad 100644 --- a/Tests/QtAutogen/resourcetester.h +++ b/Tests/QtAutogen/complex/resourcetester.h diff --git a/Tests/QtAutogen/second_resource.qrc b/Tests/QtAutogen/complex/second_resource.qrc index 27bfb14..27bfb14 100644 --- a/Tests/QtAutogen/second_resource.qrc +++ b/Tests/QtAutogen/complex/second_resource.qrc diff --git a/Tests/QtAutogen/second_widget.cpp b/Tests/QtAutogen/complex/second_widget.cpp index c575f10..c575f10 100644 --- a/Tests/QtAutogen/second_widget.cpp +++ b/Tests/QtAutogen/complex/second_widget.cpp diff --git a/Tests/QtAutogen/second_widget.h b/Tests/QtAutogen/complex/second_widget.h index c7929c4..c7929c4 100644 --- a/Tests/QtAutogen/second_widget.h +++ b/Tests/QtAutogen/complex/second_widget.h diff --git a/Tests/QtAutogen/second_widget.ui b/Tests/QtAutogen/complex/second_widget.ui index 4effa58..4effa58 100644 --- a/Tests/QtAutogen/second_widget.ui +++ b/Tests/QtAutogen/complex/second_widget.ui diff --git a/Tests/QtAutogen/sub/bar.h b/Tests/QtAutogen/complex/sub/bar.h index e4093f6..e4093f6 100644 --- a/Tests/QtAutogen/sub/bar.h +++ b/Tests/QtAutogen/complex/sub/bar.h diff --git a/Tests/QtAutogen/targetObjectsTest.cpp b/Tests/QtAutogen/complex/targetObjectsTest.cpp index 766b775..766b775 100644 --- a/Tests/QtAutogen/targetObjectsTest.cpp +++ b/Tests/QtAutogen/complex/targetObjectsTest.cpp diff --git a/Tests/QtAutogen/test.qrc b/Tests/QtAutogen/complex/test.qrc index c3d4e3c..c3d4e3c 100644 --- a/Tests/QtAutogen/test.qrc +++ b/Tests/QtAutogen/complex/test.qrc diff --git a/Tests/QtAutogen/widget1.ui b/Tests/QtAutogen/complex/widget1.ui index 8fce81a..8fce81a 100644 --- a/Tests/QtAutogen/widget1.ui +++ b/Tests/QtAutogen/complex/widget1.ui diff --git a/Tests/QtAutogen/widget2.ui b/Tests/QtAutogen/complex/widget2.ui index 1f411b9..1f411b9 100644 --- a/Tests/QtAutogen/widget2.ui +++ b/Tests/QtAutogen/complex/widget2.ui diff --git a/Tests/QtAutogen/xyz.cpp b/Tests/QtAutogen/complex/xyz.cpp index e46c9d3..e46c9d3 100644 --- a/Tests/QtAutogen/xyz.cpp +++ b/Tests/QtAutogen/complex/xyz.cpp diff --git a/Tests/QtAutogen/xyz.h b/Tests/QtAutogen/complex/xyz.h index 8b813fd..8b813fd 100644 --- a/Tests/QtAutogen/xyz.h +++ b/Tests/QtAutogen/complex/xyz.h diff --git a/Tests/QtAutogen/yaf.cpp b/Tests/QtAutogen/complex/yaf.cpp index 70e26aa..70e26aa 100644 --- a/Tests/QtAutogen/yaf.cpp +++ b/Tests/QtAutogen/complex/yaf.cpp diff --git a/Tests/QtAutogen/yaf.h b/Tests/QtAutogen/complex/yaf.h index f271061..f271061 100644 --- a/Tests/QtAutogen/yaf.h +++ b/Tests/QtAutogen/complex/yaf.h diff --git a/Tests/QtAutogen/yaf_p.h b/Tests/QtAutogen/complex/yaf_p.h index ea5eed6..ea5eed6 100644 --- a/Tests/QtAutogen/yaf_p.h +++ b/Tests/QtAutogen/complex/yaf_p.h diff --git a/Tests/QtAutogen/rcconly.cpp b/Tests/QtAutogen/rccEmpty.cpp index 854c4c1..7f2c527 100644 --- a/Tests/QtAutogen/rcconly.cpp +++ b/Tests/QtAutogen/rccEmpty.cpp @@ -1,9 +1,9 @@ -extern int qInitResources_second_resource(); +extern int qInitResources_rccEmptyRes(); int main(int, char**) { // Fails to link if the symbol is not present. - qInitResources_second_resource(); + qInitResources_rccEmptyRes(); return 0; } diff --git a/Tests/QtAutogen/rcc_empty_resource.qrc b/Tests/QtAutogen/rccEmptyRes.qrc index 4ca9cd5..4ca9cd5 100644 --- a/Tests/QtAutogen/rcc_empty_resource.qrc +++ b/Tests/QtAutogen/rccEmptyRes.qrc diff --git a/Tests/QtAutogen/rcc_empty.cpp b/Tests/QtAutogen/rccOnly.cpp index 3f9f9a2..61c7bf4 100644 --- a/Tests/QtAutogen/rcc_empty.cpp +++ b/Tests/QtAutogen/rccOnly.cpp @@ -1,9 +1,9 @@ -extern int qInitResources_rcc_empty_resource(); +extern int qInitResources_rccOnlyRes(); int main(int, char**) { // Fails to link if the symbol is not present. - qInitResources_rcc_empty_resource(); + qInitResources_rccOnlyRes(); return 0; } diff --git a/Tests/QtAutogen/rccOnlyRes.qrc b/Tests/QtAutogen/rccOnlyRes.qrc new file mode 100644 index 0000000..5551348 --- /dev/null +++ b/Tests/QtAutogen/rccOnlyRes.qrc @@ -0,0 +1,5 @@ +<!DOCTYPE RCC><RCC version="1.0"> +<qresource> + <file>rccOnly.cpp</file> +</qresource> +</RCC> diff --git a/Tests/QtAutogen/sub/uiconly.cpp b/Tests/QtAutogen/uicOnlySource/uiconly.cpp index ac22789..ac22789 100644 --- a/Tests/QtAutogen/sub/uiconly.cpp +++ b/Tests/QtAutogen/uicOnlySource/uiconly.cpp diff --git a/Tests/QtAutogen/sub/uiconly.h b/Tests/QtAutogen/uicOnlySource/uiconly.h index 9b0b1b4..9b0b1b4 100644 --- a/Tests/QtAutogen/sub/uiconly.h +++ b/Tests/QtAutogen/uicOnlySource/uiconly.h diff --git a/Tests/QtAutogen/sub/uiconly.ui b/Tests/QtAutogen/uicOnlySource/uiconly.ui index 13fb832..13fb832 100644 --- a/Tests/QtAutogen/sub/uiconly.ui +++ b/Tests/QtAutogen/uicOnlySource/uiconly.ui diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake index 22d8164..bc1ec97 100644 --- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake +++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake @@ -1,3 +1,5 @@ include(RunCMake) run_cmake(VsConfigurationType) run_cmake(VsTargetsFileReferences) +run_cmake(VsCustomProps) +run_cmake(VsDebuggerWorkingDir) diff --git a/Tests/RunCMake/VS10Project/VsCustomProps-check.cmake b/Tests/RunCMake/VS10Project/VsCustomProps-check.cmake new file mode 100644 index 0000000..22a3df0 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCustomProps-check.cmake @@ -0,0 +1,25 @@ +set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") +if(NOT EXISTS "${vcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.") + return() +endif() + +set(importFound FALSE) + +set(props_file "${RunCMake_SOURCE_DIR}/my.props") +file(TO_NATIVE_PATH "${props_file}" check_file) +file(STRINGS "${vcProjectFile}" lines) +foreach(line IN LISTS lines) + if(line MATCHES "^ *<Import Project=\"([^\"]+)\".*Label=\"([^\"]+)\".*$") + if("${CMAKE_MATCH_1}" STREQUAL "${check_file}" AND + "${CMAKE_MATCH_2}" STREQUAL "LocalAppDataPlatform") + message(STATUS "foo.vcxproj is importing ${check_file}") + set(importFound TRUE) + endif() + endif() +endforeach() + +if(NOT importFound) + set(RunCMake_TEST_FAILED "Import of custom .props file not found.") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/VsCustomProps.cmake b/Tests/RunCMake/VS10Project/VsCustomProps.cmake new file mode 100644 index 0000000..af52a3e --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsCustomProps.cmake @@ -0,0 +1,7 @@ +enable_language(CXX) +add_library(foo foo.cpp) + +set(props_file "${CMAKE_CURRENT_SOURCE_DIR}/my.props") + +set_target_properties(foo PROPERTIES + VS_USER_PROPS_CXX "${props_file}") diff --git a/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake new file mode 100644 index 0000000..637c68c --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake @@ -0,0 +1,22 @@ +set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj") +if(NOT EXISTS "${vcProjectFile}") + set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.") + return() +endif() + +set(debuggerWorkDirSet FALSE) + +file(STRINGS "${vcProjectFile}" lines) +foreach(line IN LISTS lines) + if(line MATCHES "^ *<LocalDebuggerWorkingDirectory[^>]*>([^<>]+)</LocalDebuggerWorkingDirectory>$") + if("${CMAKE_MATCH_1}" STREQUAL "my-debugger-directory") + message(STATUS "foo.vcxproj has debugger working dir set") + set(debuggerWorkDirSet TRUE) + endif() + endif() +endforeach() + +if(NOT debuggerWorkDirSet) + set(RunCMake_TEST_FAILED "LocalDebuggerWorkingDirectory not found or not set correctly.") + return() +endif() diff --git a/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake new file mode 100644 index 0000000..a277c65 --- /dev/null +++ b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake @@ -0,0 +1,5 @@ +enable_language(CXX) +add_library(foo foo.cpp) + +set_target_properties(foo PROPERTIES + VS_DEBUGGER_WORKING_DIRECTORY "my-debugger-directory") diff --git a/Tests/RunCMake/VS10Project/my.props b/Tests/RunCMake/VS10Project/my.props new file mode 100644 index 0000000..7c98cde --- /dev/null +++ b/Tests/RunCMake/VS10Project/my.props @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + </PropertyGroup> +</Project> diff --git a/Tests/RunCMake/while/EndAlone-stderr.txt b/Tests/RunCMake/while/EndAlone-stderr.txt index cd98687..5fe6655 100644 --- a/Tests/RunCMake/while/EndAlone-stderr.txt +++ b/Tests/RunCMake/while/EndAlone-stderr.txt @@ -1,5 +1,5 @@ ^CMake Error at EndAlone.cmake:1 \(endwhile\): endwhile An ENDWHILE command was found outside of a proper WHILE ENDWHILE - structure. + structure. Or its arguments did not match the opening WHILE command. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\)$ @@ -277,14 +277,8 @@ CMAKE_CXX_SOURCES="\ cmDepends \ cmDependsC \ cmDocumentationFormatter \ - cmElseCommand \ cmEnableLanguageCommand \ cmEnableTestingCommand \ - cmEndForEachCommand \ - cmEndFunctionCommand \ - cmEndIfCommand \ - cmEndMacroCommand \ - cmEndWhileCommand \ cmExecProgramCommand \ cmExecuteProcessCommand \ cmExpandedCommandArgument \ @@ -406,6 +400,7 @@ CMAKE_CXX_SOURCES="\ cmTimestamp \ cmTryCompileCommand \ cmTryRunCommand \ + cmUnexpectedCommand \ cmUnsetCommand \ cmVersion \ cmWhileCommand \ |