diff options
303 files changed, 2957 insertions, 1268 deletions
diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 9ec9e8f..476a1c6 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -6,7 +6,9 @@ set(CTEST_PROJECT_NAME "CMake") set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC") -set(CTEST_DROP_METHOD "http") +if(NOT CTEST_DROP_METHOD STREQUAL "https") + set(CTEST_DROP_METHOD "http") +endif() set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=CMake") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Help/cpack_gen/external.rst b/Help/cpack_gen/external.rst index 406f6be..7ef1071 100644 --- a/Help/cpack_gen/external.rst +++ b/Help/cpack_gen/external.rst @@ -281,3 +281,10 @@ Variables specific to CPack External generator It is invoked after (optional) staging took place and may run an external packaging tool. The script has access to the variables defined by the CPack config file. + +.. variable:: CPACK_EXTERNAL_BUILT_PACKAGES + + The ``CPACK_EXTERNAL_PACKAGE_SCRIPT`` script may set this list variable to the + full paths of generated package files. CPack copy these files from the stage + directory back to the top build directory and possibly produce checksum files + if the :variable:`CPACK_PACKAGE_CHECKSUM` is set. diff --git a/Help/dev/maint.rst b/Help/dev/maint.rst index a1c1a6f..9b6774b 100644 --- a/Help/dev/maint.rst +++ b/Help/dev/maint.rst @@ -299,3 +299,28 @@ announcing that post-release development is open:: before staging or merging. .. _`CMake Discourse Forum Development Category`: https://discourse.cmake.org/c/development + +Initial Post-Release Development +-------------------------------- + +Deprecate policies more than 8 release series old by updating the +policy range check in ``cmMakefile::SetPolicy``. +Commit with a message such as:: + + Add deprecation warnings for policies CMP#### and below + + The OLD behaviors of all policies are deprecated, but only by + documentation. Add an explicit deprecation diagnostic for policies + introduced in CMake $OLDVER and below to encourage projects to port + away from setting policies to OLD. + +Update the ``cmake_policy`` version range generated by ``install(EXPORT)`` +in ``cmExportFileGenerator::GeneratePolicyHeaderCode`` to end at the +previous release. We use one release back since we now know all the +policies added for that version. Commit with a message such as:: + + export: Increase maximum policy version in exported files to $prev + + The files generatd by `install(EXPORT)` and `export()` commands + are known to work with policies as of CMake $prev, so enable them + in sufficiently new CMake versions. diff --git a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt index c911625..a47d5e0 100644 --- a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt @@ -57,7 +57,11 @@ set_property(TARGET MathFunctions PROPERTY VERSION "1.0.0") set_property(TARGET MathFunctions PROPERTY SOVERSION "1") # install rules -install(TARGETS MathFunctions tutorial_compiler_flags +set(installable_libs MathFunctions tutorial_compiler_flags) +if(TARGET SqrtLibrary) + list(APPEND installable_libs SqrtLibrary) +endif() +install(TARGETS ${installable_libs} DESTINATION lib EXPORT MathFunctionsTargets) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt index e0c0621..0bfe20c 100644 --- a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt @@ -47,5 +47,9 @@ endif() target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") # install rules -install(TARGETS MathFunctions DESTINATION lib) +set(installable_libs MathFunctions) +if(TARGET SqrtLibrary) + list(APPEND installable_libs SqrtLibrary) +endif() +install(TARGETS ${installable_libs} DESTINATION lib) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt index 32f5e08..0d287ca 100644 --- a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt @@ -51,5 +51,9 @@ target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") # install rules -install(TARGETS MathFunctions DESTINATION lib) +set(installable_libs MathFunctions tutorial_compiler_flags) +if(TARGET SqrtLibrary) + list(APPEND installable_libs SqrtLibrary) +endif() +install(TARGETS ${installable_libs} DESTINATION lib) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt index 720ee64..ea3861c 100644 --- a/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt @@ -53,7 +53,11 @@ target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH") # install rules -install(TARGETS MathFunctions tutorial_compiler_flags +set(installable_libs MathFunctions tutorial_compiler_flags) +if(TARGET SqrtLibrary) + list(APPEND installable_libs SqrtLibrary) +endif() +install(TARGETS ${installable_libs} DESTINATION lib EXPORT MathFunctionsTargets) install(FILES MathFunctions.h DESTINATION include) diff --git a/Help/guide/tutorial/index.rst b/Help/guide/tutorial/index.rst index 6e26de9..e7ea290 100644 --- a/Help/guide/tutorial/index.rst +++ b/Help/guide/tutorial/index.rst @@ -675,9 +675,9 @@ The first step is to update the starting section of the top-level Now that we have made MathFunctions always be used, we will need to update the logic of that library. So, in ``MathFunctions/CMakeLists.txt`` we need to -create a SqrtLibrary that will conditionally be built when ``USE_MYMATH`` is -enabled. Now, since this is a tutorial, we are going to explicitly require -that SqrtLibrary is built statically. +create a SqrtLibrary that will conditionally be built and installed when +``USE_MYMATH`` is enabled. Now, since this is a tutorial, we are going to +explicitly require that SqrtLibrary is built statically. The end result is that ``MathFunctions/CMakeLists.txt`` should look like: @@ -703,7 +703,7 @@ Finally, update ``MathFunctions/MathFunctions.h`` to use dll export defines: .. literalinclude:: Step10/MathFunctions/MathFunctions.h :language: c++ -At this point, if you build everything, you will notice that linking fails +At this point, if you build everything, you may notice that linking fails as we are combining a static library without position independent code with a library that has position independent code. The solution to this is to explicitly set the :prop_tgt:`POSITION_INDEPENDENT_CODE` target property of diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst index 124da44..935f557 100644 --- a/Help/manual/cmake-generator-expressions.7.rst +++ b/Help/manual/cmake-generator-expressions.7.rst @@ -105,10 +105,11 @@ Variable Queries ``$<TARGET_EXISTS:target>`` ``1`` if ``target`` exists, else ``0``. -``$<CONFIG:cfg>`` - ``1`` if config is ``cfg``, else ``0``. This is a case-insensitive comparison. - The mapping in :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` is also considered by - this expression when it is evaluated on a property on an :prop_tgt:`IMPORTED` +``$<CONFIG:cfgs>`` + ``1`` if config is any one of the entires in ``cfgs``, else ``0``. This is a + case-insensitive comparison. The mapping in + :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` is also considered by this + expression when it is evaluated on a property on an :prop_tgt:`IMPORTED` target. ``$<PLATFORM_ID:platform_ids>`` where ``platform_ids`` is a comma-separated list. diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index e98038a..3ceb1df 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -57,6 +57,14 @@ Policies Introduced by CMake 3.18 .. toctree:: :maxdepth: 1 + CMP0109: find_program() requires permission to execute but not to read. </policy/CMP0109> + +Policies Introduced by CMake 3.18 +================================= + +.. toctree:: + :maxdepth: 1 + CMP0108: A target cannot link to itself through an alias. </policy/CMP0108> CMP0107: An ALIAS target cannot overwrite another target. </policy/CMP0107> CMP0106: The Documentation module is removed. </policy/CMP0106> diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 9becfc6..72ecfc7 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -450,6 +450,9 @@ The options are: ``--component <comp>`` Component-based install. Only install component ``<comp>``. +``--default-directory-permissions <permissions>`` + Default directory install permissions. Permissions in format ``<u=rwx,g=rx,o=rx>``. + ``--prefix <prefix>`` Override the installation prefix, :variable:`CMAKE_INSTALL_PREFIX`. @@ -566,7 +569,8 @@ Available commands are: ``compare_files [--ignore-eol] <file1> <file2>`` Check if ``<file1>`` is same as ``<file2>``. If files are the same, - then returns ``0``, if not it returns ``1``. The ``--ignore-eol`` option + then returns ``0``, if not it returns ``1``. In case of invalid + arguments, it retruns 2. The ``--ignore-eol`` option implies line-wise comparison and ignores LF/CRLF differences. ``copy <file>... <destination>`` diff --git a/Help/policy/CMP0109.rst b/Help/policy/CMP0109.rst new file mode 100644 index 0000000..7542c8f --- /dev/null +++ b/Help/policy/CMP0109.rst @@ -0,0 +1,22 @@ +CMP0109 +------- + +:command:`find_program` requires permission to execute but not to read. + +In CMake 3.18 and below, the :command:`find_program` command on UNIX +would find files that are readable without requiring execute permission, +and would not find files that are executable without read permission. +In CMake 3.19 and above, ``find_program`` now prefers to require execute +permission but not read permission. This policy provides compatibility +with projects that have not been updated to expect the new behavior. + +The ``OLD`` behavior for this policy is for ``find_program`` to require +read permission but not execute permission. +The ``NEW`` behavior for this policy is for ``find_program`` to require +execute permission but not read permission. + +This policy was introduced in CMake version 3.19. CMake version |release| +warns when the policy is not set and uses ``OLD`` behavior. Use the +:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. + +.. include:: DEPRECATED.txt diff --git a/Help/release/dev/0-sample-topic.rst b/Help/release/dev/0-sample-topic.rst new file mode 100644 index 0000000..e4cc01e --- /dev/null +++ b/Help/release/dev/0-sample-topic.rst @@ -0,0 +1,7 @@ +0-sample-topic +-------------- + +* This is a sample release note for the change in a topic. + Developers should add similar notes for each topic branch + making a noteworthy change. Each document should be named + and titled to match the topic name to avoid merge conflicts. diff --git a/Help/release/dev/CPACK_EXTERNAL_BUILT_PACKAGES.rst b/Help/release/dev/CPACK_EXTERNAL_BUILT_PACKAGES.rst new file mode 100644 index 0000000..af446d2 --- /dev/null +++ b/Help/release/dev/CPACK_EXTERNAL_BUILT_PACKAGES.rst @@ -0,0 +1,4 @@ +CPACK_EXTERNAL_BUILT_PACKAGES +----------------------------- + +* :cpack_gen:`CPack External Generator` learned the :variable:`CPACK_EXTERNAL_BUILT_PACKAGES` variable. diff --git a/Help/release/dev/FindSDL-update.rst b/Help/release/dev/FindSDL-update.rst new file mode 100644 index 0000000..a85d2b9 --- /dev/null +++ b/Help/release/dev/FindSDL-update.rst @@ -0,0 +1,11 @@ +FindSDL-update +-------------- + +* The :module:`FindSDL` module now provides: + + * imported target ``SDL::SDL``, + + * result variables ``SDL_LIBRARIES`` and ``SDL_INCLUDE_DIRS``, + + * version variables ``SDL_VERSION``, ``SDL_VERSION_MAJOR`` + ``SDL_VERSION_MINOR``, and ``SDL_VERSION_PATCH``. diff --git a/Help/release/dev/cpack-pre-and-post-build-scripts.rst b/Help/release/dev/cpack-pre-and-post-build-scripts.rst new file mode 100644 index 0000000..bf7958b --- /dev/null +++ b/Help/release/dev/cpack-pre-and-post-build-scripts.rst @@ -0,0 +1,5 @@ +cpack-pre-and-post-build-scripts +-------------------------------- + +* CPack learned the :variable:`CPACK_PRE_BUILD_SCRIPTS`, :variable:`CPACK_POST_BUILD_SCRIPTS`, + and :variable:`CPACK_PACKAGE_FILES` variables. diff --git a/Help/release/dev/deprecate-policy-old.rst b/Help/release/dev/deprecate-policy-old.rst new file mode 100644 index 0000000..1dc01cc --- /dev/null +++ b/Help/release/dev/deprecate-policy-old.rst @@ -0,0 +1,13 @@ +deprecate-policy-old +-------------------- + +* An explicit deprecation diagnostic was added for policy ``CMP0071`` + (``CMP0071`` and below were already deprecated). + The :manual:`cmake-policies(7)` manual explains that the OLD behaviors + of all policies are deprecated and that projects should port to the + NEW behaviors. + +* Compatibility with versions of CMake older than 2.8.12 is now deprecated + and will be removed from a future version. Calls to + :command:`cmake_minimum_required` or :command:`cmake_policy` that set + the policy version to an older value now issue a deprecation diagnostic. diff --git a/Help/release/dev/find_program-exe-no-read.rst b/Help/release/dev/find_program-exe-no-read.rst new file mode 100644 index 0000000..161b5db --- /dev/null +++ b/Help/release/dev/find_program-exe-no-read.rst @@ -0,0 +1,5 @@ +find_program-exe-no-read +------------------------ + +* The :command:`find_program` command now requires permission to execute + but not to read the file found. See policy :policy:`CMP0109`. diff --git a/Help/release/dev/install-default-directory-permissions.rst b/Help/release/dev/install-default-directory-permissions.rst new file mode 100644 index 0000000..27cffee --- /dev/null +++ b/Help/release/dev/install-default-directory-permissions.rst @@ -0,0 +1,5 @@ +install-default-directory-permissions +------------------------------------- + +* The ``--install`` argument of the :manual:`cmake(1)` command line tool gained a + ``--default-directory-permissions`` argument. diff --git a/Help/release/dev/remove-cmake-gui-qt4.rst b/Help/release/dev/remove-cmake-gui-qt4.rst new file mode 100644 index 0000000..2b29b75 --- /dev/null +++ b/Help/release/dev/remove-cmake-gui-qt4.rst @@ -0,0 +1,5 @@ +remove-cmake-gui-qt4 +-------------------- + +* :manual:`cmake-gui(1)` now requires Qt5. Support for compiling with Qt4 has + been removed. diff --git a/Help/release/dev/visual-studio-android.rst b/Help/release/dev/visual-studio-android.rst new file mode 100644 index 0000000..4e1a110 --- /dev/null +++ b/Help/release/dev/visual-studio-android.rst @@ -0,0 +1,7 @@ +visual-studio-android +--------------------- + +* The :ref:`Visual Studio Generators` for Visual Studio 2015 and above gained + support for the Visual Studio Tools for Android. This allows you to set + :variable:`CMAKE_SYSTEM_NAME` to `Android` to generate `.vcxproj` files for + the Android tools. diff --git a/Help/release/index.rst b/Help/release/index.rst index 4578b3a..cdc3e8b 100644 --- a/Help/release/index.rst +++ b/Help/release/index.rst @@ -7,6 +7,8 @@ CMake Release Notes This file should include the adjacent "dev.txt" file in development versions but not in release versions. +.. include:: dev.txt + Releases ======== diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index df48fa5..ebfd5a4 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -248,7 +248,7 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(id_PostBuildEvent_Command "") if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Ll][Ll][Vv][Mm](_v[0-9]+(_xp)?)?$") set(id_cl_var "ClangClExecutable") - elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Cc][Ll][Aa][Nn][Gg][Cc][Ll]$") + elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Cc][Ll][Aa][Nn][Gg]([Cc][Ll]$|_[0-9])") set(id_cl "$(CLToolExe)") elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*") set(id_cl clang.exe) @@ -310,17 +310,36 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} set(id_PreferredToolArchitecture "") endif() if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone") + set(id_keyword "Win32Proj") set(id_system "<ApplicationType>Windows Phone</ApplicationType>") elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(id_keyword "Win32Proj") set(id_system "<ApplicationType>Windows Store</ApplicationType>") + elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") + set(id_keyword "Android") + set(id_system "<ApplicationType>Android</ApplicationType>") else() + set(id_keyword "Win32Proj") set(id_system "") endif() - if(id_system AND CMAKE_SYSTEM_VERSION MATCHES "^([0-9]+\\.[0-9]+)") + if(id_keyword STREQUAL "Android") + if(CMAKE_GENERATOR MATCHES "Visual Studio 14") + set(id_system_version "<ApplicationTypeRevision>2.0</ApplicationTypeRevision>") + elseif(CMAKE_GENERATOR MATCHES "Visual Studio 1[56]") + set(id_system_version "<ApplicationTypeRevision>3.0</ApplicationTypeRevision>") + else() + set(id_system_version "") + endif() + elseif(id_system AND CMAKE_SYSTEM_VERSION MATCHES "^([0-9]+\\.[0-9]+)") set(id_system_version "<ApplicationTypeRevision>${CMAKE_MATCH_1}</ApplicationTypeRevision>") else() set(id_system_version "") endif() + if(id_keyword STREQUAL "Android") + set(id_config_type "DynamicLibrary") + else() + set(id_config_type "Application") + endif() if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION) set(id_WindowsTargetPlatformVersion "<WindowsTargetPlatformVersion>${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}</WindowsTargetPlatformVersion>") endif() @@ -333,9 +352,11 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} string(APPEND id_CustomGlobals "<${CMAKE_MATCH_1}>${CMAKE_MATCH_2}</${CMAKE_MATCH_1}>\n ") endif() endforeach() - if(id_platform STREQUAL ARM64) + if(id_keyword STREQUAL "Android") + set(id_WindowsSDKDesktopARMSupport "") + elseif(id_platform STREQUAL "ARM64") set(id_WindowsSDKDesktopARMSupport "<WindowsSDKDesktopARM64Support>true</WindowsSDKDesktopARM64Support>") - elseif(id_platform STREQUAL ARM) + elseif(id_platform STREQUAL "ARM") set(id_WindowsSDKDesktopARMSupport "<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>") else() set(id_WindowsSDKDesktopARMSupport "") diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 6234b9d..553b966 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -386,6 +386,21 @@ The following variables are for advanced uses of CPack: select the CPack generator(s) to be used when building the ``package`` target or when running :manual:`cpack <cpack(1)>` without the ``-G`` option. +.. variable:: CPACK_PRE_BUILD_SCRIPTS + + List of CMake scripts to execute after CPack has installed the files to + be packed into a staging directory and before producing the result + packages. + +.. variable:: CPACK_POST_BUILD_SCRIPTS + + List of CMake scripts to execute after CPack has produced the result + packages and before copying them back to a build directory. + +.. variable:: CPACK_PACKAGE_FILES + + List of resulting package files passed to the ``CPACK_POST_BUILD_SCRIPTS``. + #]=======================================================================] # Define this var in order to avoid (or warn) concerning multiple inclusion diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake index 2794f52..26a4bbd 100644 --- a/Modules/Compiler/AppleClang-C.cmake +++ b/Modules/Compiler/AppleClang-C.cmake @@ -1,6 +1,8 @@ include(Compiler/Clang) __compiler_clang(C) +set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) + if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") diff --git a/Modules/Compiler/AppleClang-CXX.cmake b/Modules/Compiler/AppleClang-CXX.cmake index 15edc21..611c674 100644 --- a/Modules/Compiler/AppleClang-CXX.cmake +++ b/Modules/Compiler/AppleClang-CXX.cmake @@ -1,6 +1,8 @@ include(Compiler/Clang) __compiler_clang(CXX) +set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) + if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") endif() diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake index 7c4a263..fb6ffa7 100644 --- a/Modules/Compiler/Clang-C.cmake +++ b/Modules/Compiler/Clang-C.cmake @@ -8,6 +8,8 @@ endif() if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC") set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl") +elseif("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") + set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) endif() if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4) diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake index 789e991..311d2b0 100644 --- a/Modules/Compiler/Clang-CXX.cmake +++ b/Modules/Compiler/Clang-CXX.cmake @@ -2,7 +2,9 @@ include(Compiler/Clang) __compiler_clang(CXX) __compiler_clang_cxx_standards(CXX) + if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU") + set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden") endif() diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake index ca286b3..8105a77 100644 --- a/Modules/Compiler/GNU-C.cmake +++ b/Modules/Compiler/GNU-C.cmake @@ -1,6 +1,8 @@ include(Compiler/GNU) __compiler_gnu(C) +set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90") diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake index fcaaeab..59ec056 100644 --- a/Modules/Compiler/GNU-CXX.cmake +++ b/Modules/Compiler/GNU-CXX.cmake @@ -1,6 +1,8 @@ include(Compiler/GNU) __compiler_gnu(CXX) +set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) + if (WIN32) if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fno-keep-inline-dllexport") diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake index ec3bfd8..322f63d 100644 --- a/Modules/Compiler/Intel-C.cmake +++ b/Modules/Compiler/Intel-C.cmake @@ -28,6 +28,8 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC") else() + set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) + if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 15.0.0) set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11") set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11") diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake index b71b946..42adfd1 100644 --- a/Modules/Compiler/Intel-CXX.cmake +++ b/Modules/Compiler/Intel-CXX.cmake @@ -42,6 +42,8 @@ if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") else() + set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.0) set(CMAKE_CXX20_STANDARD_COMPILE_OPTION "-std=c++20") set(CMAKE_CXX20_EXTENSION_COMPILE_OPTION "-std=gnu++20") diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake index 2077bda..78c44d5 100644 --- a/Modules/Compiler/XL-C.cmake +++ b/Modules/Compiler/XL-C.cmake @@ -6,6 +6,8 @@ string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG") # -qthreaded = Ensures that all optimizations will be thread-safe string(APPEND CMAKE_C_FLAGS_INIT " -qthreaded") +set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -qsourcetype=c) + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-qlanglvl=stdc89") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-qlanglvl=extc89") diff --git a/Modules/Compiler/XL-CXX.cmake b/Modules/Compiler/XL-CXX.cmake index 41e3e11..3b911f3 100644 --- a/Modules/Compiler/XL-CXX.cmake +++ b/Modules/Compiler/XL-CXX.cmake @@ -6,6 +6,8 @@ string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG") # -qthreaded = Ensures that all optimizations will be thread-safe string(APPEND CMAKE_CXX_FLAGS_INIT " -qthreaded") +set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -+) + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1) if(CMAKE_SYSTEM MATCHES "Linux") set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") @@ -32,6 +34,3 @@ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1) endif () __compiler_check_default_language_standard(CXX 10.1 98) - -set(CMAKE_CXX_COMPILE_OBJECT - "<CMAKE_CXX_COMPILER> -+ <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>") diff --git a/Modules/Compiler/XLClang-C.cmake b/Modules/Compiler/XLClang-C.cmake index 54c18a6..1668a4d 100644 --- a/Modules/Compiler/XLClang-C.cmake +++ b/Modules/Compiler/XLClang-C.cmake @@ -1,6 +1,8 @@ include(Compiler/XLClang) __compiler_xlclang(C) +set(CMAKE_C_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c) + if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1) set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89") set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu89") diff --git a/Modules/Compiler/XLClang-CXX.cmake b/Modules/Compiler/XLClang-CXX.cmake index 9ea3d7c..02638c7 100644 --- a/Modules/Compiler/XLClang-CXX.cmake +++ b/Modules/Compiler/XLClang-CXX.cmake @@ -1,6 +1,8 @@ include(Compiler/XLClang) __compiler_xlclang(CXX) +set(CMAKE_CXX_COMPILE_OPTIONS_EXPLICIT_LANGUAGE -x c++) + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1.1) set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "") set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "") diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in index b48a332..3598fc7 100644 --- a/Modules/CompilerId/VS-10.vcxproj.in +++ b/Modules/CompilerId/VS-10.vcxproj.in @@ -9,7 +9,7 @@ <PropertyGroup Label="Globals"> <ProjectGuid>{CAE07175-D007-4FC3-BFE8-47B392814159}</ProjectGuid> <RootNamespace>CompilerId@id_lang@</RootNamespace> - <Keyword>Win32Proj</Keyword> + <Keyword>@id_keyword@</Keyword> @id_system@ @id_system_version@ @id_WindowsTargetPlatformVersion@ @@ -24,7 +24,7 @@ @id_PreferredToolArchitecture@ </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@id_platform@'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> + <ConfigurationType>@id_config_type@</ConfigurationType> @id_toolset@ <CharacterSet>MultiByte</CharacterSet> </PropertyGroup> diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake index 4c569b3..29871c5 100644 --- a/Modules/FindBLAS.cmake +++ b/Modules/FindBLAS.cmake @@ -36,7 +36,7 @@ The following variables may be set to influence this module's behavior: * ``SCSL`` * ``SGIMATH`` * ``IBMESSL`` - * ``Intel10_32`` (intel mkl v10 32 bit) + * ``Intel10_32`` (intel mkl v10 32 bit, threaded code) * ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model) * ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model) * ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model) @@ -397,6 +397,10 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") # Add threading/sequential libs set(BLAS_SEARCH_LIBS_WIN_THREAD "") + if(BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") + list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD + "libiomp5md mkl_intel_thread${BLAS_mkl_DLL_SUFFIX}") + endif() if(BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All") # old version list(APPEND BLAS_SEARCH_LIBS_WIN_THREAD @@ -483,7 +487,9 @@ if(BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") endif() set(BLAS_mkl_LIB_PATH_SUFFIXES "compiler/lib" "compiler/lib/${BLAS_mkl_ARCH_NAME}_${BLAS_mkl_OS_NAME}" + "compiler/lib/${BLAS_mkl_ARCH_NAME}" "mkl/lib" "mkl/lib/${BLAS_mkl_ARCH_NAME}_${BLAS_mkl_OS_NAME}" + "mkl/lib/${BLAS_mkl_ARCH_NAME}" "lib/${BLAS_mkl_ARCH_NAME}_${BLAS_mkl_OS_NAME}") foreach(IT ${BLAS_SEARCH_LIBS}) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 13981d3..82dbcb9 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -1270,10 +1270,8 @@ function(_Boost_COMPONENT_HEADERS component _hdrs) set(_Boost_UNIT_TEST_FRAMEWORK_HEADERS "boost/test/framework.hpp") set(_Boost_WAVE_HEADERS "boost/wave.hpp") set(_Boost_WSERIALIZATION_HEADERS "boost/archive/text_wiarchive.hpp") - if(WIN32) - set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp") - set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp") - endif() + set(_Boost_BZIP2_HEADERS "boost/iostreams/filter/bzip2.hpp") + set(_Boost_ZLIB_HEADERS "boost/iostreams/filter/zlib.hpp") string(TOUPPER ${component} uppercomponent) set(${_hdrs} ${_Boost_${uppercomponent}_HEADERS} PARENT_SCOPE) diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake index ba56078..cde3a4d 100644 --- a/Modules/FindCurses.cmake +++ b/Modules/FindCurses.cmake @@ -156,7 +156,9 @@ if(CURSES_USE_NCURSES) CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}" cbreak "" CURSES_NCURSES_HAS_CBREAK) - if(NOT CURSES_NCURSES_HAS_CBREAK) + CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}" + nodelay "" CURSES_NCURSES_HAS_NODELAY) + if(NOT CURSES_NCURSES_HAS_CBREAK OR NOT CURSES_NCURSES_HAS_NODELAY) find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" HINTS "${_cursesLibDir}") find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" ) diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 60a313d..7a1c252 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -125,8 +125,6 @@ The following variables can be set to guide the search for HDF5 libraries and in Set ``true`` to skip trying to find ``hdf5-config.cmake``. #]=======================================================================] -# This module is maintained by Will Dicharry <wdicharry@stellarscience.com>. - include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) @@ -347,6 +345,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var # wrapper exists, but not the compiler. E.g. Miniconda / Anaconda Python execute_process( COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} ${test_file} + WORKING_DIRECTORY ${scratch_dir} RESULT_VARIABLE return_value ) if(return_value) @@ -355,6 +354,7 @@ function( _HDF5_invoke_compiler language output_var return_value_var version_var else() execute_process( COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -show ${lib_type_args} ${test_file} + WORKING_DIRECTORY ${scratch_dir} OUTPUT_VARIABLE output ERROR_VARIABLE output RESULT_VARIABLE return_value diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index e275946..01ce074 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -28,7 +28,7 @@ The following variables may be set to influence this module's behavior: * ``OpenBLAS`` * ``FLAME`` - * ``Intel10_32`` (intel mkl v10 32 bit) + * ``Intel10_32`` (intel mkl v10 32 bit, threaded code) * ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model) * ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model) * ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model) @@ -289,7 +289,9 @@ if(BLAS_FOUND) endif() set(LAPACK_mkl_LIB_PATH_SUFFIXES "compiler/lib" "compiler/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}" + "compiler/lib/${LAPACK_mkl_ARCH_NAME}" "mkl/lib" "mkl/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}" + "mkl/lib/${LAPACK_mkl_ARCH_NAME}" "lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}") # First try empty lapack libs diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake index 8d793a9..59eddbb 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -5,24 +5,54 @@ FindSDL ------- -Locate SDL library +Locate the SDL library -This module defines -:: +Imported targets +^^^^^^^^^^^^^^^^ - SDL_LIBRARY, the name of the library to link against - SDL_FOUND, if false, do not try to link to SDL - SDL_INCLUDE_DIR, where to find SDL.h - SDL_VERSION_STRING, human-readable string containing the version of SDL +This module defines the following :prop_tgt:`IMPORTED` target: +``SDL::SDL`` + The SDL library, if found +Result variables +^^^^^^^^^^^^^^^^ -This module responds to the flag: +This module will set the following variables in your project: + +``SDL_INCLUDE_DIRS`` + where to find SDL.h +``SDL_LIBRARIES`` + the name of the library to link against +``SDL_FOUND`` + if false, do not try to link to SDL +``SDL_VERSION`` + the human-readable string containing the version of SDL if found +``SDL_VERSION_MAJOR`` + SDL major version +``SDL_VERSION_MINOR`` + SDL minor version +``SDL_VERSION_PATCH`` + SDL patch version + +Cache variables +^^^^^^^^^^^^^^^ + +These variables may optionally be set to help this module find the correct files: -:: +``SDL_INCLUDE_DIR`` + where to find SDL.h +``SDL_LIBRARY`` + the name of the library to link against + + +Variables for locating SDL +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This module responds to the flag: - SDL_BUILDING_LIBRARY +``SDL_BUILDING_LIBRARY`` If this is defined, then no SDL_main will be linked in because only applications need main(). Otherwise, it is assumed you are building an application and this @@ -30,6 +60,15 @@ This module responds to the flag: as part of the returned SDL_LIBRARY variable. +Obsolete variables +^^^^^^^^^^^^^^^^^^ + +These variables are obsolete and provided for backwards compatibility: + +``SDL_VERSION_STRING`` + the human-readable string containing the version of SDL if found. + Identical to SDL_VERSION + Don't forget to include SDLmain.h and SDLmain.m your project for the OS X framework based version. (Other versions link to -lSDLmain which @@ -52,15 +91,6 @@ does not get created. $SDLDIR is an environment variable that would correspond to the ./configure --prefix=$SDLDIR used in building SDL. l.e.galup 9-20-02 -Modified by Eric Wing. Added code to assist with automated building -by using environmental variables and providing a more -controlled/consistent search behavior. Added new modifications to -recognize OS X frameworks and additional Unix paths (FreeBSD, etc). -Also corrected the header search path to follow "proper" SDL -guidelines. Added a search for SDLmain which is needed by some -platforms. Added a search for threads which is needed by some -platforms. Added needed compile switches for MinGW. - On OSX, this will prefer the Framework version (if found) over others. People will have to manually change the cache values of SDL_LIBRARY to override this selection or set the CMake environment @@ -174,13 +204,11 @@ if(SDL_INCLUDE_DIR AND EXISTS "${SDL_INCLUDE_DIR}/SDL_version.h") string(REGEX REPLACE "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MAJOR "${SDL_VERSION_MAJOR_LINE}") string(REGEX REPLACE "^#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MINOR "${SDL_VERSION_MINOR_LINE}") string(REGEX REPLACE "^#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_VERSION_PATCH "${SDL_VERSION_PATCH_LINE}") - set(SDL_VERSION_STRING ${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_PATCH}) unset(SDL_VERSION_MAJOR_LINE) unset(SDL_VERSION_MINOR_LINE) unset(SDL_VERSION_PATCH_LINE) - unset(SDL_VERSION_MAJOR) - unset(SDL_VERSION_MINOR) - unset(SDL_VERSION_PATCH) + set(SDL_VERSION ${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_PATCH}) + set(SDL_VERSION_STRING ${SDL_VERSION}) endif() include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) @@ -188,3 +216,14 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR VERSION_VAR SDL_VERSION_STRING) + +if(SDL_FOUND) + set(SDL_LIBRARIES ${SDL_LIBRARY}) + set(SDL_INCLUDE_DIRS ${SDL_INCLUDE_DIR}) + if(NOT TARGET SDL::SDL) + add_library(SDL::SDL INTERFACE IMPORTED) + set_target_properties(SDL::SDL PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${SDL_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${SDL_LIBRARY}") + endif() +endif() diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake index 759448b..160eada 100644 --- a/Modules/Platform/Android-Clang.cmake +++ b/Modules/Platform/Android-Clang.cmake @@ -53,4 +53,7 @@ macro(__android_compiler_clang lang) endif() list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}") endif() + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set(_ANDROID_STL_NOSTDLIBXX 1) + endif() endmacro() diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake index 2225897..11a0504 100644 --- a/Modules/Platform/Android-Determine.cmake +++ b/Modules/Platform/Android-Determine.cmake @@ -7,8 +7,8 @@ # Support for NVIDIA Nsight Tegra Visual Studio Edition was previously # implemented in the CMake VS IDE generators. Avoid interfering with -# that functionality for now. Later we may try to integrate this. -if(CMAKE_GENERATOR MATCHES "Visual Studio") +# that functionality for now. +if(CMAKE_GENERATOR_PLATFORM STREQUAL "Tegra-Android") return() endif() @@ -27,6 +27,63 @@ endif() cmake_policy(PUSH) cmake_policy(SET CMP0057 NEW) # if IN_LIST +# If using Android tools for Visual Studio, compile a sample project to get the +# sysroot. +if(CMAKE_GENERATOR MATCHES "Visual Studio") + if(NOT CMAKE_SYSROOT) + set(vcx_platform ${CMAKE_GENERATOR_PLATFORM}) + if(CMAKE_GENERATOR MATCHES "Visual Studio 1[45]") + set(vcx_sysroot_var "Sysroot") + else() + set(vcx_sysroot_var "SysrootLink") + endif() + if(CMAKE_GENERATOR MATCHES "Visual Studio 14") + set(vcx_revision "2.0") + elseif(CMAKE_GENERATOR MATCHES "Visual Studio 1[56]") + set(vcx_revision "3.0") + else() + set(vcx_revision "") + endif() + configure_file(${CMAKE_ROOT}/Modules/Platform/Android/VCXProjInspect.vcxproj.in + ${CMAKE_PLATFORM_INFO_DIR}/VCXProjInspect.vcxproj @ONLY) + execute_process( + COMMAND "${CMAKE_VS_MSBUILD_COMMAND}" "VCXProjInspect.vcxproj" + "/p:Configuration=Debug" "/p:Platform=${vcx_platform}" + WORKING_DIRECTORY ${CMAKE_PLATFORM_INFO_DIR} + OUTPUT_VARIABLE VCXPROJ_INSPECT_OUTPUT + ERROR_VARIABLE VCXPROJ_INSPECT_OUTPUT + RESULT_VARIABLE VCXPROJ_INSPECT_RESULT + ) + if(NOT CMAKE_SYSROOT AND VCXPROJ_INSPECT_OUTPUT MATCHES "CMAKE_SYSROOT=([^%\r\n]+)[\r\n]") + # Strip VS diagnostic output from the end of the line. + string(REGEX REPLACE " \\(TaskId:[0-9]*\\)$" "" _sysroot "${CMAKE_MATCH_1}") + if(EXISTS "${_sysroot}") + file(TO_CMAKE_PATH "${_sysroot}" CMAKE_SYSROOT) + endif() + endif() + if(VCXPROJ_INSPECT_RESULT) + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Determining the sysroot for the Android NDK failed. +The output was: +${VCXPROJ_INSPECT_RESULT} +${VCXPROJ_INSPECT_OUTPUT} + +") + else() + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Determining the sysroot for the Android NDK succeeded. +The output was: +${VCXPROJ_INSPECT_RESULT} +${VCXPROJ_INSPECT_OUTPUT} + +") + endif() + endif() + if(NOT CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION) + set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION "clang") + endif() +endif() + # If the user provided CMAKE_SYSROOT for us, extract information from it. set(_ANDROID_SYSROOT_NDK "") set(_ANDROID_SYSROOT_API "") diff --git a/Modules/Platform/Android-Initialize.cmake b/Modules/Platform/Android-Initialize.cmake index b90dd7a..5019c28 100644 --- a/Modules/Platform/Android-Initialize.cmake +++ b/Modules/Platform/Android-Initialize.cmake @@ -6,7 +6,7 @@ # Support for NVIDIA Nsight Tegra Visual Studio Edition was previously # implemented in the CMake VS IDE generators. Avoid interfering with -# that functionality for now. Later we may try to integrate this. +# that functionality for now. if(CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android") return() endif() diff --git a/Modules/Platform/Android/VCXProjInspect.vcxproj.in b/Modules/Platform/Android/VCXProjInspect.vcxproj.in new file mode 100644 index 0000000..6919d2c --- /dev/null +++ b/Modules/Platform/Android/VCXProjInspect.vcxproj.in @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|@vcx_platform@"> + <Configuration>Debug</Configuration> + <Platform>@vcx_platform@</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{14D44772-ECF7-47BD-9E29-BC62FAF940A5}</ProjectGuid> + <RootNamespace>VCXProjInspect</RootNamespace> + <Keyword>Android</Keyword> + <ApplicationType>Android</ApplicationType> + <ApplicationTypeRevision>@vcx_revision@</ApplicationTypeRevision> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@vcx_platform@'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|@vcx_platform@'">false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@vcx_platform@'"> + <PostBuildEvent> + <Command>%40echo CMAKE_SYSROOT=$(@vcx_sysroot_var@)</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 04d083b..e4bd907 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,8 +1,8 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 18) -set(CMake_VERSION_PATCH 0) -set(CMake_VERSION_RC 2) +set(CMake_VERSION_PATCH 20200629) +#set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) # Start with the full version number used in tags. It has no dev info. diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx index 11e1aec..53be4fe 100644 --- a/Source/CPack/cmCPackExternalGenerator.cxx +++ b/Source/CPack/cmCPackExternalGenerator.cxx @@ -75,6 +75,12 @@ int cmCPackExternalGenerator::PackageFiles() if (cmSystemTools::GetErrorOccuredFlag() || !res) { return 0; } + + const char* builtPackagesStr = + this->GetOption("CPACK_EXTERNAL_BUILT_PACKAGES"); + if (builtPackagesStr) { + cmExpandList(builtPackagesStr, this->packageFileNames, false); + } } return 1; diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 288dc58..7990504 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -264,6 +264,23 @@ int cmCPackGenerator::InstallProject() return 0; } + // Run pre-build actions + const char* preBuildScripts = this->GetOption("CPACK_PRE_BUILD_SCRIPTS"); + if (preBuildScripts) { + const auto scripts = cmExpandedList(preBuildScripts, false); + for (const auto& script : scripts) { + cmCPackLogger(cmCPackLog::LOG_OUTPUT, + "Executing pre-build script: " << script << std::endl); + + if (!this->MakefileMap->ReadListFile(script)) { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "The pre-build script not found: " << script + << std::endl); + return 0; + } + } + } + if (setDestDir) { cmSystemTools::PutEnv("DESTDIR="); } @@ -333,7 +350,8 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( if (installDirectoriesVector.size() % 2 != 0) { cmCPackLogger( cmCPackLog::LOG_ERROR, - "CPACK_INSTALLED_DIRECTORIES should contain pairs of <directory> and " + "CPACK_INSTALLED_DIRECTORIES should contain pairs of <directory> " + "and " "<subdirectory>. The <subdirectory> can be '.' to be installed in " "the toplevel directory of installation." << std::endl); @@ -475,10 +493,10 @@ int cmCPackGenerator::InstallProjectViaInstallScript( "- Install script: " << installScript << std::endl); if (setDestDir) { - // For DESTDIR based packaging, use the *project* CMAKE_INSTALL_PREFIX - // underneath the tempInstallDirectory. The value of the project's - // CMAKE_INSTALL_PREFIX is sent in here as the value of the - // CPACK_INSTALL_PREFIX variable. + // For DESTDIR based packaging, use the *project* + // CMAKE_INSTALL_PREFIX underneath the tempInstallDirectory. The + // value of the project's CMAKE_INSTALL_PREFIX is sent in here as the + // value of the CPACK_INSTALL_PREFIX variable. std::string dir; if (this->GetOption("CPACK_INSTALL_PREFIX")) { @@ -1076,6 +1094,25 @@ int cmCPackGenerator::DoPackage() return 0; } } + // Run post-build actions + const char* postBuildScripts = this->GetOption("CPACK_POST_BUILD_SCRIPTS"); + if (postBuildScripts) { + this->MakefileMap->AddDefinition("CPACK_PACKAGE_FILES", + cmJoin(this->packageFileNames, ";")); + + const auto scripts = cmExpandedList(postBuildScripts, false); + for (const auto& script : scripts) { + cmCPackLogger(cmCPackLog::LOG_OUTPUT, + "Executing post-build script: " << script << std::endl); + + if (!this->MakefileMap->ReadListFile(script)) { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "The post-build script not found: " << script + << std::endl); + return 0; + } + } + } /* Prepare checksum algorithm*/ const char* algo = this->GetOption("CPACK_PACKAGE_CHECKSUM"); @@ -1378,7 +1415,8 @@ int cmCPackGenerator::PrepareGroupingKind() << std::endl); } - // if user specified packaging method, override the default packaging method + // if user specified packaging method, override the default packaging + // method if (method != UNKNOWN_COMPONENT_PACKAGE_METHOD) { componentPackageMethod = method; } diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 9a26db5..85e256b 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -2,11 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include <csignal> +#include <cstdio> +#include <cstdlib> #include <cstring> #include <iostream> #include <string> #include <vector> +#include <unistd.h> + #include "cmsys/Encoding.hxx" #include "cmCursesColor.h" @@ -54,7 +58,12 @@ void onsig(int /*unused*/) { if (cmCursesForm::CurrentForm) { endwin(); - initscr(); /* Initialization */ + if (initscr() == nullptr) { + static const char errmsg[] = "Error: ncurses initialization failed\n"; + auto r = write(STDERR_FILENO, errmsg, sizeof(errmsg) - 1); + static_cast<void>(r); + exit(1); + } noecho(); /* Echo off */ cbreak(); /* nl- or cr not needed */ keypad(stdscr, true); /* Use key symbols as KEY_DOWN */ @@ -124,7 +133,10 @@ int main(int argc, char const* const* argv) cmCursesForm::DebugStart(); } - initscr(); /* Initialization */ + if (initscr() == nullptr) { + fprintf(stderr, "Error: ncurses initialization failed\n"); + exit(1); + } noecho(); /* Echo off */ cbreak(); /* nl- or cr not needed */ keypad(stdscr, true); /* Use key symbols as KEY_DOWN */ diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 98dd0e2..e6d6b17 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -3,111 +3,79 @@ project(QtDialog) CMake_OPTIONAL_COMPONENT(cmake-gui) -find_package(Qt5Widgets QUIET) -if (Qt5Widgets_FOUND) - include_directories(${Qt5Widgets_INCLUDE_DIRS}) - add_definitions(${Qt5Widgets_DEFINITONS}) - macro(qt4_wrap_ui) - qt5_wrap_ui(${ARGN}) - endmacro() - macro(qt4_wrap_cpp) - qt5_wrap_cpp(${ARGN}) - endmacro() - macro(qt4_add_resources) - qt5_add_resources(${ARGN}) - endmacro() +find_package(Qt5Widgets REQUIRED) - set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES}) - set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES}) +set(CMake_QT_EXTRA_LIBRARIES) - # Try to find the package WinExtras for the task bar progress - if(WIN32) - find_package(Qt5WinExtras QUIET) - if (Qt5WinExtras_FOUND) - include_directories(${Qt5WinExtras_INCLUDE_DIRS}) - add_definitions(-DQT_WINEXTRAS) - list(APPEND CMake_QT_LIBRARIES ${Qt5WinExtras_LIBRARIES}) - endif() +# Try to find the package WinExtras for the task bar progress +if(WIN32) + find_package(Qt5WinExtras QUIET) + if (Qt5WinExtras_FOUND) + add_definitions(-DQT_WINEXTRAS) + list(APPEND CMake_QT_EXTRA_LIBRARIES Qt5::WinExtras) endif() +endif() - # Remove this when the minimum version of Qt is 4.6. - add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0) - - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") - if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES) - list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES}) - set_property(SOURCE CMakeSetup.cxx - PROPERTY COMPILE_DEFINITIONS USE_QXcbIntegrationPlugin) - endif() +if(CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES) + list(APPEND CMake_QT_EXTRA_LIBRARIES ${CMake_QT_STATIC_QXcbIntegrationPlugin_LIBRARIES}) + set_property(SOURCE CMakeSetup.cxx + PROPERTY COMPILE_DEFINITIONS USE_QXcbIntegrationPlugin) +endif() - if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) - list(APPEND CMake_QT_LIBRARIES ${CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES}) - set_property(SOURCE CMakeSetup.cxx - PROPERTY COMPILE_DEFINITIONS USE_QWindowsIntegrationPlugin) - endif() +if(CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) + list(APPEND CMake_QT_EXTRA_LIBRARIES ${CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES}) + set_property(SOURCE CMakeSetup.cxx + PROPERTY COMPILE_DEFINITIONS USE_QWindowsIntegrationPlugin) +endif() - # We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows. - # FIXME: This should be part of Qt5 CMake scripts, but unfortunately - # Qt5 support is missing there. - if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) - macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var) - get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION) - if(EXISTS "${_qt_plugin_path}") - get_filename_component(_qt_plugin_file "${_qt_plugin_path}" NAME) - get_filename_component(_qt_plugin_type "${_qt_plugin_path}" PATH) - get_filename_component(_qt_plugin_type "${_qt_plugin_type}" NAME) - if(APPLE) - set(_qt_plugin_dir "PlugIns") - elseif(WIN32) - set(_qt_plugin_dir "plugins") - endif() - set(_qt_plugin_dest "${_qt_plugin_dir}/${_qt_plugin_type}") - install(FILES "${_qt_plugin_path}" - DESTINATION "${_qt_plugin_dest}" - ${COMPONENT}) - set(${_qt_plugins_var} - "${${_qt_plugins_var}};\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_qt_plugin_dest}/${_qt_plugin_file}") - else() - message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found") +# We need to install platform plugin and add qt.conf for Qt5 on Mac and Windows. +# FIXME: This should be part of Qt5 CMake scripts, but unfortunately +# Qt5 support is missing there. +if(CMake_INSTALL_DEPENDENCIES AND (APPLE OR WIN32)) + macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var) + get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION) + if(EXISTS "${_qt_plugin_path}") + get_filename_component(_qt_plugin_file "${_qt_plugin_path}" NAME) + get_filename_component(_qt_plugin_type "${_qt_plugin_path}" PATH) + get_filename_component(_qt_plugin_type "${_qt_plugin_type}" NAME) + if(APPLE) + set(_qt_plugin_dir "PlugIns") + elseif(WIN32) + set(_qt_plugin_dir "plugins") endif() - endmacro() - if(APPLE) - install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS) - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - "[Paths]\nPlugins = ${_qt_plugin_dir}\n") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" + set(_qt_plugin_dest "${_qt_plugin_dir}/${_qt_plugin_type}") + install(FILES "${_qt_plugin_path}" + DESTINATION "${_qt_plugin_dest}" ${COMPONENT}) - elseif(WIN32 AND NOT CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) - install_qt5_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS) - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - "[Paths]\nPlugins = ../${_qt_plugin_dir}\n") - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" - DESTINATION bin - ${COMPONENT}) - endif() - endif() - - if(TARGET Qt5::Core) - get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION) - get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH) - if(APPLE) - get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH) + set(${_qt_plugins_var} + "${${_qt_plugins_var}};\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${_qt_plugin_dest}/${_qt_plugin_file}") + else() + message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found") endif() + endmacro() + if(APPLE) + install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + "[Paths]\nPlugins = ${_qt_plugin_dir}\n") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + DESTINATION "${CMAKE_INSTALL_PREFIX}/Resources" + ${COMPONENT}) + elseif(WIN32 AND NOT CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES) + install_qt5_plugin("Qt5::QWindowsIntegrationPlugin" QT_PLUGINS) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + "[Paths]\nPlugins = ../${_qt_plugin_dir}\n") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/qt.conf" + DESTINATION bin + ${COMPONENT}) endif() -else() - set(QT_MIN_VERSION "4.4.0") - find_package(Qt4 REQUIRED) - if(NOT QT4_FOUND) - message(SEND_ERROR "Failed to find Qt 4.4 or greater.") - return() - endif() - - include(${QT_USE_FILE}) - - set(CMake_QT_LIBRARIES ${QT_LIBRARIES}) +endif() +get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION) +get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH) +if(APPLE) + get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH) endif() set(SRCS @@ -116,6 +84,7 @@ set(SRCS CMakeSetup.cxx CMakeSetupDialog.cxx CMakeSetupDialog.h + Compilers.h FirstConfigure.cxx FirstConfigure.h QCMake.cxx @@ -129,7 +98,7 @@ set(SRCS WarningMessagesDialog.cxx WarningMessagesDialog.h ) -QT4_WRAP_UI(UI_SRCS +qt5_wrap_ui(UI_SRCS CMakeSetupDialog.ui Compilers.ui CrossCompiler.ui @@ -137,7 +106,7 @@ QT4_WRAP_UI(UI_SRCS RegexExplorer.ui WarningMessagesDialog.ui ) -QT4_WRAP_CPP(MOC_SRCS +qt5_wrap_cpp(MOC_SRCS AddCacheEntry.h Compilers.h CMakeSetupDialog.h @@ -148,14 +117,24 @@ QT4_WRAP_CPP(MOC_SRCS RegexExplorer.h WarningMessagesDialog.h ) -QT4_ADD_RESOURCES(RC_SRCS CMakeSetup.qrc) +qt5_add_resources(RC_SRCS CMakeSetup.qrc) + +if (FALSE) # CMake's bootstrap binary does not support automoc + set(CMAKE_AUTOMOC 1) + set(CMAKE_AUTORCC 1) + set(CMAKE_AUTOUIC 1) +else () + list(APPEND SRCS + ${UI_SRCS} + ${MOC_SRCS} + ${RC_SRCS}) +endif () -set(SRCS ${SRCS} ${UI_SRCS} ${MOC_SRCS} ${RC_SRCS}) if(WIN32) - set(SRCS ${SRCS} CMakeSetup.rc) + list(APPEND SRCS CMakeSetup.rc) endif() if(APPLE) - set(SRCS ${SRCS} CMakeSetup.icns) + list(APPEND SRCS CMakeSetup.icns) set(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns) set_source_files_properties(CMakeSetup.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) @@ -172,7 +151,7 @@ endif() set(CMAKE_INCLUDE_CURRENT_DIR ON) add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS} ${MANIFEST_FILE}) -target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${CMake_QT_LIBRARIES}) +target_link_libraries(cmake-gui CMakeLib Qt5::Core Qt5::Widgets ${CMake_QT_EXTRA_LIBRARIES}) if(WIN32) target_sources(cmake-gui PRIVATE $<TARGET_OBJECTS:CMakeVersion>) diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 9d928b2..7ef5a72 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -115,14 +115,6 @@ int main(int argc, char** argv) QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8"); QTextCodec::setCodecForLocale(utf8_codec); -#if QT_VERSION < 0x050000 - // clean out standard Qt paths for plugins, which we don't use anyway - // when creating Mac bundles, it potentially causes problems - foreach (QString p, QApplication::libraryPaths()) { - QApplication::removeLibraryPath(p); - } -#endif - // tell the cmake library where cmake is QDir cmExecDir(QApplication::applicationDirPath()); #if defined(Q_OS_MAC) diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 776af81..f0b967b 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -340,10 +340,10 @@ void QCMake::interrupt() bool QCMake::interruptCallback() { -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - return this->InterruptFlag; -#else +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) return this->InterruptFlag.load(); +#else + return this->InterruptFlag.loadRelaxed(); #endif } diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 541d3e9..928494b 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -155,11 +155,7 @@ QModelIndex QCMakeCacheView::moveCursor(CursorAction act, void QCMakeCacheView::setShowAdvanced(bool s) { -#if QT_VERSION >= 040300 - // new 4.3 API that needs to be called. what about an older Qt? this->SearchFilter->invalidate(); -#endif - this->AdvancedFilter->setShowAdvanced(s); } @@ -209,9 +205,7 @@ void QCMakeCacheModel::clear() void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) this->beginResetModel(); -#endif QSet<QCMakeProperty> newProps; QSet<QCMakeProperty> newProps2; @@ -334,11 +328,7 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) } this->blockSignals(b); -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) this->endResetModel(); -#else - this->reset(); -#endif } QCMakeCacheModel::ViewType QCMakeCacheModel::viewType() const @@ -348,9 +338,7 @@ QCMakeCacheModel::ViewType QCMakeCacheModel::viewType() const void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) this->beginResetModel(); -#endif this->View = t; @@ -367,11 +355,7 @@ void QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType t) this->setProperties(oldProps); this->setProperties(props); this->blockSignals(b); -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) this->endResetModel(); -#else - this->reset(); -#endif } void QCMakeCacheModel::setPropertyData(const QModelIndex& idx1, @@ -497,8 +481,7 @@ QCMakePropertyList QCMakeCacheModel::properties() const // go to the next in the tree while (!idxs.isEmpty() && ( -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) && \ - QT_VERSION < QT_VERSION_CHECK(5, 1, 0) +#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) (idxs.last().row() + 1) >= rowCount(idxs.last().parent()) || #endif !idxs.last().sibling(idxs.last().row() + 1, 0).isValid())) { @@ -658,20 +641,6 @@ bool QCMakeCacheModelDelegate::editorEvent(QEvent* e, return success; } -// Issue 205903 fixed in Qt 4.5.0. -// Can remove this function and FileDialogFlag when minimum Qt version is 4.5 -bool QCMakeCacheModelDelegate::eventFilter(QObject* object, QEvent* evt) -{ - // workaround for what looks like a bug in Qt on macOS - // where it doesn't create a QWidget wrapper for the native file dialog - // so the Qt library ends up assuming the focus was lost to something else - - if (evt->type() == QEvent::FocusOut && this->FileDialogFlag) { - return false; - } - return QItemDelegate::eventFilter(object, evt); -} - void QCMakeCacheModelDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const diff --git a/Source/QtDialog/QCMakeCacheView.h b/Source/QtDialog/QCMakeCacheView.h index bea1965..a252708 100644 --- a/Source/QtDialog/QCMakeCacheView.h +++ b/Source/QtDialog/QCMakeCacheView.h @@ -144,7 +144,6 @@ public: bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& index); - bool eventFilter(QObject* object, QEvent* event); void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; QSize sizeHint(const QStyleOptionViewItem& option, diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx index 332a770..d16ea58 100644 --- a/Source/QtDialog/QCMakeWidgets.cxx +++ b/Source/QtDialog/QCMakeWidgets.cxx @@ -4,9 +4,9 @@ #include <utility> -#include <QDirModel> #include <QFileDialog> #include <QFileInfo> +#include <QFileSystemModel> #include <QResizeEvent> #include <QToolButton> @@ -88,20 +88,20 @@ void QCMakePathEditor::chooseFile() } } -// use same QDirModel for all completers -static QDirModel* fileDirModel() +// use same QFileSystemModel for all completers +static QFileSystemModel* fileDirModel() { - static QDirModel* m = nullptr; + static QFileSystemModel* m = nullptr; if (!m) { - m = new QDirModel(); + m = new QFileSystemModel(); } return m; } -static QDirModel* pathDirModel() +static QFileSystemModel* pathDirModel() { - static QDirModel* m = nullptr; + static QFileSystemModel* m = nullptr; if (!m) { - m = new QDirModel(); + m = new QFileSystemModel(); m->setFilter(QDir::AllDirs | QDir::Drives | QDir::NoDotAndDotDot); } return m; @@ -110,7 +110,7 @@ static QDirModel* pathDirModel() QCMakeFileCompleter::QCMakeFileCompleter(QObject* o, bool dirs) : QCompleter(o) { - QDirModel* m = dirs ? pathDirModel() : fileDirModel(); + QFileSystemModel* m = dirs ? pathDirModel() : fileDirModel(); this->setModel(m); } diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index d6f7500e..53d4cb4 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -55,7 +55,7 @@ bool cmAuxSourceDirectoryCommand(std::vector<std::string> const& args, auto ext = cm::string_view(file).substr(dotpos + 1); // Process only source files auto cm = mf.GetCMakeInstance(); - if (dotpos > 0 && cm->IsSourceExtension(ext)) { + if (dotpos > 0 && cm->IsACLikeSourceExtension(ext)) { std::string fullname = cmStrCat(templateDirectory, '/', file); // add the file as a class file so // depends can be done diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 8550d04..7fbe90e 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -25,77 +25,205 @@ #include "cmVersion.h" #include "cmake.h" -static std::string const kCMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN = - "CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN"; -static std::string const kCMAKE_C_COMPILER_TARGET = "CMAKE_C_COMPILER_TARGET"; -static std::string const kCMAKE_C_LINK_NO_PIE_SUPPORTED = - "CMAKE_C_LINK_NO_PIE_SUPPORTED"; -static std::string const kCMAKE_C_LINK_PIE_SUPPORTED = - "CMAKE_C_LINK_PIE_SUPPORTED"; -static std::string const kCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN = - "CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN"; -static std::string const kCMAKE_CXX_COMPILER_TARGET = - "CMAKE_CXX_COMPILER_TARGET"; -static std::string const kCMAKE_CXX_LINK_NO_PIE_SUPPORTED = - "CMAKE_CXX_LINK_NO_PIE_SUPPORTED"; -static std::string const kCMAKE_CXX_LINK_PIE_SUPPORTED = - "CMAKE_CXX_LINK_PIE_SUPPORTED"; -static std::string const kCMAKE_CUDA_ARCHITECTURES = - "CMAKE_CUDA_ARCHITECTURES"; -static std::string const kCMAKE_CUDA_COMPILER_TARGET = - "CMAKE_CUDA_COMPILER_TARGET"; -static std::string const kCMAKE_CUDA_RUNTIME_LIBRARY = - "CMAKE_CUDA_RUNTIME_LIBRARY"; -static std::string const kCMAKE_ENABLE_EXPORTS = "CMAKE_ENABLE_EXPORTS"; -static std::string const kCMAKE_LINK_SEARCH_END_STATIC = +namespace { +class LanguageStandardState +{ +public: + LanguageStandardState(std::string&& lang) + : IsEnabled(false) + , DidStandard(false) + , DidStandardRequired(false) + , DidExtensions(false) + , StandardFlag(lang + "_STANDARD") + , RequiredFlag(lang + "_STANDARD_REQUIRED") + , ExtensionFlag(lang + "_EXTENSIONS") + { + } + + void Enabled(bool isEnabled) { this->IsEnabled = isEnabled; } + + bool UpdateIfMatches(std::vector<std::string> const& argv, size_t& index) + { + bool updated = false; + if (argv[index] == this->StandardFlag) { + this->DidStandard = true; + this->StandardValue = argv[++index]; + updated = true; + } else if (argv[index] == this->RequiredFlag) { + this->DidStandardRequired = true; + this->RequiredValue = argv[++index]; + updated = true; + } else if (argv[index] == this->ExtensionFlag) { + this->DidExtensions = true; + this->ExtensionValue = argv[++index]; + updated = true; + } + return updated; + } + + bool Validate(cmMakefile* const makefile) const + { + if (this->DidStandard) { + makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat(this->StandardFlag, + " allowed only in source file signature.")); + return false; + } + if (this->DidStandardRequired) { + makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat(this->RequiredFlag, + " allowed only in source file signature.")); + return false; + } + if (this->DidExtensions) { + makefile->IssueMessage( + MessageType::FATAL_ERROR, + cmStrCat(this->ExtensionFlag, + " allowed only in source file signature.")); + return false; + } + + return true; + } + + bool DidNone() const + { + return !this->DidStandard && !this->DidStandardRequired && + !this->DidExtensions; + } + + void LoadUnsetPropertyValues(cmMakefile* const makefile, bool honorStandard, + bool warnCMP0067, + std::vector<std::string>& warnCMP0067Variables) + { + if (!this->IsEnabled) { + return; + } + + auto lookupStdVar = [&](std::string const& var) -> std::string { + std::string value = makefile->GetSafeDefinition(var); + if (warnCMP0067 && !value.empty()) { + value.clear(); + warnCMP0067Variables.push_back(var); + } + return value; + }; + + if (honorStandard || warnCMP0067) { + if (!this->DidStandard) { + this->StandardValue = + lookupStdVar(cmStrCat("CMAKE_", this->StandardFlag)); + } + if (!this->DidStandardRequired) { + this->RequiredValue = + lookupStdVar(cmStrCat("CMAKE_", this->RequiredFlag)); + } + if (!this->DidExtensions) { + this->ExtensionValue = + lookupStdVar(cmStrCat("CMAKE_", this->ExtensionFlag)); + } + } + } + + void WriteProperties(FILE* fout, std::string const& targetName) const + { + if (!this->IsEnabled) { + return; + } + + auto writeProp = [&](std::string const& prop, std::string const& value) { + fprintf(fout, "set_property(TARGET %s PROPERTY %s %s)\n", + targetName.c_str(), + cmOutputConverter::EscapeForCMake(prop).c_str(), + cmOutputConverter::EscapeForCMake(value).c_str()); + }; + + if (!this->StandardValue.empty()) { + writeProp(this->StandardFlag, this->StandardValue); + } + if (!this->RequiredValue.empty()) { + writeProp(this->RequiredFlag, this->RequiredValue); + } + if (!this->ExtensionValue.empty()) { + writeProp(this->ExtensionFlag, this->ExtensionValue); + } + } + +private: + bool IsEnabled; + bool DidStandard; + bool DidStandardRequired; + bool DidExtensions; + + std::string StandardFlag; + std::string RequiredFlag; + std::string ExtensionFlag; + + std::string StandardValue; + std::string RequiredValue; + std::string ExtensionValue; +}; + +constexpr size_t lang_property_start = 0; +constexpr size_t lang_property_size = 4; +constexpr size_t pie_property_start = 4; +constexpr size_t pie_property_size = 2; +#define SETUP_LANGUAGE(name, lang) \ + static const std::string name[lang_property_size + pie_property_size + 1] = \ + { "CMAKE_" #lang "_COMPILER_EXTERNAL_TOOLCHAIN", \ + "CMAKE_" #lang "_COMPILER_TARGET", \ + "CMAKE_" #lang "_LINK_NO_PIE_SUPPORTED", \ + "CMAKE_" #lang "_PIE_SUPPORTED", "" } + +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(c_properties, C); +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(cxx_properties, CXX); + +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(cuda_properties, CUDA); +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(fortran_properties, Fortran); +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(objc_properties, OBJC); +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(objcxx_properties, OBJCXX); +// NOLINTNEXTLINE(bugprone-suspicious-missing-comma) +SETUP_LANGUAGE(swift_properties, Swift); +#undef SETUP_LANGUAGE + +std::string const kCMAKE_CUDA_ARCHITECTURES = "CMAKE_CUDA_ARCHITECTURES"; +std::string const kCMAKE_CUDA_RUNTIME_LIBRARY = "CMAKE_CUDA_RUNTIME_LIBRARY"; +std::string const kCMAKE_ENABLE_EXPORTS = "CMAKE_ENABLE_EXPORTS"; +std::string const kCMAKE_LINK_SEARCH_END_STATIC = "CMAKE_LINK_SEARCH_END_STATIC"; -static std::string const kCMAKE_LINK_SEARCH_START_STATIC = +std::string const kCMAKE_LINK_SEARCH_START_STATIC = "CMAKE_LINK_SEARCH_START_STATIC"; -static std::string const kCMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT = +std::string const kCMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT = "CMAKE_MSVC_RUNTIME_LIBRARY_DEFAULT"; -static std::string const kCMAKE_OSX_ARCHITECTURES = "CMAKE_OSX_ARCHITECTURES"; -static std::string const kCMAKE_OSX_DEPLOYMENT_TARGET = - "CMAKE_OSX_DEPLOYMENT_TARGET"; -static std::string const kCMAKE_OSX_SYSROOT = "CMAKE_OSX_SYSROOT"; -static std::string const kCMAKE_APPLE_ARCH_SYSROOTS = - "CMAKE_APPLE_ARCH_SYSROOTS"; -static std::string const kCMAKE_POSITION_INDEPENDENT_CODE = +std::string const kCMAKE_OSX_ARCHITECTURES = "CMAKE_OSX_ARCHITECTURES"; +std::string const kCMAKE_OSX_DEPLOYMENT_TARGET = "CMAKE_OSX_DEPLOYMENT_TARGET"; +std::string const kCMAKE_OSX_SYSROOT = "CMAKE_OSX_SYSROOT"; +std::string const kCMAKE_APPLE_ARCH_SYSROOTS = "CMAKE_APPLE_ARCH_SYSROOTS"; +std::string const kCMAKE_POSITION_INDEPENDENT_CODE = "CMAKE_POSITION_INDEPENDENT_CODE"; -static std::string const kCMAKE_SYSROOT = "CMAKE_SYSROOT"; -static std::string const kCMAKE_SYSROOT_COMPILE = "CMAKE_SYSROOT_COMPILE"; -static std::string const kCMAKE_SYSROOT_LINK = "CMAKE_SYSROOT_LINK"; -static std::string const kCMAKE_Swift_COMPILER_TARGET = - "CMAKE_Swift_COMPILER_TARGET"; -static std::string const kCMAKE_TRY_COMPILE_OSX_ARCHITECTURES = +std::string const kCMAKE_SYSROOT = "CMAKE_SYSROOT"; +std::string const kCMAKE_SYSROOT_COMPILE = "CMAKE_SYSROOT_COMPILE"; +std::string const kCMAKE_SYSROOT_LINK = "CMAKE_SYSROOT_LINK"; +std::string const kCMAKE_TRY_COMPILE_OSX_ARCHITECTURES = "CMAKE_TRY_COMPILE_OSX_ARCHITECTURES"; -static std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES = +std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES = "CMAKE_TRY_COMPILE_PLATFORM_VARIABLES"; -static std::string const kCMAKE_WARN_DEPRECATED = "CMAKE_WARN_DEPRECATED"; +std::string const kCMAKE_WARN_DEPRECATED = "CMAKE_WARN_DEPRECATED"; /* GHS Multi platform variables */ -static std::set<std::string> ghs_platform_vars{ +std::set<std::string> const ghs_platform_vars{ "GHS_TARGET_PLATFORM", "GHS_PRIMARY_TARGET", "GHS_TOOLSET_ROOT", "GHS_OS_ROOT", "GHS_OS_DIR", "GHS_BSP_NAME", "GHS_OS_DIR_OPTION" }; - -static void writeProperty(FILE* fout, std::string const& targetName, - std::string const& prop, std::string const& value) -{ - fprintf(fout, "set_property(TARGET %s PROPERTY %s %s)\n", targetName.c_str(), - cmOutputConverter::EscapeForCMake(prop).c_str(), - cmOutputConverter::EscapeForCMake(value).c_str()); -} - -std::string cmCoreTryCompile::LookupStdVar(std::string const& var, - bool warnCMP0067) -{ - std::string value = this->Makefile->GetSafeDefinition(var); - if (warnCMP0067 && !value.empty()) { - value.clear(); - this->WarnCMP0067.push_back(var); - } - return value; } int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, @@ -137,21 +265,11 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, std::string outputVariable; std::string copyFile; std::string copyFileError; - std::string cStandard; - std::string objcStandard; - std::string cxxStandard; - std::string objcxxStandard; - std::string cudaStandard; - std::string cStandardRequired; - std::string cxxStandardRequired; - std::string objcStandardRequired; - std::string objcxxStandardRequired; - std::string cudaStandardRequired; - std::string cExtensions; - std::string cxxExtensions; - std::string objcExtensions; - std::string objcxxExtensions; - std::string cudaExtensions; + LanguageStandardState cState("C"); + LanguageStandardState cudaState("CUDA"); + LanguageStandardState cxxState("CXX"); + LanguageStandardState objcState("OBJC"); + LanguageStandardState objcxxState("OBJCXX"); std::vector<std::string> targets; std::vector<std::string> linkOptions; std::string libsToLink = " "; @@ -160,21 +278,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, bool didOutputVariable = false; bool didCopyFile = false; bool didCopyFileError = false; - bool didCStandard = false; - bool didCxxStandard = false; - bool didObjCStandard = false; - bool didObjCxxStandard = false; - bool didCudaStandard = false; - bool didCStandardRequired = false; - bool didCxxStandardRequired = false; - bool didObjCStandardRequired = false; - bool didObjCxxStandardRequired = false; - bool didCudaStandardRequired = false; - bool didCExtensions = false; - bool didCxxExtensions = false; - bool didObjCExtensions = false; - bool didObjCxxExtensions = false; - bool didCudaExtensions = false; bool useSources = argv[2] == "SOURCES"; std::vector<std::string> sources; @@ -188,21 +291,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, DoingOutputVariable, DoingCopyFile, DoingCopyFileError, - DoingCStandard, - DoingCxxStandard, - DoingObjCStandard, - DoingObjCxxStandard, - DoingCudaStandard, - DoingCStandardRequired, - DoingCxxStandardRequired, - DoingObjCStandardRequired, - DoingObjCxxStandardRequired, - DoingCudaStandardRequired, - DoingCExtensions, - DoingCxxExtensions, - DoingObjCExtensions, - DoingObjCxxExtensions, - DoingCudaExtensions, DoingSources, DoingCMakeInternal }; @@ -226,51 +314,12 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } else if (argv[i] == "COPY_FILE_ERROR") { doing = DoingCopyFileError; didCopyFileError = true; - } else if (argv[i] == "C_STANDARD") { - doing = DoingCStandard; - didCStandard = true; - } else if (argv[i] == "CXX_STANDARD") { - doing = DoingCxxStandard; - didCxxStandard = true; - } else if (argv[i] == "OBJC_STANDARD") { - doing = DoingObjCStandard; - didObjCStandard = true; - } else if (argv[i] == "OBJCXX_STANDARD") { - doing = DoingObjCxxStandard; - didObjCxxStandard = true; - } else if (argv[i] == "CUDA_STANDARD") { - doing = DoingCudaStandard; - didCudaStandard = true; - } else if (argv[i] == "C_STANDARD_REQUIRED") { - doing = DoingCStandardRequired; - didCStandardRequired = true; - } else if (argv[i] == "CXX_STANDARD_REQUIRED") { - doing = DoingCxxStandardRequired; - didCxxStandardRequired = true; - } else if (argv[i] == "OBJC_STANDARD_REQUIRED") { - doing = DoingObjCStandardRequired; - didObjCStandardRequired = true; - } else if (argv[i] == "OBJCXX_STANDARD_REQUIRED") { - doing = DoingObjCxxStandardRequired; - didObjCxxStandardRequired = true; - } else if (argv[i] == "CUDA_STANDARD_REQUIRED") { - doing = DoingCudaStandardRequired; - didCudaStandardRequired = true; - } else if (argv[i] == "C_EXTENSIONS") { - doing = DoingCExtensions; - didCExtensions = true; - } else if (argv[i] == "CXX_EXTENSIONS") { - doing = DoingCxxExtensions; - didCxxExtensions = true; - } else if (argv[i] == "OBJC_EXTENSIONS") { - doing = DoingObjCExtensions; - didObjCExtensions = true; - } else if (argv[i] == "OBJCXX_EXTENSIONS") { - doing = DoingObjCxxExtensions; - didObjCxxExtensions = true; - } else if (argv[i] == "CUDA_EXTENSIONS") { - doing = DoingCudaExtensions; - didCudaExtensions = true; + } else if (cState.UpdateIfMatches(argv, i) || + cxxState.UpdateIfMatches(argv, i) || + cudaState.UpdateIfMatches(argv, i) || + objcState.UpdateIfMatches(argv, i) || + objcxxState.UpdateIfMatches(argv, i)) { + continue; } else if (argv[i] == "__CMAKE_INTERNAL") { doing = DoingCMakeInternal; } else if (doing == DoingCMakeFlags) { @@ -315,51 +364,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } else if (doing == DoingCopyFileError) { copyFileError = argv[i]; doing = DoingNone; - } else if (doing == DoingCStandard) { - cStandard = argv[i]; - doing = DoingNone; - } else if (doing == DoingCxxStandard) { - cxxStandard = argv[i]; - doing = DoingNone; - } else if (doing == DoingObjCStandard) { - objcStandard = argv[i]; - doing = DoingNone; - } else if (doing == DoingObjCxxStandard) { - objcxxStandard = argv[i]; - doing = DoingNone; - } else if (doing == DoingCudaStandard) { - cudaStandard = argv[i]; - doing = DoingNone; - } else if (doing == DoingCStandardRequired) { - cStandardRequired = argv[i]; - doing = DoingNone; - } else if (doing == DoingCxxStandardRequired) { - cxxStandardRequired = argv[i]; - doing = DoingNone; - } else if (doing == DoingObjCStandardRequired) { - objcStandardRequired = argv[i]; - doing = DoingNone; - } else if (doing == DoingObjCxxStandardRequired) { - objcxxStandardRequired = argv[i]; - doing = DoingNone; - } else if (doing == DoingCudaStandardRequired) { - cudaStandardRequired = argv[i]; - doing = DoingNone; - } else if (doing == DoingCExtensions) { - cExtensions = argv[i]; - doing = DoingNone; - } else if (doing == DoingCxxExtensions) { - cxxExtensions = argv[i]; - doing = DoingNone; - } else if (doing == DoingObjCExtensions) { - objcExtensions = argv[i]; - doing = DoingNone; - } else if (doing == DoingObjCxxExtensions) { - objcxxExtensions = argv[i]; - doing = DoingNone; - } else if (doing == DoingCudaExtensions) { - cudaExtensions = argv[i]; - doing = DoingNone; } else if (doing == DoingSources) { sources.push_back(argv[i]); } else if (doing == DoingCMakeInternal) { @@ -411,59 +415,22 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, return -1; } - if (didCStandard && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "C_STANDARD allowed only in source file signature."); - return -1; - } - if (didCxxStandard && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "CXX_STANDARD allowed only in source file signature."); - return -1; - } - if (didCudaStandard && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "CUDA_STANDARD allowed only in source file signature."); - return -1; - } - if (didCStandardRequired && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "C_STANDARD_REQUIRED allowed only in source file signature."); - return -1; - } - if (didCxxStandardRequired && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "CXX_STANDARD_REQUIRED allowed only in source file signature."); - return -1; - } - if (didCudaStandardRequired && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "CUDA_STANDARD_REQUIRED allowed only in source file signature."); - return -1; - } - if (didCExtensions && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "C_EXTENSIONS allowed only in source file signature."); - return -1; - } - if (didCxxExtensions && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "CXX_EXTENSIONS allowed only in source file signature."); - return -1; - } - if (didCudaExtensions && !this->SrcFileSignature) { - this->Makefile->IssueMessage( - MessageType::FATAL_ERROR, - "CUDA_EXTENSIONS allowed only in source file signature."); - return -1; + if (!this->SrcFileSignature) { + if (!cState.Validate(this->Makefile)) { + return -1; + } + if (!cudaState.Validate(this->Makefile)) { + return -1; + } + if (!cxxState.Validate(this->Makefile)) { + return -1; + } + if (!objcState.Validate(this->Makefile)) { + return -1; + } + if (!objcxxState.Validate(this->Makefile)) { + return -1; + } } // compute the binary dir when TRY_COMPILE is called with a src file @@ -721,12 +688,23 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, // Forward a set of variables to the inner project cache. { std::set<std::string> vars; - vars.insert(kCMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN); - vars.insert(kCMAKE_C_COMPILER_TARGET); - vars.insert(kCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN); - vars.insert(kCMAKE_CXX_COMPILER_TARGET); + vars.insert(&c_properties[lang_property_start], + &c_properties[lang_property_start + lang_property_size]); + vars.insert(&cxx_properties[lang_property_start], + &cxx_properties[lang_property_start + lang_property_size]); + vars.insert(&cuda_properties[lang_property_start], + &cuda_properties[lang_property_start + lang_property_size]); + vars.insert( + &fortran_properties[lang_property_start], + &fortran_properties[lang_property_start + lang_property_size]); + vars.insert(&objc_properties[lang_property_start], + &objc_properties[lang_property_start + lang_property_size]); + vars.insert( + &objcxx_properties[lang_property_start], + &objcxx_properties[lang_property_start + lang_property_size]); + vars.insert(&swift_properties[lang_property_start], + &swift_properties[lang_property_start + lang_property_size]); vars.insert(kCMAKE_CUDA_ARCHITECTURES); - vars.insert(kCMAKE_CUDA_COMPILER_TARGET); vars.insert(kCMAKE_CUDA_RUNTIME_LIBRARY); vars.insert(kCMAKE_ENABLE_EXPORTS); vars.insert(kCMAKE_LINK_SEARCH_END_STATIC); @@ -739,7 +717,6 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, vars.insert(kCMAKE_SYSROOT); vars.insert(kCMAKE_SYSROOT_COMPILE); vars.insert(kCMAKE_SYSROOT_LINK); - vars.insert(kCMAKE_Swift_COMPILER_TARGET); vars.insert(kCMAKE_WARN_DEPRECATED); vars.emplace("CMAKE_MSVC_RUNTIME_LIBRARY"_s); @@ -753,10 +730,22 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, cmPolicies::NEW) { // To ensure full support of PIE, propagate cache variables // driving the link options - vars.insert(kCMAKE_C_LINK_PIE_SUPPORTED); - vars.insert(kCMAKE_C_LINK_NO_PIE_SUPPORTED); - vars.insert(kCMAKE_CXX_LINK_PIE_SUPPORTED); - vars.insert(kCMAKE_CXX_LINK_NO_PIE_SUPPORTED); + vars.insert(&c_properties[pie_property_start], + &c_properties[pie_property_start + pie_property_size]); + vars.insert(&cxx_properties[pie_property_start], + &cxx_properties[pie_property_start + pie_property_size]); + vars.insert(&cuda_properties[pie_property_start], + &cuda_properties[pie_property_start + pie_property_size]); + vars.insert( + &fortran_properties[pie_property_start], + &fortran_properties[pie_property_start + pie_property_size]); + vars.insert(&objc_properties[pie_property_start], + &objc_properties[pie_property_start + pie_property_size]); + vars.insert( + &objcxx_properties[pie_property_start], + &objcxx_properties[pie_property_start + pie_property_size]); + vars.insert(&swift_properties[pie_property_start], + &swift_properties[pie_property_start + pie_property_size]); } /* for the TRY_COMPILEs we want to be able to specify the architecture. @@ -819,21 +808,17 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } fprintf(fout, ")\n"); - bool const testC = testLangs.find("C") != testLangs.end(); - bool const testObjC = testLangs.find("OBJC") != testLangs.end(); - bool const testCxx = testLangs.find("CXX") != testLangs.end(); - bool const testObjCxx = testLangs.find("OBJCXX") != testLangs.end(); - bool const testCuda = testLangs.find("CUDA") != testLangs.end(); + cState.Enabled(testLangs.find("C") != testLangs.end()); + cxxState.Enabled(testLangs.find("CXX") != testLangs.end()); + cudaState.Enabled(testLangs.find("CUDA") != testLangs.end()); + objcState.Enabled(testLangs.find("OBJC") != testLangs.end()); + objcxxState.Enabled(testLangs.find("OBJCXX") != testLangs.end()); bool warnCMP0067 = false; bool honorStandard = true; - if (!didCStandard && !didCxxStandard && !didObjCStandard && - !didObjCxxStandard && !didCudaStandard && !didCStandardRequired && - !didCxxStandardRequired && !didObjCStandardRequired && - !didObjCxxStandardRequired && !didCudaStandardRequired && - !didCExtensions && !didCxxExtensions && !didObjCExtensions && - !didObjCxxExtensions && !didCudaExtensions) { + if (cState.DidNone() && cxxState.DidNone() && objcState.DidNone() && + objcxxState.DidNone() && cudaState.DidNone()) { switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0067)) { case cmPolicies::WARN: warnCMP0067 = this->Makefile->PolicyOptionalWarningEnabled( @@ -855,46 +840,20 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, } } - if (honorStandard || warnCMP0067) { + std::vector<std::string> warnCMP0067Variables; - auto testLanguage = - [&](bool testLang, bool didLangStandard, bool didLangStandardRequired, - bool didLangExtensions, std::string& langStandard, - std::string& langStandardRequired, std::string& langExtensions, - const std::string& lang) { - if (testLang) { - if (!didLangStandard) { - langStandard = this->LookupStdVar( - cmStrCat("CMAKE_", lang, "_STANDARD"), warnCMP0067); - } - if (!didLangStandardRequired) { - langStandardRequired = this->LookupStdVar( - cmStrCat("CMAKE_", lang, "_STANDARD_REQUIRED"), warnCMP0067); - } - if (!didLangExtensions) { - langExtensions = this->LookupStdVar( - cmStrCat("CMAKE_", lang, "_EXTENSIONS"), warnCMP0067); - } - } - }; - - testLanguage(testC, didCStandard, didCStandardRequired, didCExtensions, - cStandard, cStandardRequired, cExtensions, "C"); - testLanguage(testObjC, didObjCStandard, didObjCStandardRequired, - didObjCExtensions, objcStandard, objcStandardRequired, - objcExtensions, "OBJC"); - testLanguage(testCxx, didCxxStandard, didCxxStandardRequired, - didCxxExtensions, cxxStandard, cxxStandardRequired, - cxxExtensions, "CXX"); - testLanguage(testObjCxx, didObjCxxStandard, didObjCxxStandardRequired, - didObjCxxExtensions, objcxxStandard, objcxxStandardRequired, - objcxxExtensions, "OBJCXX"); - testLanguage(testCuda, didCudaStandard, didCudaStandardRequired, - didCudaExtensions, cudaStandard, cudaStandardRequired, - cudaExtensions, "CUDA"); - } + cState.LoadUnsetPropertyValues(this->Makefile, honorStandard, warnCMP0067, + warnCMP0067Variables); + cxxState.LoadUnsetPropertyValues(this->Makefile, honorStandard, + warnCMP0067, warnCMP0067Variables); + cudaState.LoadUnsetPropertyValues(this->Makefile, honorStandard, + warnCMP0067, warnCMP0067Variables); + objcState.LoadUnsetPropertyValues(this->Makefile, honorStandard, + warnCMP0067, warnCMP0067Variables); + objcxxState.LoadUnsetPropertyValues(this->Makefile, honorStandard, + warnCMP0067, warnCMP0067Variables); - if (!this->WarnCMP0067.empty()) { + if (!warnCMP0067Variables.empty()) { std::ostringstream w; /* clang-format off */ w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0067) << "\n" @@ -902,43 +861,17 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv, "is not honoring language standard variables in the test project:\n" ; /* clang-format on */ - for (std::string const& vi : this->WarnCMP0067) { + for (std::string const& vi : warnCMP0067Variables) { w << " " << vi << "\n"; } this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str()); } - auto writeLanguageProperties = [&](bool testLang, - const std::string& langStandard, - const std::string& langStandardRequired, - const std::string& langExtensions, - const std::string& lang) { - if (testLang) { - if (!langStandard.empty()) { - writeProperty(fout, targetName, cmStrCat(lang, "_STANDARD"), - langStandard); - } - if (!langStandardRequired.empty()) { - writeProperty(fout, targetName, cmStrCat(lang, "_STANDARD_REQUIRED"), - langStandardRequired); - } - if (!langExtensions.empty()) { - writeProperty(fout, targetName, cmStrCat(lang, "_EXTENSIONS"), - langExtensions); - } - } - }; - - writeLanguageProperties(testC, cStandard, cStandardRequired, cExtensions, - "C"); - writeLanguageProperties(testObjC, objcStandard, objcStandardRequired, - objcExtensions, "OBJC"); - writeLanguageProperties(testCxx, cxxStandard, cxxStandardRequired, - cxxExtensions, "CXX"); - writeLanguageProperties(testObjCxx, objcxxStandard, objcxxStandardRequired, - objcxxExtensions, "OBJCXX"); - writeLanguageProperties(testCuda, cudaStandard, cudaStandardRequired, - cudaExtensions, "CUDA"); + cState.WriteProperties(fout, targetName); + cxxState.WriteProperties(fout, targetName); + cudaState.WriteProperties(fout, targetName); + objcState.WriteProperties(fout, targetName); + objcxxState.WriteProperties(fout, targetName); if (!linkOptions.empty()) { std::vector<std::string> options; diff --git a/Source/cmCoreTryCompile.h b/Source/cmCoreTryCompile.h index ae714a6..916572a 100644 --- a/Source/cmCoreTryCompile.h +++ b/Source/cmCoreTryCompile.h @@ -47,10 +47,6 @@ protected: std::string OutputFile; std::string FindErrorMessage; bool SrcFileSignature = false; - -private: - std::vector<std::string> WarnCMP0067; - std::string LookupStdVar(std::string const& var, bool warnCMP0067); }; #endif diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx index 32b0ca9..652c041 100644 --- a/Source/cmExtraCodeBlocksGenerator.cxx +++ b/Source/cmExtraCodeBlocksGenerator.cxx @@ -370,7 +370,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile( std::string lang = s->GetOrDetermineLanguage(); if (lang == "C" || lang == "CXX" || lang == "CUDA") { std::string const& srcext = s->GetExtension(); - isCFile = cm->IsSourceExtension(srcext); + isCFile = cm->IsACLikeSourceExtension(srcext); } std::string const& fullPath = s->ResolveFullPath(); diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index bf7555d..95cfb0a 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -227,8 +227,7 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles( cmSystemTools::LowerCase(s->GetExtension()); // check whether it is a source or a include file // then put it accordingly into one of the two containers - if (cm->IsSourceExtension(extLower) || cm->IsCudaExtension(extLower) || - cm->IsFortranExtension(extLower)) { + if (cm->IsAKnownSourceExtension(extLower)) { cFiles[fullPath] = s; } else { otherFiles.insert(fullPath); diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index 613a943..3e265a0 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -349,6 +349,13 @@ std::string cmExtraSublimeTextGenerator::ComputeFlagsForObject( if (language.empty()) { language = "C"; } + + // explicitly add the explicit language flag before any other flag + // this way backwards compatibility with user flags is maintained + if (source->GetProperty("LANGUAGE")) { + lg->AppendFeatureOptions(flags, language, "EXPLICIT_LANGUAGE"); + } + std::string const& config = lg->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"); diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index 4b88bea..77728ec 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -4,6 +4,7 @@ #include "cmMakefile.h" #include "cmMessageType.h" +#include "cmPolicies.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" @@ -19,6 +20,7 @@ struct cmFindProgramHelper cmFindProgramHelper(cmMakefile* makefile, cmFindBase const* base) : DebugSearches("find_program", base) , Makefile(makefile) + , PolicyCMP0109(makefile->GetPolicyStatus(cmPolicies::CMP0109)) { #if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) // Consider platform-specific extensions. @@ -48,6 +50,8 @@ struct cmFindProgramHelper cmFindBaseDebugState DebugSearches; cmMakefile* Makefile; + cmPolicies::PolicyStatus PolicyCMP0109; + void AddName(std::string const& name) { this->Names.push_back(name); } void SetName(std::string const& name) { @@ -85,7 +89,7 @@ struct cmFindProgramHelper this->TestNameExt = cmStrCat(name, ext); this->TestPath = cmSystemTools::CollapseFullPath(this->TestNameExt, path); - bool exists = cmSystemTools::FileExists(this->TestPath, true); + bool exists = this->FileIsExecutable(this->TestPath); exists ? this->DebugSearches.FoundAt(this->TestPath) : this->DebugSearches.FailedAt(this->TestPath); if (exists) { @@ -95,6 +99,48 @@ struct cmFindProgramHelper } return false; } + bool FileIsExecutable(std::string const& file) const + { + switch (this->PolicyCMP0109) { + case cmPolicies::OLD: + return cmSystemTools::FileExists(file, true); + case cmPolicies::NEW: + case cmPolicies::REQUIRED_ALWAYS: + case cmPolicies::REQUIRED_IF_USED: + return cmSystemTools::FileIsExecutable(file); + default: + break; + } + bool const isExeOld = cmSystemTools::FileExists(file, true); + bool const isExeNew = cmSystemTools::FileIsExecutable(file); + if (isExeNew == isExeOld) { + return isExeNew; + } + if (isExeNew) { + this->Makefile->IssueMessage( + MessageType::AUTHOR_WARNING, + cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0109), + "\n" + "The file\n" + " ", + file, + "\n" + "is executable but not readable. " + "CMake is ignoring it for compatibility.")); + } else { + this->Makefile->IssueMessage( + MessageType::AUTHOR_WARNING, + cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0109), + "\n" + "The file\n" + " ", + file, + "\n" + "is readable but not executable. " + "CMake is using it for compatibility.")); + } + return isExeOld; + } }; cmFindProgramCommand::cmFindProgramCommand(cmExecutionStatus& status) @@ -266,14 +312,13 @@ std::string cmFindProgramCommand::GetBundleExecutable( if (executableURL != nullptr) { const int MAX_OSX_PATH_SIZE = 1024; - char buffer[MAX_OSX_PATH_SIZE]; + UInt8 buffer[MAX_OSX_PATH_SIZE]; - // Convert the CFString to a C string - CFStringGetCString(CFURLGetString(executableURL), buffer, - MAX_OSX_PATH_SIZE, kCFStringEncodingUTF8); - - // And finally to a c++ string - executable = bundlePath + "/Contents/MacOS/" + std::string(buffer); + if (CFURLGetFileSystemRepresentation(executableURL, false, buffer, + MAX_OSX_PATH_SIZE)) { + executable = bundlePath + "/Contents/MacOS/" + + std::string(reinterpret_cast<char*>(buffer)); + } // Only release CFURLRef if it's not null CFRelease(executableURL); } diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx index e4fb67e..b712b71 100644 --- a/Source/cmGeneratorExpressionNode.cxx +++ b/Source/cmGeneratorExpressionNode.cxx @@ -881,7 +881,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode { ConfigurationTestNode() {} // NOLINT(modernize-use-equals-default) - int NumExpectedParameters() const override { return OneOrZeroParameters; } + int NumExpectedParameters() const override { return ZeroOrMoreParameters; } std::string Evaluate( const std::vector<std::string>& parameters, @@ -899,13 +899,15 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode return std::string(); } context->HadContextSensitiveCondition = true; - if (context->Config.empty()) { - return parameters.front().empty() ? "1" : "0"; - } - - if (cmsysString_strcasecmp(parameters.front().c_str(), - context->Config.c_str()) == 0) { - return "1"; + for (auto& param : parameters) { + if (context->Config.empty()) { + if (param.empty()) { + return "1"; + } + } else if (cmsysString_strcasecmp(param.c_str(), + context->Config.c_str()) == 0) { + return "1"; + } } if (context->CurrentTarget && context->CurrentTarget->IsImported()) { @@ -922,10 +924,12 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode "MAP_IMPORTED_CONFIG_", cmSystemTools::UpperCase(context->Config)); if (cmProp mapValue = context->CurrentTarget->GetProperty(mapProp)) { cmExpandList(cmSystemTools::UpperCase(*mapValue), mappedConfigs); - return cm::contains(mappedConfigs, - cmSystemTools::UpperCase(parameters.front())) - ? "1" - : "0"; + + for (auto& param : parameters) { + if (cm::contains(mappedConfigs, cmSystemTools::UpperCase(param))) { + return "1"; + } + } } } } @@ -1708,7 +1712,7 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode std::string error; std::string lang; if (!context->LG->GetMakefile()->CompileFeatureKnown( - context->HeadTarget->Target, p, lang, &error)) { + context->HeadTarget->Target->GetName(), p, lang, &error)) { reportError(context, content->GetOriginalExpression(), error); return std::string(); } @@ -1742,9 +1746,9 @@ static const struct CompileFeaturesNode : public cmGeneratorExpressionNode continue; } if (!context->LG->GetMakefile()->HaveStandardAvailable( - target->Target, lit.first, it)) { + target, lit.first, context->Config, it)) { if (evalLL) { - cmProp l = target->GetProperty(lit.first + "_STANDARD"); + cmProp l = target->GetLanguageStandard(lit.first, context->Config); if (!l) { l = standardDefault; } diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index f2011ee..1f66a9f 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -947,6 +947,45 @@ bool cmGeneratorTarget::HasExplicitObjectName(cmSourceFile const* file) const return it != this->ExplicitObjectName.end(); } +cmProp cmGeneratorTarget::GetLanguageStandard(std::string const& lang, + std::string const& config) const +{ + std::string key = cmStrCat(cmSystemTools::UpperCase(config), '-', lang); + auto langStandardIter = this->LanguageStandardMap.find(key); + if (langStandardIter != this->LanguageStandardMap.end()) { + return &langStandardIter->second; + } + + return this->Target->GetProperty(cmStrCat(lang, "_STANDARD")); +} + +cmProp cmGeneratorTarget::GetLanguageStandardProperty(std::string const& lang, + const char* suffix) const +{ + cmProp propertyValue = this->Target->GetProperty(cmStrCat(lang, suffix)); + if (propertyValue == nullptr) { + // Check if we should use the value set by another language. + if (lang == "OBJC") { + propertyValue = this->GetLanguageStandardProperty("C", suffix); + } else if (lang == "OBJCXX" || lang == "CUDA") { + propertyValue = this->GetLanguageStandardProperty("CXX", suffix); + } + } + return propertyValue; +} + +cmProp cmGeneratorTarget::GetLanguageExtensions(std::string const& lang) const +{ + return this->GetLanguageStandardProperty(lang, "_EXTENSIONS"); +} + +bool cmGeneratorTarget::GetLanguageStandardRequired( + std::string const& lang) const +{ + cmProp p = this->GetLanguageStandardProperty(lang, "_STANDARD_REQUIRED"); + return p && cmIsOn(*p); +} + void cmGeneratorTarget::GetModuleDefinitionSources( std::vector<cmSourceFile const*>& data, const std::string& config) const { @@ -4408,12 +4447,68 @@ void cmGeneratorTarget::ComputeTargetManifest(const std::string& config) const bool cmGeneratorTarget::ComputeCompileFeatures(std::string const& config) const { + // Compute the language standard based on the compile features. std::vector<BT<std::string>> features = this->GetCompileFeatures(config); for (BT<std::string> const& f : features) { - if (!this->Makefile->AddRequiredTargetFeature(this->Target, f.Value)) { + std::string lang; + if (!this->Makefile->CompileFeatureKnown(this->Target->GetName(), f.Value, + lang, nullptr)) { return false; } + + std::string key = cmStrCat(cmSystemTools::UpperCase(config), '-', lang); + cmProp currentLanguageStandard = this->GetLanguageStandard(lang, config); + + std::string newRequiredStandard; + if (!this->Makefile->GetNewRequiredStandard( + this->Target->GetName(), f.Value, currentLanguageStandard, + newRequiredStandard)) { + return false; + } + + if (!newRequiredStandard.empty()) { + this->LanguageStandardMap[key] = newRequiredStandard; + } } + + return true; +} + +bool cmGeneratorTarget::ComputeCompileFeatures( + std::string const& config, std::set<LanguagePair> const& languagePairs) const +{ + for (const auto& language : languagePairs) { + cmProp generatorTargetLanguageStandard = + this->GetLanguageStandard(language.first, config); + if (!generatorTargetLanguageStandard) { + // If the standard isn't explicitly set we copy it over from the + // specified paired language. + std::string key = + cmStrCat(cmSystemTools::UpperCase(config), '-', language.first); + cmProp standardToCopy = + this->GetLanguageStandard(language.second, config); + if (standardToCopy != nullptr) { + this->LanguageStandardMap[key] = *standardToCopy; + generatorTargetLanguageStandard = &this->LanguageStandardMap[key]; + } else { + cmProp defaultStandard = this->Makefile->GetDef( + cmStrCat("CMAKE_", language.second, "_STANDARD_DEFAULT")); + if (defaultStandard != nullptr) { + this->LanguageStandardMap[key] = *defaultStandard; + generatorTargetLanguageStandard = &this->LanguageStandardMap[key]; + } + } + + // Custom updates for the CUDA standard. + if (generatorTargetLanguageStandard != nullptr && + language.first == "CUDA") { + if (*generatorTargetLanguageStandard == "98") { + this->LanguageStandardMap[key] = "03"; + } + } + } + } + return true; } diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index 3aedbf5..a71e64c 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -148,6 +148,13 @@ public: bool HasExplicitObjectName(cmSourceFile const* file) const; void AddExplicitObjectName(cmSourceFile const* sf); + cmProp GetLanguageStandard(std::string const& lang, + std::string const& config) const; + + cmProp GetLanguageExtensions(std::string const& lang) const; + + bool GetLanguageStandardRequired(std::string const& lang) const; + void GetModuleDefinitionSources(std::vector<cmSourceFile const*>&, const std::string& config) const; void GetExternalObjects(std::vector<cmSourceFile const*>&, @@ -515,6 +522,11 @@ public: bool ComputeCompileFeatures(std::string const& config) const; + using LanguagePair = std::pair<std::string, std::string>; + bool ComputeCompileFeatures( + std::string const& config, + std::set<LanguagePair> const& languagePairs) const; + /** * Trace through the source files in this target and add al source files * that they depend on, used by all generators @@ -1038,6 +1050,11 @@ private: bool GetRPATH(const std::string& config, const std::string& prop, std::string& rpath) const; + mutable std::map<std::string, std::string> LanguageStandardMap; + + cmProp GetLanguageStandardProperty(std::string const& lang, + const char* suffix) const; + public: const std::vector<const cmGeneratorTarget*>& GetLinkImplementationClosure( const std::string& config) const; diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 811421a..38bffbf 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -14,6 +14,7 @@ bool cmGetFilenameComponentCommand(std::vector<std::string> const& args, { if (args.size() < 3) { status.SetError("called with incorrect number of arguments"); + cmSystemTools::SetFatalErrorOccured(); return false; } @@ -114,6 +115,7 @@ bool cmGetFilenameComponentCommand(std::vector<std::string> const& args, } else { std::string err = "unknown component " + args[2]; status.SetError(err); + cmSystemTools::SetFatalErrorOccured(); return false; } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 4dc4092..6001999 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -596,6 +596,16 @@ void cmGlobalGenerator::EnableLanguage( mf->ReadListFile(fpath); } } + + if (readCMakeSystem) { + // Find the native build tool for this generator. + // This has to be done early so that MSBuild can be used to examine the + // cross-compilation environment. + if (!this->FindMakeProgram(mf)) { + return; + } + } + // Load the CMakeDetermineSystem.cmake file and find out // what platform we are running on if (!mf->GetDefinition("CMAKE_SYSTEM")) { @@ -667,11 +677,6 @@ void cmGlobalGenerator::EnableLanguage( cmSystemTools::SetFatalErrorOccured(); return; } - - // Find the native build tool for this generator. - if (!this->FindMakeProgram(mf)) { - return; - } } // Check that the languages are supported by the generator and its @@ -1442,12 +1447,10 @@ bool cmGlobalGenerator::Compute() localGen->AddHelperCommands(); } - // Finalize the set of compile features for each target. - // FIXME: This turns into calls to cmMakefile::AddRequiredTargetFeature - // which actually modifies the <lang>_STANDARD target property - // on the original cmTarget instance. It accumulates features - // across all configurations. Some refactoring is needed to - // compute a per-config resulta purely during generation. + // Perform up-front computation in order to handle errors (such as unknown + // features) at this point. While processing the compile features we also + // calculate and cache the language standard required by the compile + // features. for (const auto& localGen : this->LocalGenerators) { if (!localGen->ComputeTargetCompileFeatures()) { return false; @@ -1988,8 +1991,9 @@ int cmGlobalGenerator::Build( std::string makeCommandStr; output += "\nRun Build Command(s):"; - for (auto command = makeCommand.begin(); command != makeCommand.end(); - ++command) { + retVal = 0; + for (auto command = makeCommand.begin(); + command != makeCommand.end() && retVal == 0; ++command) { makeCommandStr = command->Printable(); if (command != makeCommand.end()) { makeCommandStr += " && "; diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 5dac072..3805546 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -138,9 +138,6 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator( "ProductDir", vc10Express, cmSystemTools::KeyWOW64_32); this->CudaEnabled = false; - this->SystemIsWindowsCE = false; - this->SystemIsWindowsPhone = false; - this->SystemIsWindowsStore = false; this->MSBuildCommandInitialized = false; { std::string envPlatformToolset; @@ -511,18 +508,16 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf) mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); return false; } - std::string v = this->GetInstalledNsightTegraVersion(); - if (v.empty()) { - mf->IssueMessage(MessageType::FATAL_ERROR, - "CMAKE_SYSTEM_NAME is 'Android' but " - "'NVIDIA Nsight Tegra Visual Studio Edition' " - "is not installed."); - return false; + if (mf->GetSafeDefinition("CMAKE_GENERATOR_PLATFORM") == "Tegra-Android") { + if (!this->InitializeTegraAndroid(mf)) { + return false; + } + } else { + this->SystemIsAndroid = true; + if (!this->InitializeAndroid(mf)) { + return false; + } } - this->DefaultPlatformName = "Tegra-Android"; - this->DefaultPlatformToolset = "Default"; - this->NsightTegraVersion = v; - mf->AddDefinition("CMAKE_VS_NsightTegra_VERSION", v); } return true; @@ -564,6 +559,31 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf) return false; } +bool cmGlobalVisualStudio10Generator::InitializeTegraAndroid(cmMakefile* mf) +{ + std::string v = this->GetInstalledNsightTegraVersion(); + if (v.empty()) { + mf->IssueMessage(MessageType::FATAL_ERROR, + "CMAKE_SYSTEM_NAME is 'Android' but " + "'NVIDIA Nsight Tegra Visual Studio Edition' " + "is not installed."); + return false; + } + this->DefaultPlatformName = "Tegra-Android"; + this->DefaultPlatformToolset = "Default"; + this->NsightTegraVersion = v; + mf->AddDefinition("CMAKE_VS_NsightTegra_VERSION", v); + return true; +} + +bool cmGlobalVisualStudio10Generator::InitializeAndroid(cmMakefile* mf) +{ + std::ostringstream e; + e << this->GetName() << " does not support Android."; + mf->IssueMessage(MessageType::FATAL_ERROR, e.str()); + return false; +} + bool cmGlobalVisualStudio10Generator::SelectWindowsPhoneToolset( std::string& toolset) const { @@ -598,6 +618,28 @@ void cmGlobalVisualStudio10Generator::Generate() { this->LongestSource = LongestSourcePath(); this->cmGlobalVisualStudio8Generator::Generate(); + if (!this->AndroidExecutableWarnings.empty() && + !this->CMakeInstance->GetIsInTryCompile()) { + std::ostringstream e; + /* clang-format off */ + e << + "You are using Visual Studio tools for Android, which does not support " + "standalone executables. However, the following executable targets do " + "not have the ANDROID_GUI property set, and thus will not be built as " + "expected. They will be built as shared libraries with executable " + "filenames:\n" + " "; + /* clang-format on */ + bool first = true; + for (auto const& name : this->AndroidExecutableWarnings) { + if (!first) { + e << ", "; + } + first = false; + e << name; + } + this->CMakeInstance->IssueMessage(MessageType::WARNING, e.str()); + } if (this->LongestSource.Length > 0) { cmLocalGenerator* lg = this->LongestSource.Target->GetLocalGenerator(); std::ostringstream e; @@ -664,8 +706,14 @@ std::string const& cmGlobalVisualStudio10Generator::GetPlatformToolsetString() if (!this->GeneratorToolset.empty()) { return this->GeneratorToolset; } - if (!this->DefaultPlatformToolset.empty()) { - return this->DefaultPlatformToolset; + if (this->SystemIsAndroid) { + if (!this->DefaultAndroidToolset.empty()) { + return this->DefaultAndroidToolset; + } + } else { + if (!this->DefaultPlatformToolset.empty()) { + return this->DefaultPlatformToolset; + } } static std::string const empty; return empty; @@ -879,7 +927,10 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf) epg.Attribute("Label", "Globals"); cmXMLElement(epg, "ProjectGuid") .Content("{F3FC6D86-508D-3FB1-96D2-995F08B142EC}"); - cmXMLElement(epg, "Keyword").Content("Win32Proj"); + cmXMLElement(epg, "Keyword") + .Content(mf->GetSafeDefinition("CMAKE_SYSTEM_NAME") == "Android" + ? "Android" + : "Win32Proj"); cmXMLElement(epg, "Platform").Content(this->GetPlatformName()); if (this->GetSystemName() == "WindowsPhone") { cmXMLElement(epg, "ApplicationType").Content("Windows Phone"); @@ -889,15 +940,21 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf) cmXMLElement(epg, "ApplicationType").Content("Windows Store"); cmXMLElement(epg, "ApplicationTypeRevision") .Content(this->GetApplicationTypeRevision()); + } else if (this->GetSystemName() == "Android") { + cmXMLElement(epg, "ApplicationType").Content("Android"); + cmXMLElement(epg, "ApplicationTypeRevision") + .Content(this->GetApplicationTypeRevision()); } if (!this->WindowsTargetPlatformVersion.empty()) { cmXMLElement(epg, "WindowsTargetPlatformVersion") .Content(this->WindowsTargetPlatformVersion); } - if (this->GetPlatformName() == "ARM64") { - cmXMLElement(epg, "WindowsSDKDesktopARM64Support").Content("true"); - } else if (this->GetPlatformName() == "ARM") { - cmXMLElement(epg, "WindowsSDKDesktopARMSupport").Content("true"); + if (this->GetSystemName() != "Android") { + if (this->GetPlatformName() == "ARM64") { + cmXMLElement(epg, "WindowsSDKDesktopARM64Support").Content("true"); + } else if (this->GetPlatformName() == "ARM") { + cmXMLElement(epg, "WindowsSDKDesktopARMSupport").Content("true"); + } } } cmXMLElement(eprj, "Import") @@ -1209,6 +1266,10 @@ std::string cmGlobalVisualStudio10Generator::GetInstalledNsightTegraVersion() std::string cmGlobalVisualStudio10Generator::GetApplicationTypeRevision() const { + if (this->GetSystemName() == "Android") { + return this->GetAndroidApplicationTypeRevision(); + } + // Return the first two '.'-separated components of the Windows version. std::string::size_type end1 = this->SystemVersion.find('.'); std::string::size_type end2 = diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index b8c18b4..0c53537 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -4,6 +4,7 @@ #define cmGlobalVisualStudio10Generator_h #include <memory> +#include <set> #include "cmGlobalVisualStudio8Generator.h" #include "cmVisualStudio10ToolsetOptions.h" @@ -43,6 +44,11 @@ public: void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*, bool optional) override; + void AddAndroidExecutableWarning(const std::string& name) + { + this->AndroidExecutableWarnings.insert(name); + } + bool IsCudaEnabled() const { return this->CudaEnabled; } /** Generating for Nsight Tegra VS plugin? */ @@ -100,6 +106,9 @@ public: /** Return true if building for WindowsStore */ bool TargetsWindowsStore() const { return this->SystemIsWindowsStore; } + /** Return true if building for Android */ + bool TargetsAndroid() const { return this->SystemIsAndroid; } + const char* GetCMakeCFGIntDir() const override { return "$(Configuration)"; } bool Find64BitTools(cmMakefile* mf); @@ -128,6 +137,8 @@ public: /** Return the first two components of CMAKE_SYSTEM_VERSION. */ std::string GetApplicationTypeRevision() const; + virtual const char* GetAndroidApplicationTypeRevision() const { return ""; } + cmIDEFlagTable const* GetClFlagTable() const; cmIDEFlagTable const* GetCSharpFlagTable() const; cmIDEFlagTable const* GetRcFlagTable() const; @@ -148,6 +159,8 @@ protected: virtual bool InitializeWindowsCE(cmMakefile* mf); virtual bool InitializeWindowsPhone(cmMakefile* mf); virtual bool InitializeWindowsStore(cmMakefile* mf); + virtual bool InitializeTegraAndroid(cmMakefile* mf); + virtual bool InitializeAndroid(cmMakefile* mf); virtual bool ProcessGeneratorToolsetField(std::string const& key, std::string const& value); @@ -171,6 +184,7 @@ protected: std::string GeneratorToolsetCudaCustomDir; std::string DefaultPlatformToolset; std::string DefaultPlatformToolsetHostArchitecture; + std::string DefaultAndroidToolset; std::string WindowsTargetPlatformVersion; std::string SystemName; std::string SystemVersion; @@ -185,9 +199,10 @@ protected: std::string DefaultNasmFlagTableName; std::string DefaultRCFlagTableName; bool SupportsUnityBuilds = false; - bool SystemIsWindowsCE; - bool SystemIsWindowsPhone; - bool SystemIsWindowsStore; + bool SystemIsWindowsCE = false; + bool SystemIsWindowsPhone = false; + bool SystemIsWindowsStore = false; + bool SystemIsAndroid = false; private: class Factory; @@ -211,6 +226,7 @@ private: std::string MSBuildCommand; bool MSBuildCommandInitialized; cmVisualStudio10ToolsetOptions ToolsetOptions; + std::set<std::string> AndroidExecutableWarnings; virtual std::string FindMSBuildCommand(); std::string FindDevEnvCommand() override; std::string GetVSMakeProgram() override { return this->GetMSBuildCommand(); } diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index f549b6a..451d448 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -109,6 +109,7 @@ cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator( "ProductDir", vc14Express, cmSystemTools::KeyWOW64_32); this->DefaultPlatformToolset = "v140"; + this->DefaultAndroidToolset = "Clang_3_8"; this->DefaultCLFlagTableName = "v140"; this->DefaultCSharpFlagTableName = "v140"; this->DefaultLibFlagTableName = "v14"; @@ -159,6 +160,11 @@ bool cmGlobalVisualStudio14Generator::InitializeWindowsStore(cmMakefile* mf) return true; } +bool cmGlobalVisualStudio14Generator::InitializeAndroid(cmMakefile*) +{ + return true; +} + bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf, bool required) { diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h index ccc2917..39353f2 100644 --- a/Source/cmGlobalVisualStudio14Generator.h +++ b/Source/cmGlobalVisualStudio14Generator.h @@ -23,12 +23,18 @@ public: bool MatchesGeneratorName(const std::string& name) const override; + const char* GetAndroidApplicationTypeRevision() const override + { + return "2.0"; + } + protected: cmGlobalVisualStudio14Generator(cmake* cm, const std::string& name, std::string const& platformInGeneratorName); bool InitializeWindows(cmMakefile* mf) override; bool InitializeWindowsStore(cmMakefile* mf) override; + bool InitializeAndroid(cmMakefile* mf) override; bool SelectWindowsStoreToolset(std::string& toolset) const override; // These aren't virtual because we need to check if the selected version diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 605dc8b..e2e045c 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -100,6 +100,24 @@ static const char* VSVersionToToolset( return ""; } +static const char* VSVersionToAndroidToolset( + cmGlobalVisualStudioGenerator::VSVersion v) +{ + switch (v) { + case cmGlobalVisualStudioGenerator::VS9: + case cmGlobalVisualStudioGenerator::VS10: + case cmGlobalVisualStudioGenerator::VS11: + case cmGlobalVisualStudioGenerator::VS12: + return ""; + case cmGlobalVisualStudioGenerator::VS14: + return "Clang_3_8"; + case cmGlobalVisualStudioGenerator::VS15: + case cmGlobalVisualStudioGenerator::VS16: + return "Clang_5_0"; + } + return ""; +} + static const char vs15generatorName[] = "Visual Studio 15 2017"; // Map generator name without year to name with year. @@ -284,6 +302,7 @@ cmGlobalVisualStudioVersionedGenerator::cmGlobalVisualStudioVersionedGenerator( this->Version = version; this->ExpressEdition = false; this->DefaultPlatformToolset = VSVersionToToolset(this->Version); + this->DefaultAndroidToolset = VSVersionToAndroidToolset(this->Version); this->DefaultCLFlagTableName = VSVersionToToolset(this->Version); this->DefaultCSharpFlagTableName = VSVersionToToolset(this->Version); this->DefaultLinkFlagTableName = VSVersionToToolset(this->Version); @@ -408,6 +427,25 @@ bool cmGlobalVisualStudioVersionedGenerator::IsStdOutEncodingSupported() const vsInstanceVersion > vsInstanceVersion16_7_P2); } +const char* +cmGlobalVisualStudioVersionedGenerator::GetAndroidApplicationTypeRevision() + const +{ + switch (this->Version) { + case cmGlobalVisualStudioGenerator::VS9: + case cmGlobalVisualStudioGenerator::VS10: + case cmGlobalVisualStudioGenerator::VS11: + case cmGlobalVisualStudioGenerator::VS12: + return ""; + case cmGlobalVisualStudioGenerator::VS14: + return "2.0"; + case cmGlobalVisualStudioGenerator::VS15: + case cmGlobalVisualStudioGenerator::VS16: + return "3.0"; + } + return ""; +} + std::string cmGlobalVisualStudioVersionedGenerator::GetAuxiliaryToolset() const { const char* version = this->GetPlatformToolsetVersion(); diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.h b/Source/cmGlobalVisualStudioVersionedGenerator.h index cbd3ba7..d5b8337 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.h +++ b/Source/cmGlobalVisualStudioVersionedGenerator.h @@ -36,6 +36,8 @@ public: bool IsStdOutEncodingSupported() const override; + const char* GetAndroidApplicationTypeRevision() const override; + protected: cmGlobalVisualStudioVersionedGenerator( VSVersion version, cmake* cm, const std::string& name, diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index a5ce5d1..bb422eb 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -819,6 +819,14 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( default: break; } + + // explicitly add the explicit language flag before any other flag + // this way backwards compatibility with user flags is maintained + if (sf->GetProperty("LANGUAGE")) { + this->CurrentLocalGenerator->AppendFeatureOptions(flags, lang, + "EXPLICIT_LANGUAGE"); + } + const std::string COMPILE_FLAGS("COMPILE_FLAGS"); if (cmProp cflags = sf->GetProperty(COMPILE_FLAGS)) { lg->AppendFlags(flags, genexInterpreter.Evaluate(*cflags, COMPILE_FLAGS)); @@ -1144,23 +1152,24 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( } // organize the sources - std::vector<cmSourceFile*> classes; - if (!gtgt->GetConfigCommonSourceFiles(classes)) { + std::vector<cmSourceFile*> commonSourceFiles; + if (!gtgt->GetConfigCommonSourceFiles(commonSourceFiles)) { return false; } // Add CMakeLists.txt file for user convenience. - this->AddXCodeProjBuildRule(gtgt, classes); + this->AddXCodeProjBuildRule(gtgt, commonSourceFiles); // Add the Info.plist we are about to generate for an App Bundle. if (gtgt->GetPropertyAsBool("MACOSX_BUNDLE")) { std::string plist = this->ComputeInfoPListLocation(gtgt); cmSourceFile* sf = gtgt->Makefile->GetOrCreateSource( plist, true, cmSourceFileLocationKind::Known); - classes.push_back(sf); + commonSourceFiles.push_back(sf); } - std::sort(classes.begin(), classes.end(), cmSourceFilePathCompare()); + std::sort(commonSourceFiles.begin(), commonSourceFiles.end(), + cmSourceFilePathCompare()); gtgt->ComputeObjectMapping(); @@ -1168,7 +1177,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( std::vector<cmXCodeObject*> headerFiles; std::vector<cmXCodeObject*> resourceFiles; std::vector<cmXCodeObject*> sourceFiles; - for (auto sourceFile : classes) { + for (auto sourceFile : commonSourceFiles) { cmXCodeObject* xsf = this->CreateXCodeSourceFile( this->CurrentLocalGenerator, sourceFile, gtgt); cmXCodeObject* fr = xsf->GetObject("fileRef"); @@ -1267,7 +1276,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( using mapOfVectorOfSourceFiles = std::map<std::string, std::vector<cmSourceFile*>>; mapOfVectorOfSourceFiles bundleFiles; - for (auto sourceFile : classes) { + for (auto sourceFile : commonSourceFiles) { cmGeneratorTarget::SourceFileFlags tsFlags = gtgt->GetTargetSourceFileFlags(sourceFile); if (tsFlags.Type == cmGeneratorTarget::SourceFileTypeMacContent) { @@ -1315,7 +1324,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( using mapOfVectorOfSourceFiles = std::map<std::string, std::vector<cmSourceFile*>>; mapOfVectorOfSourceFiles bundleFiles; - for (auto sourceFile : classes) { + for (auto sourceFile : commonSourceFiles) { cmGeneratorTarget::SourceFileFlags tsFlags = gtgt->GetTargetSourceFileFlags(sourceFile); if (tsFlags.Type == cmGeneratorTarget::SourceFileTypeDeepResource) { @@ -1345,22 +1354,20 @@ bool cmGlobalXCodeGenerator::CreateXCodeTarget( } } - // create framework build phase + // always create framework build phase cmXCodeObject* frameworkBuildPhase = nullptr; - if (!externalObjFiles.empty()) { - frameworkBuildPhase = - this->CreateObject(cmXCodeObject::PBXFrameworksBuildPhase); - frameworkBuildPhase->SetComment("Frameworks"); - frameworkBuildPhase->AddAttribute("buildActionMask", - this->CreateString("2147483647")); - buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST); - frameworkBuildPhase->AddAttribute("files", buildFiles); - for (auto& externalObjFile : externalObjFiles) { - buildFiles->AddObject(externalObjFile); - } - frameworkBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing", - this->CreateString("0")); - } + frameworkBuildPhase = + this->CreateObject(cmXCodeObject::PBXFrameworksBuildPhase); + frameworkBuildPhase->SetComment("Frameworks"); + frameworkBuildPhase->AddAttribute("buildActionMask", + this->CreateString("2147483647")); + buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST); + frameworkBuildPhase->AddAttribute("files", buildFiles); + for (auto& externalObjFile : externalObjFiles) { + buildFiles->AddObject(externalObjFile); + } + frameworkBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing", + this->CreateString("0")); // create list of build phases and create the Xcode target cmXCodeObject* buildPhases = this->CreateObject(cmXCodeObject::OBJECT_LIST); @@ -2760,6 +2767,156 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) } } + // Separate libraries into ones that can be linked using "Link Binary With + // Libraries" build phase and the ones that can't. Only targets that build + // Apple bundles (.app, .framework, .bundle) can use this feature and only + // targets that represent actual libraries (static or dynamic, local or + // imported) not objects and not executables will be used. These are + // limitations imposed by CMake use-cases - otherwise a lot of things break. + // The rest will be linked using linker flags (OTHER_LDFLAGS setting in Xcode + // project). + std::map<std::string, std::vector<cmComputeLinkInformation::Item const*>> + configItemMap; + auto addToLinkerArguments = + [&configItemMap](const std::string& configName, + cmComputeLinkInformation::Item const* libItemPtr) { + auto& linkVector = configItemMap[configName]; + if (std::find_if(linkVector.begin(), linkVector.end(), + [libItemPtr](cmComputeLinkInformation::Item const* p) { + return p == libItemPtr; + }) == linkVector.end()) { + linkVector.push_back(libItemPtr); + } + }; + std::vector<cmComputeLinkInformation::Item const*> linkPhaseTargetVector; + std::map<std::string, std::vector<std::string>> targetConfigMap; + using ConfigItemPair = + std::pair<std::string, cmComputeLinkInformation::Item const*>; + std::map<std::string, std::vector<ConfigItemPair>> targetItemMap; + std::map<std::string, std::vector<std::string>> targetProductNameMap; + for (auto const& configName : this->CurrentConfigurationTypes) { + cmComputeLinkInformation* cli = gt->GetLinkInformation(configName); + if (!cli) { + continue; + } + for (auto const& libItem : cli->GetItems()) { + // TODO: Drop this check once we have option to add outside libraries to + // Xcode project + auto* libTarget = FindXCodeTarget(libItem.Target); + if (gt->IsBundleOnApple() && + (gt->GetType() == cmStateEnums::EXECUTABLE || + gt->GetType() == cmStateEnums::SHARED_LIBRARY || + gt->GetType() == cmStateEnums::MODULE_LIBRARY || + gt->GetType() == cmStateEnums::UNKNOWN_LIBRARY) && + (libTarget && libItem.Target && + (libItem.Target->GetType() == cmStateEnums::STATIC_LIBRARY || + libItem.Target->GetType() == cmStateEnums::SHARED_LIBRARY || + libItem.Target->GetType() == cmStateEnums::MODULE_LIBRARY))) { + // Add unique configuration name to target-config map for later + // checks + std::string libName = libItem.Target->GetName(); + auto& configVector = targetConfigMap[libName]; + if (std::find(configVector.begin(), configVector.end(), configName) == + configVector.end()) { + configVector.push_back(configName); + } + // Add a pair of config and item to target-item map + auto& itemVector = targetItemMap[libName]; + itemVector.emplace_back(ConfigItemPair(configName, &libItem)); + // Add product file-name to a lib-product map + auto productName = cmSystemTools::GetFilenameName(libItem.Value.Value); + auto& productVector = targetProductNameMap[libName]; + if (std::find(productVector.begin(), productVector.end(), + productName) == productVector.end()) { + productVector.push_back(productName); + } + } else { + // Add this library item to a regular linker flag list + addToLinkerArguments(configName, &libItem); + } + } + } + + // Go through target library map and separate libraries that are linked + // in all configurations and produce only single product, from the rest. + // Only these will be linked through "Link Binary With Libraries" build + // phase. + for (auto const& targetLibConfigs : targetConfigMap) { + // Add this library to "Link Binary With Libraries" build phase if it's + // linked in all configurations and it has only one product name + auto& itemVector = targetItemMap[targetLibConfigs.first]; + auto& productVector = targetProductNameMap[targetLibConfigs.first]; + if (targetLibConfigs.second == this->CurrentConfigurationTypes && + productVector.size() == 1) { + // Add this library to "Link Binary With Libraries" list + linkPhaseTargetVector.push_back(itemVector[0].second); + } else { + for (auto const& libItem : targetItemMap[targetLibConfigs.first]) { + // Add this library item to a regular linker flag list + addToLinkerArguments(libItem.first, libItem.second); + } + } + } + + // Add libraries to "Link Binary With Libraries" build phase and collect + // their search paths. Xcode does not support per-configuration linking + // in this build phase so we don't have to do this for each configuration + // separately. + std::vector<std::string> linkSearchPaths; + for (auto const& libItem : linkPhaseTargetVector) { + // Add target output directory as a library search path + std::string linkDir = cmSystemTools::GetParentDirectory( + libItem->Target->GetLocationForBuild()); + if (std::find(linkSearchPaths.begin(), linkSearchPaths.end(), linkDir) == + linkSearchPaths.end()) { + linkSearchPaths.push_back(linkDir); + } + // Add target dependency + auto const& libName = *libItem; + if (!libName.Target->IsImported()) { + for (auto const& configName : this->CurrentConfigurationTypes) { + target->AddDependTarget(configName, libName.Target->GetName()); + } + } + // Get the library target + auto* libTarget = FindXCodeTarget(libItem->Target); + if (!libTarget) { + continue; + } + // Add the target output file as a build reference for other targets + // to link against + auto* fileRefObject = libTarget->GetObject("productReference"); + if (!fileRefObject) { + continue; + } + cmXCodeObject* buildFile; + auto it = FileRefToBuildFileMap.find(fileRefObject); + if (it == FileRefToBuildFileMap.end()) { + buildFile = this->CreateObject(cmXCodeObject::PBXBuildFile); + buildFile->AddAttribute("fileRef", fileRefObject); + FileRefToBuildFileMap[fileRefObject] = buildFile; + } else { + buildFile = it->second; + } + // Add this reference to current target + auto* buildPhases = target->GetObject("buildPhases"); + if (!buildPhases) { + continue; + } + auto* frameworkBuildPhase = + buildPhases->GetObject(cmXCodeObject::PBXFrameworksBuildPhase); + if (!frameworkBuildPhase) { + continue; + } + auto* buildFiles = frameworkBuildPhase->GetObject("files"); + if (!buildFiles) { + continue; + } + if (!buildFiles->HasObject(buildFile)) { + buildFiles->AddObject(buildFile); + } + } + // Loop over configuration types and set per-configuration info. for (auto const& configName : this->CurrentConfigurationTypes) { { @@ -2787,21 +2944,20 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) } // Compute the link library and directory information. - cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName); - if (!pcli) { + cmComputeLinkInformation* cli = gt->GetLinkInformation(configName); + if (!cli) { continue; } - cmComputeLinkInformation& cli = *pcli; // Add dependencies directly on library files. - for (auto const& libDep : cli.GetDepends()) { + for (auto const& libDep : cli->GetDepends()) { target->AddDependLibrary(configName, libDep); } // add the library search paths { std::string linkDirs; - for (auto const& libDir : cli.GetDirectories()) { + for (auto const& libDir : cli->GetDirectories()) { if (!libDir.empty() && libDir != "/usr/lib") { // Now add the same one but append // $(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) to it: @@ -2812,15 +2968,22 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) linkDirs += this->XCodeEscapePath(libDir); } } + // Add previously collected paths where to look for libraries + // that were added to "Link Binary With Libraries" + for (auto& linkDir : linkSearchPaths) { + linkDirs += " "; + linkDirs += this->XCodeEscapePath(linkDir); + } this->AppendBuildSettingAttribute(target, "LIBRARY_SEARCH_PATHS", linkDirs.c_str(), configName); } - // now add the link libraries + // now add the left-over link libraries { std::string linkLibs; const char* sep = ""; - for (auto const& libName : cli.GetItems()) { + for (auto const& libItem : configItemMap[configName]) { + auto const& libName = *libItem; linkLibs += sep; sep = " "; if (libName.IsPath) { diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index e380f1c..0fc6558 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -28,7 +28,7 @@ struct cmDocumentationEntry; /** \class cmGlobalXCodeGenerator * \brief Write a Unix makefiles. * - * cmGlobalXCodeGenerator manages UNIX build process for a tree + * cmGlobalXCodeGenerator manages Xcode build process for a tree */ class cmGlobalXCodeGenerator : public cmGlobalGenerator { @@ -295,6 +295,7 @@ private: std::map<std::string, cmXCodeObject*> TargetGroup; std::map<std::string, cmXCodeObject*> FileRefs; std::map<cmGeneratorTarget const*, cmXCodeObject*> XCodeObjectMap; + std::map<cmXCodeObject*, cmXCodeObject*> FileRefToBuildFileMap; std::vector<std::string> Architectures; std::string ObjectDirArchDefault; std::string ObjectDirArch; diff --git a/Source/cmLinkItemGraphVisitor.cxx b/Source/cmLinkItemGraphVisitor.cxx index acc23c8..b13def8 100644 --- a/Source/cmLinkItemGraphVisitor.cxx +++ b/Source/cmLinkItemGraphVisitor.cxx @@ -24,10 +24,6 @@ void cmLinkItemGraphVisitor::VisitItem(cmLinkItem const& item) void cmLinkItemGraphVisitor::VisitLinks(cmLinkItem const& item, cmLinkItem const& rootItem) { - if (this->LinkVisited(item, rootItem)) { - return; - } - if (item.Target == nullptr) { return; } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 3b3f110..95caa30 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -803,39 +803,8 @@ bool cmLocalGenerator::ComputeTargetCompileFeatures() // Now that C/C++ _STANDARD values have been computed // set the values to ObjC/ObjCXX _STANDARD variables if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY) { - auto copyStandardToObjLang = [&](LanguagePair const& lang) -> bool { - if (!target->GetProperty(cmStrCat(lang.first, "_STANDARD"))) { - cmProp standard = - target->GetProperty(cmStrCat(lang.second, "_STANDARD")); - if (!standard) { - standard = this->Makefile->GetDef( - cmStrCat("CMAKE_", lang.second, "_STANDARD_DEFAULT")); - } - target->Target->SetProperty(cmStrCat(lang.first, "_STANDARD"), - standard ? standard->c_str() : nullptr); - return true; - } - return false; - }; - auto copyPropertyToObjLang = [&](LanguagePair const& lang, - const char* property) { - if (!target->GetProperty(cmStrCat(lang.first, property)) && - target->GetProperty(cmStrCat(lang.second, property))) { - cmProp p = target->GetProperty(cmStrCat(lang.second, property)); - target->Target->SetProperty(cmStrCat(lang.first, property), - p ? p->c_str() : nullptr); - } - }; - for (auto const& lang : pairedLanguages) { - if (copyStandardToObjLang(lang)) { - copyPropertyToObjLang(lang, "_STANDARD_REQUIRED"); - copyPropertyToObjLang(lang, "_EXTENSIONS"); - } - } - if (cmProp standard = target->GetProperty("CUDA_STANDARD")) { - if (*standard == "98") { - target->Target->SetProperty("CUDA_STANDARD", "03"); - } + for (std::string const& c : configNames) { + target->ComputeCompileFeatures(c, inferredEnabledLanguages); } } } @@ -1026,7 +995,7 @@ void cmLocalGenerator::AddCompileOptions(std::vector<BT<std::string>>& flags, } for (auto const& it : target->GetMaxLanguageStandards()) { - cmProp standard = target->GetProperty(it.first + "_STANDARD"); + cmProp standard = target->GetLanguageStandard(it.first, config); if (!standard) { continue; } @@ -1050,7 +1019,7 @@ void cmLocalGenerator::AddCompileOptions(std::vector<BT<std::string>>& flags, } std::string compReqFlag; - this->AddCompilerRequirementFlag(compReqFlag, target, lang); + this->AddCompilerRequirementFlag(compReqFlag, target, lang, config); if (!compReqFlag.empty()) { flags.emplace_back(std::move(compReqFlag)); } @@ -2046,7 +2015,7 @@ void cmLocalGenerator::AddLanguageFlagsForLinking( // when linking in order to use the matching standard library. // FIXME: If CMake gains an abstraction for standard library // selection, this will have to be reconciled with it. - this->AddCompilerRequirementFlag(flags, target, lang); + this->AddCompilerRequirementFlag(flags, target, lang, config); } this->AddLanguageFlags(flags, target, lang, config); @@ -2189,7 +2158,8 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags, } void cmLocalGenerator::AddCompilerRequirementFlag( - std::string& flags, cmGeneratorTarget const* target, const std::string& lang) + std::string& flags, cmGeneratorTarget const* target, const std::string& lang, + const std::string& config) { if (lang.empty()) { return; @@ -2200,15 +2170,13 @@ void cmLocalGenerator::AddCompilerRequirementFlag( // This compiler has no notion of language standard levels. return; } - std::string extProp = lang + "_EXTENSIONS"; bool ext = true; - if (cmProp extPropValue = target->GetProperty(extProp)) { + if (cmProp extPropValue = target->GetLanguageExtensions(lang)) { if (cmIsOff(*extPropValue)) { ext = false; } } - std::string stdProp = lang + "_STANDARD"; - cmProp standardProp = target->GetProperty(stdProp); + cmProp standardProp = target->GetLanguageStandard(lang, config); if (!standardProp) { if (ext) { // No language standard is specified and extensions are not disabled. @@ -2228,7 +2196,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag( std::string const type = ext ? "EXTENSION" : "STANDARD"; - if (target->GetPropertyAsBool(lang + "_STANDARD_REQUIRED")) { + if (target->GetLanguageStandardRequired(lang)) { std::string option_flag = "CMAKE_" + lang + *standardProp + "_" + type + "_COMPILE_OPTION"; diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index f2d9145..f4781d6 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -123,7 +123,8 @@ public: const std::string& config); void AddCompilerRequirementFlag(std::string& flags, cmGeneratorTarget const* target, - const std::string& lang); + const std::string& lang, + const std::string& config); //! Append flags to a string. virtual void AppendFlags(std::string& flags, const std::string& newFlags) const; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index c78b751..891e290 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -39,6 +39,7 @@ #include "cmGeneratedFileStream.h" #include "cmGeneratorExpression.h" #include "cmGeneratorExpressionEvaluationFile.h" +#include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" #include "cmInstallGenerator.h" // IWYU pragma: keep #include "cmInstallSubdirectoryGenerator.h" @@ -1658,7 +1659,8 @@ void cmMakefile::Configure() this->SetCheckCMP0000(true); // Implicitly set the version for the user. - this->SetPolicyVersion("2.4", std::string()); + cmPolicies::ApplyPolicyVersion(this, 2, 4, 0, + cmPolicies::WarnCompat::Off); } } bool hasProject = false; @@ -4027,6 +4029,8 @@ int cmMakefile::ConfigureFile(const std::string& infile, if (copyonly) { if (!cmSystemTools::CopyFileIfDifferent(sinfile, soutfile)) { + this->IssueMessage(MessageType::FATAL_ERROR, + cmSystemTools::GetLastSystemError()); return 0; } } else { @@ -4077,9 +4081,15 @@ int cmMakefile::ConfigureFile(const std::string& infile, fin.close(); fout.close(); if (!cmSystemTools::CopyFileIfDifferent(tempOutputFile, soutfile)) { + this->IssueMessage(MessageType::FATAL_ERROR, + cmSystemTools::GetLastSystemError()); res = 0; } else { - cmSystemTools::SetPermissions(soutfile, perm); + if (!cmSystemTools::SetPermissions(soutfile, perm)) { + this->IssueMessage(MessageType::FATAL_ERROR, + cmSystemTools::GetLastSystemError()); + res = 0; + } } cmSystemTools::RemoveFile(tempOutputFile); } @@ -4554,7 +4564,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, // Deprecate old policies, especially those that require a lot // of code to maintain the old behavior. - if (status == cmPolicies::OLD && id <= cmPolicies::CMP0071 && + if (status == cmPolicies::OLD && id <= cmPolicies::CMP0072 && !(this->GetCMakeInstance()->GetIsInTryCompile() && ( // Policies set by cmCoreTryCompile::TryCompileCode. @@ -4596,7 +4606,7 @@ void cmMakefile::PopSnapshot(bool reportError) // cmStateSnapshot manages nested policy scopes within it. // Since the scope corresponding to the snapshot is closing, // reject any still-open nested policy scopes with an error. - while (!this->StateSnapshot.CanPopPolicyScope()) { + while (this->StateSnapshot.CanPopPolicyScope()) { if (reportError) { this->IssueMessage(MessageType::FATAL_ERROR, "cmake_policy PUSH without matching POP"); @@ -4612,7 +4622,8 @@ void cmMakefile::PopSnapshot(bool reportError) bool cmMakefile::SetPolicyVersion(std::string const& version_min, std::string const& version_max) { - return cmPolicies::ApplyPolicyVersion(this, version_min, version_max); + return cmPolicies::ApplyPolicyVersion(this, version_min, version_max, + cmPolicies::WarnCompat::On); } bool cmMakefile::HasCMP0054AlreadyBeenReported( @@ -4673,7 +4684,33 @@ bool cmMakefile::AddRequiredTargetFeature(cmTarget* target, } std::string lang; - if (!this->CompileFeatureKnown(target, feature, lang, error)) { + if (!this->CheckCompileFeaturesAvailable(target->GetName(), feature, lang, + error)) { + return false; + } + + target->AppendProperty("COMPILE_FEATURES", feature); + + // FIXME: Add a policy to avoid updating the <LANG>_STANDARD target + // property due to COMPILE_FEATURES. The language standard selection + // should be done purely at generate time based on whatever the project + // code put in these properties explicitly. That is mostly true now, + // but for compatibility we need to continue updating the property here. + if (lang == "C" || lang == "OBJC") { + return this->AddRequiredTargetCFeature(target, feature, lang, error); + } + if (lang == "CUDA") { + return this->AddRequiredTargetCudaFeature(target, feature, lang, error); + } + return this->AddRequiredTargetCxxFeature(target, feature, lang, error); +} + +bool cmMakefile::CheckCompileFeaturesAvailable(const std::string& targetName, + const std::string& feature, + std::string& lang, + std::string* error) const +{ + if (!this->CompileFeatureKnown(targetName, feature, lang, error)) { return false; } @@ -4699,18 +4736,10 @@ bool cmMakefile::AddRequiredTargetFeature(cmTarget* target, return false; } - target->AppendProperty("COMPILE_FEATURES", feature); - - if (lang == "C" || lang == "OBJC") { - return this->AddRequiredTargetCFeature(target, feature, lang, error); - } - if (lang == "CUDA") { - return this->AddRequiredTargetCudaFeature(target, feature, lang, error); - } - return this->AddRequiredTargetCxxFeature(target, feature, lang, error); + return true; } -bool cmMakefile::CompileFeatureKnown(cmTarget const* target, +bool cmMakefile::CompileFeatureKnown(const std::string& targetName, const std::string& feature, std::string& lang, std::string* error) const @@ -4747,7 +4776,7 @@ bool cmMakefile::CompileFeatureKnown(cmTarget const* target, e << " unknown feature \"" << feature << "\" for " "target \"" - << target->GetName() << "\"."; + << targetName << "\"."; if (error) { *error = e.str(); } else { @@ -4802,22 +4831,50 @@ const char* cmMakefile::CompileFeaturesAvailable(const std::string& lang, return featuresKnown; } -bool cmMakefile::HaveStandardAvailable(cmTarget const* target, +bool cmMakefile::GetNewRequiredStandard(const std::string& targetName, + const std::string& feature, + cmProp currentLangStandardValue, + std::string& newRequiredStandard, + std::string* error) const +{ + std::string lang; + if (!this->CheckCompileFeaturesAvailable(targetName, feature, lang, error)) { + return false; + } + + if (lang == "C" || lang == "OBJC") { + return this->GetNewRequiredCStandard(targetName, feature, lang, + currentLangStandardValue, + newRequiredStandard, error); + } + if (lang == "CUDA") { + return this->GetNewRequiredCudaStandard(targetName, feature, lang, + currentLangStandardValue, + newRequiredStandard, error); + } + return this->GetNewRequiredCxxStandard(targetName, feature, lang, + currentLangStandardValue, + newRequiredStandard, error); +} + +bool cmMakefile::HaveStandardAvailable(cmGeneratorTarget const* target, std::string const& lang, + std::string const& config, const std::string& feature) const { if (lang == "C" || lang == "OBJC") { - return this->HaveCStandardAvailable(target, feature, lang); + return this->HaveCStandardAvailable(target, lang, config, feature); } if (lang == "CUDA") { - return this->HaveCudaStandardAvailable(target, feature, lang); + return this->HaveCudaStandardAvailable(target, lang, config, feature); } - return this->HaveCxxStandardAvailable(target, feature, lang); + return this->HaveCxxStandardAvailable(target, lang, config, feature); } -bool cmMakefile::HaveCStandardAvailable(cmTarget const* target, - const std::string& feature, - std::string const& lang) const +bool cmMakefile::HaveCStandardAvailable(cmGeneratorTarget const* target, + std::string const& lang, + std::string const& config, + const std::string& feature) const { cmProp defaultCStandard = this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT")); @@ -4846,7 +4903,7 @@ bool cmMakefile::HaveCStandardAvailable(cmTarget const* target, this->CheckNeededCLanguage(feature, lang, needC90, needC99, needC11); - cmProp existingCStandard = target->GetProperty(cmStrCat(lang, "_STANDARD")); + cmProp existingCStandard = target->GetLanguageStandard(lang, config); if (!existingCStandard) { existingCStandard = defaultCStandard; } @@ -4909,9 +4966,10 @@ bool cmMakefile::IsLaterStandard(std::string const& lang, cm::cend(CXX_STANDARDS); } -bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, - const std::string& feature, - std::string const& lang) const +bool cmMakefile::HaveCxxStandardAvailable(cmGeneratorTarget const* target, + std::string const& lang, + std::string const& config, + const std::string& feature) const { cmProp defaultCxxStandard = this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT")); @@ -4941,8 +4999,7 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target, this->CheckNeededCxxLanguage(feature, lang, needCxx98, needCxx11, needCxx14, needCxx17, needCxx20); - cmProp existingCxxStandard = - target->GetProperty(cmStrCat(lang, "_STANDARD")); + cmProp existingCxxStandard = target->GetLanguageStandard(lang, config); if (!existingCxxStandard) { existingCxxStandard = defaultCxxStandard; } @@ -5009,6 +5066,29 @@ bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target, std::string const& lang, std::string* error) const { + std::string newRequiredStandard; + if (this->GetNewRequiredCxxStandard( + target->GetName(), feature, lang, + target->GetProperty(cmStrCat(lang, "_STANDARD")), newRequiredStandard, + error)) { + if (!newRequiredStandard.empty()) { + target->SetProperty(cmStrCat(lang, "_STANDARD"), newRequiredStandard); + } + return true; + } + + return false; +} + +bool cmMakefile::GetNewRequiredCxxStandard(const std::string& targetName, + const std::string& feature, + std::string const& lang, + cmProp currentLangStandardValue, + std::string& newRequiredStandard, + std::string* error) const +{ + newRequiredStandard.clear(); + bool needCxx98 = false; bool needCxx11 = false; bool needCxx14 = false; @@ -5018,8 +5098,7 @@ bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target, this->CheckNeededCxxLanguage(feature, lang, needCxx98, needCxx11, needCxx14, needCxx17, needCxx20); - cmProp existingCxxStandard = - target->GetProperty(cmStrCat(lang, "_STANDARD")); + cmProp existingCxxStandard = currentLangStandardValue; if (existingCxxStandard == nullptr) { cmProp defaultCxxStandard = this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT")); @@ -5034,7 +5113,7 @@ bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target, cmStrCmp(*existingCxxStandard)); if (existingCxxLevel == cm::cend(CXX_STANDARDS)) { const std::string e = cmStrCat( - "The ", lang, "_STANDARD property on target \"", target->GetName(), + "The ", lang, "_STANDARD property on target \"", targetName, "\" contained an invalid value: \"", *existingCxxStandard, "\"."); if (error) { *error = e; @@ -5060,16 +5139,17 @@ bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target, // Ensure the C++ language level is high enough to support // the needed C++ features. if (!existingCxxLevel || existingCxxLevel < needCxxLevel) { - target->SetProperty(cmStrCat(lang, "_STANDARD"), *needCxxLevel); + newRequiredStandard = *needCxxLevel; } } return true; } -bool cmMakefile::HaveCudaStandardAvailable(cmTarget const* target, - const std::string& feature, - std::string const& lang) const +bool cmMakefile::HaveCudaStandardAvailable(cmGeneratorTarget const* target, + std::string const& lang, + std::string const& config, + const std::string& feature) const { cmProp defaultCudaStandard = this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT")); @@ -5100,8 +5180,7 @@ bool cmMakefile::HaveCudaStandardAvailable(cmTarget const* target, this->CheckNeededCudaLanguage(feature, lang, needCuda03, needCuda11, needCuda14, needCuda17, needCuda20); - cmProp existingCudaStandard = - target->GetProperty(cmStrCat(lang, "_STANDARD")); + cmProp existingCudaStandard = target->GetLanguageStandard(lang, config); if (!existingCudaStandard) { existingCudaStandard = defaultCudaStandard; } @@ -5168,6 +5247,28 @@ bool cmMakefile::AddRequiredTargetCudaFeature(cmTarget* target, std::string const& lang, std::string* error) const { + std::string newRequiredStandard; + if (this->GetNewRequiredCudaStandard( + target->GetName(), feature, lang, + target->GetProperty(cmStrCat(lang, "_STANDARD")), newRequiredStandard, + error)) { + if (!newRequiredStandard.empty()) { + target->SetProperty(cmStrCat(lang, "_STANDARD"), newRequiredStandard); + } + return true; + } + return false; +} + +bool cmMakefile::GetNewRequiredCudaStandard(const std::string& targetName, + const std::string& feature, + std::string const& lang, + cmProp currentLangStandardValue, + std::string& newRequiredStandard, + std::string* error) const +{ + newRequiredStandard.clear(); + bool needCuda03 = false; bool needCuda11 = false; bool needCuda14 = false; @@ -5177,8 +5278,7 @@ bool cmMakefile::AddRequiredTargetCudaFeature(cmTarget* target, this->CheckNeededCudaLanguage(feature, lang, needCuda03, needCuda11, needCuda14, needCuda17, needCuda20); - cmProp existingCudaStandard = - target->GetProperty(cmStrCat(lang, "_STANDARD")); + cmProp existingCudaStandard = currentLangStandardValue; if (existingCudaStandard == nullptr) { cmProp defaultCudaStandard = this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT")); @@ -5193,7 +5293,7 @@ bool cmMakefile::AddRequiredTargetCudaFeature(cmTarget* target, cmStrCmp(*existingCudaStandard)); if (existingCudaLevel == cm::cend(CUDA_STANDARDS)) { const std::string e = cmStrCat( - "The ", lang, "_STANDARD property on target \"", target->GetName(), + "The ", lang, "_STANDARD property on target \"", targetName, "\" contained an invalid value: \"", *existingCudaStandard, "\"."); if (error) { *error = e; @@ -5219,7 +5319,7 @@ bool cmMakefile::AddRequiredTargetCudaFeature(cmTarget* target, // Ensure the CUDA language level is high enough to support // the needed CUDA features. if (!existingCudaLevel || existingCudaLevel < needCudaLevel) { - target->SetProperty("CUDA_STANDARD", *needCudaLevel); + newRequiredStandard = *needCudaLevel; } } @@ -5252,13 +5352,36 @@ bool cmMakefile::AddRequiredTargetCFeature(cmTarget* target, std::string const& lang, std::string* error) const { + std::string newRequiredStandard; + if (this->GetNewRequiredCStandard( + target->GetName(), feature, lang, + target->GetProperty(cmStrCat(lang, "_STANDARD")), newRequiredStandard, + error)) { + if (!newRequiredStandard.empty()) { + target->SetProperty(cmStrCat(lang, "_STANDARD"), newRequiredStandard); + } + return true; + } + + return false; +} + +bool cmMakefile::GetNewRequiredCStandard(const std::string& targetName, + const std::string& feature, + std::string const& lang, + cmProp currentLangStandardValue, + std::string& newRequiredStandard, + std::string* error) const +{ + newRequiredStandard.clear(); + bool needC90 = false; bool needC99 = false; bool needC11 = false; this->CheckNeededCLanguage(feature, lang, needC90, needC99, needC11); - cmProp existingCStandard = target->GetProperty(cmStrCat(lang, "_STANDARD")); + cmProp existingCStandard = currentLangStandardValue; if (existingCStandard == nullptr) { cmProp defaultCStandard = this->GetDef(cmStrCat("CMAKE_", lang, "_STANDARD_DEFAULT")); @@ -5270,7 +5393,7 @@ bool cmMakefile::AddRequiredTargetCFeature(cmTarget* target, if (std::find_if(cm::cbegin(C_STANDARDS), cm::cend(C_STANDARDS), cmStrCmp(*existingCStandard)) == cm::cend(C_STANDARDS)) { const std::string e = cmStrCat( - "The ", lang, "_STANDARD property on target \"", target->GetName(), + "The ", lang, "_STANDARD property on target \"", targetName, "\" contained an invalid value: \"", *existingCStandard, "\"."); if (error) { *error = e; @@ -5307,11 +5430,11 @@ bool cmMakefile::AddRequiredTargetCFeature(cmTarget* target, } if (setC11) { - target->SetProperty(cmStrCat(lang, "_STANDARD"), "11"); + newRequiredStandard = "11"; } else if (setC99) { - target->SetProperty(cmStrCat(lang, "_STANDARD"), "99"); + newRequiredStandard = "99"; } else if (setC90) { - target->SetProperty(cmStrCat(lang, "_STANDARD"), "90"); + newRequiredStandard = "90"; } return true; } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 45d7109..332554e 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -47,6 +47,7 @@ class cmExpandedCommandArgument; class cmExportBuildFileGenerator; class cmFunctionBlocker; class cmGeneratorExpressionEvaluationFile; +class cmGeneratorTarget; class cmGlobalGenerator; class cmImplicitDependsList; class cmInstallGenerator; @@ -928,13 +929,22 @@ public: bool AddRequiredTargetFeature(cmTarget* target, const std::string& feature, std::string* error = nullptr) const; - bool CompileFeatureKnown(cmTarget const* target, const std::string& feature, - std::string& lang, std::string* error) const; + bool CompileFeatureKnown(const std::string& targetName, + const std::string& feature, std::string& lang, + std::string* error) const; const char* CompileFeaturesAvailable(const std::string& lang, std::string* error) const; - bool HaveStandardAvailable(cmTarget const* target, std::string const& lang, + bool GetNewRequiredStandard(const std::string& targetName, + const std::string& feature, + cmProp currentLangStandardValue, + std::string& newRequiredStandard, + std::string* error = nullptr) const; + + bool HaveStandardAvailable(cmGeneratorTarget const* target, + std::string const& lang, + std::string const& config, const std::string& feature) const; bool IsLaterStandard(std::string const& lang, std::string const& lhs, @@ -1174,6 +1184,11 @@ private: std::string const& lang, std::string* error = nullptr) const; + bool CheckCompileFeaturesAvailable(const std::string& targetName, + const std::string& feature, + std::string& lang, + std::string* error) const; + void CheckNeededCLanguage(const std::string& feature, std::string const& lang, bool& needC90, bool& needC99, bool& needC11) const; @@ -1186,15 +1201,37 @@ private: bool& needCuda11, bool& needCuda14, bool& needCuda17, bool& needCuda20) const; - bool HaveCStandardAvailable(cmTarget const* target, - const std::string& feature, - std::string const& lang) const; - bool HaveCxxStandardAvailable(cmTarget const* target, - const std::string& feature, - std::string const& lang) const; - bool HaveCudaStandardAvailable(cmTarget const* target, + bool GetNewRequiredCStandard(const std::string& targetName, + const std::string& feature, + std::string const& lang, + cmProp currentLangStandardValue, + std::string& newRequiredStandard, + std::string* error = nullptr) const; + bool GetNewRequiredCxxStandard(const std::string& targetName, const std::string& feature, - std::string const& lang) const; + std::string const& lang, + cmProp currentLangStandardValue, + std::string& newRequiredStandard, + std::string* error = nullptr) const; + bool GetNewRequiredCudaStandard(const std::string& targetName, + const std::string& feature, + std::string const& lang, + cmProp currentLangStandardValue, + std::string& newRequiredStandard, + std::string* error = nullptr) const; + + bool HaveCStandardAvailable(cmGeneratorTarget const* target, + std::string const& lang, + std::string const& config, + const std::string& feature) const; + bool HaveCxxStandardAvailable(cmGeneratorTarget const* target, + std::string const& lang, + std::string const& config, + const std::string& feature) const; + bool HaveCudaStandardAvailable(cmGeneratorTarget const* target, + std::string const& lang, + std::string const& config, + const std::string& feature) const; void CheckForUnusedVariables() const; diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 8396fa3..6887569 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -532,6 +532,13 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles( // Build the set of compiler flags. std::string flags; + // explicitly add the explicit language flag before any other flag + // this way backwards compatibility with user flags is maintained + if (source.GetProperty("LANGUAGE")) { + this->LocalGenerator->AppendFeatureOptions(flags, lang, + "EXPLICIT_LANGUAGE"); + } + // Add language-specific flags. std::string langFlags = cmStrCat("$(", lang, "_FLAGS", filterArch, ")"); this->LocalGenerator->AppendFlags(flags, langFlags); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index d406c99..0c7591a 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -188,7 +188,16 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject( } } - std::string flags = this->GetFlags(language, config, filterArch); + std::string flags; + // explicitly add the explicit language flag before any other flag + // this way backwards compatibility with user flags is maintained + if (source->GetProperty("LANGUAGE")) { + this->LocalGenerator->AppendFeatureOptions(flags, language, + "EXPLICIT_LANGUAGE"); + flags += " "; + } + + flags += this->GetFlags(language, config, filterArch); // Add Fortran format flags. if (language == "Fortran") { diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index dea3f8a..01e8c04 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -7,9 +7,11 @@ #include <sstream> #include <vector> +#include "cmListFileCache.h" #include "cmMakefile.h" #include "cmMessageType.h" #include "cmState.h" +#include "cmStateSnapshot.h" #include "cmStateTypes.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" @@ -157,7 +159,8 @@ static bool GetPolicyDefault(cmMakefile* mf, std::string const& policy, bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, std::string const& version_min, - std::string const& version_max) + std::string const& version_max, + WarnCompat warnCompat) { // Parse components of the minimum version. unsigned int minMajor = 2; @@ -244,13 +247,34 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, polPatch = maxPatch; } - return cmPolicies::ApplyPolicyVersion(mf, polMajor, polMinor, polPatch); + return cmPolicies::ApplyPolicyVersion(mf, polMajor, polMinor, polPatch, + warnCompat); } bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer, unsigned int minorVer, - unsigned int patchVer) + unsigned int patchVer, + WarnCompat warnCompat) { + // Warn about policy versions for which support will be removed. + if (warnCompat == WarnCompat::On && + (majorVer < 2 || (majorVer == 2 && minorVer < 8) || + (majorVer == 2 && minorVer == 8 && patchVer < 12)) && + // Avoid warning on calls generated by install(EXPORT) + // in CMake versions prior to 3.18. + !(majorVer == 2 && minorVer == 6 && patchVer == 0 && + mf->GetStateSnapshot().CanPopPolicyScope() && + cmSystemTools::Strucmp(mf->GetBacktrace().Top().Name.c_str(), + "cmake_policy") == 0)) { + mf->IssueMessage( + MessageType::DEPRECATION_WARNING, + "Compatibility with CMake < 2.8.12 will be removed from " + "a future version of CMake.\n" + "Update the VERSION argument <min> value or use a ...<max> suffix " + "to tell CMake that the project does not need compatibility with " + "older versions."); + } + // now loop over all the policies and set them as appropriate std::vector<cmPolicies::PolicyID> ancientPolicies; for (PolicyID pid = cmPolicies::CMP0000; pid != cmPolicies::CMPCOUNT; diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index a82f421..bba8b03 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -320,7 +320,10 @@ class cmMakefile; SELECT(POLICY, CMP0107, "An ALIAS target cannot overwrite another target.", \ 3, 18, 0, cmPolicies::WARN) \ SELECT(POLICY, CMP0108, "A target cannot link to itself through an alias.", \ - 3, 18, 0, cmPolicies::WARN) + 3, 18, 0, cmPolicies::WARN) \ + SELECT(POLICY, CMP0109, \ + "find_program() requires permission to execute but not to read.", 3, \ + 19, 0, cmPolicies::WARN) #define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1) #define CM_FOR_EACH_POLICY_ID(POLICY) \ @@ -396,12 +399,20 @@ public: //! Get the default status for a policy static cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id); + enum class WarnCompat + { + Off, + On + }; + //! Set a policy level for this listfile static bool ApplyPolicyVersion(cmMakefile* mf, std::string const& version_min, - std::string const& version_max); + std::string const& version_max, + WarnCompat warnCompat); static bool ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer, - unsigned int minorVer, unsigned int patchVer); + unsigned int minorVer, unsigned int patchVer, + WarnCompat warnCompat); //! return a warning string for a given policy static std::string GetPolicyWarning(cmPolicies::PolicyID id); diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 511a018..e733a3e 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -789,9 +789,9 @@ bool cmQtAutoGenInitializer::InitScanFiles() // Register files that will be scanned by moc or uic if (this->MocOrUicEnabled()) { - if (cm->IsHeaderExtension(extLower)) { + if (cm->IsAHeaderExtension(extLower)) { addMUHeader(makeMUFile(sf, fullPath, true), extLower); - } else if (cm->IsSourceExtension(extLower)) { + } else if (cm->IsACLikeSourceExtension(extLower)) { addMUSource(makeMUFile(sf, fullPath, true)); } } @@ -895,14 +895,14 @@ bool cmQtAutoGenInitializer::InitScanFiles() std::string const& extLower = cmSystemTools::LowerCase(sf->GetExtension()); - if (cm->IsHeaderExtension(extLower)) { + if (cm->IsAHeaderExtension(extLower)) { if (!cm::contains(this->AutogenTarget.Headers, sf.get())) { auto muf = makeMUFile(sf.get(), fullPath, false); if (muf->SkipMoc || muf->SkipUic) { addMUHeader(std::move(muf), extLower); } } - } else if (cm->IsSourceExtension(extLower)) { + } else if (cm->IsACLikeSourceExtension(extLower)) { if (!cm::contains(this->AutogenTarget.Sources, sf.get())) { auto muf = makeMUFile(sf.get(), fullPath, false); if (muf->SkipMoc || muf->SkipUic) { diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index f525439..781ddbc 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -2,7 +2,6 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmSourceFile.h" -#include <array> #include <utility> #include "cmGlobalGenerator.h" @@ -130,13 +129,11 @@ bool cmSourceFile::FindFullPath(std::string* error) // Location path std::string const& lPath = this->Location.GetFullPath(); // List of extension lists - std::array<std::vector<std::string> const*, 2> const extsLists = { - { &makefile->GetCMakeInstance()->GetSourceExtensions(), - &makefile->GetCMakeInstance()->GetHeaderExtensions() } - }; + std::vector<std::string> exts = + makefile->GetCMakeInstance()->GetAllExtensions(); // Tries to find the file in a given directory - auto findInDir = [this, &extsLists, &lPath](std::string const& dir) -> bool { + auto findInDir = [this, &exts, &lPath](std::string const& dir) -> bool { // Compute full path std::string const fullPath = cmSystemTools::CollapseFullPath(lPath, dir); // Try full path @@ -145,14 +142,12 @@ bool cmSourceFile::FindFullPath(std::string* error) return true; } // Try full path with extension - for (auto& exts : extsLists) { - for (std::string const& ext : *exts) { - if (!ext.empty()) { - std::string extPath = cmStrCat(fullPath, '.', ext); - if (cmSystemTools::FileExists(extPath)) { - this->FullPath = extPath; - return true; - } + for (std::string const& ext : exts) { + if (!ext.empty()) { + std::string extPath = cmStrCat(fullPath, '.', ext); + if (cmSystemTools::FileExists(extPath)) { + this->FullPath = extPath; + return true; } } } @@ -175,11 +170,9 @@ bool cmSourceFile::FindFullPath(std::string* error) // Compose error std::string err = cmStrCat("Cannot find source file:\n ", lPath, "\nTried extensions"); - for (auto exts : extsLists) { - for (std::string const& ext : *exts) { - err += " ."; - err += ext; - } + for (std::string const& ext : exts) { + err += " ."; + err += ext; } if (error != nullptr) { *error = std::move(err); diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index e852c05..222bafa 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -101,7 +101,7 @@ void cmSourceFileLocation::UpdateExtension(const std::string& name) cmMakefile const* mf = this->Makefile; auto cm = mf->GetCMakeInstance(); if (!gg->GetLanguageFromExtension(ext.c_str()).empty() || - cm->IsSourceExtension(ext) || cm->IsHeaderExtension(ext)) { + cm->IsAKnownExtension(ext)) { // This is a known extension. Use the given filename with extension. this->Name = cmSystemTools::GetFilenameName(name); this->AmbiguousExtension = false; @@ -157,7 +157,7 @@ bool cmSourceFileLocation::MatchesAmbiguousExtension( auto ext = cm::string_view(this->Name).substr(loc.Name.size() + 1); cmMakefile const* mf = this->Makefile; auto cm = mf->GetCMakeInstance(); - return cm->IsSourceExtension(ext) || cm->IsHeaderExtension(ext); + return cm->IsAKnownExtension(ext); } bool cmSourceFileLocation::Matches(cmSourceFileLocation const& loc) diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx index c223431..15a98af 100644 --- a/Source/cmStateSnapshot.cxx +++ b/Source/cmStateSnapshot.cxx @@ -148,7 +148,7 @@ bool cmStateSnapshot::PopPolicy() bool cmStateSnapshot::CanPopPolicyScope() { - return this->Position->Policies == this->Position->PolicyScope; + return this->Position->Policies != this->Position->PolicyScope; } void cmStateSnapshot::SetPolicy(cmPolicies::PolicyID id, diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 36e1ad5..4091b06 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -636,6 +636,12 @@ bool cmTarget::IsAppBundleOnApple() const this->GetPropertyAsBool("MACOSX_BUNDLE")); } +bool cmTarget::IsAndroidGuiExecutable() const +{ + return (this->GetType() == cmStateEnums::EXECUTABLE && impl->IsAndroid && + this->GetPropertyAsBool("ANDROID_GUI")); +} + std::vector<cmCustomCommand> const& cmTarget::GetPreBuildCommands() const { return impl->PreBuildCommands; @@ -1865,7 +1871,7 @@ const char* cmTarget::GetSuffixVariableInternal( case cmStateEnums::RuntimeBinaryArtifact: // Android GUI application packages store the native // binary as a shared library. - return (impl->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI") + return (this->IsAndroidGuiExecutable() ? "CMAKE_SHARED_LIBRARY_SUFFIX" : "CMAKE_EXECUTABLE_SUFFIX"); case cmStateEnums::ImportLibraryArtifact: @@ -1906,7 +1912,7 @@ const char* cmTarget::GetPrefixVariableInternal( case cmStateEnums::RuntimeBinaryArtifact: // Android GUI application packages store the native // binary as a shared library. - return (impl->IsAndroid && this->GetPropertyAsBool("ANDROID_GUI") + return (this->IsAndroidGuiExecutable() ? "CMAKE_SHARED_LIBRARY_PREFIX" : ""); case cmStateEnums::ImportLibraryArtifact: diff --git a/Source/cmTarget.h b/Source/cmTarget.h index f0ddb68..e7498bd 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -209,6 +209,9 @@ public: //! Return whether this target is an executable Bundle on Apple. bool IsAppBundleOnApple() const; + //! Return whether this target is a GUI executable on Android. + bool IsAndroidGuiExecutable() const; + //! Get a backtrace from the creation of the target. cmListFileBacktrace const& GetBacktrace() const; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index a3ccd2b..10a4a0c 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -234,13 +234,14 @@ cmVisualStudio10TargetGenerator::cmVisualStudio10TargetGenerator( { this->Makefile->GetConfigurations(this->Configurations); this->NsightTegra = gg->IsNsightTegra(); + this->Android = gg->TargetsAndroid(); for (int i = 0; i < 4; ++i) { this->NsightTegraVersion[i] = 0; } sscanf(gg->GetNsightTegraVersion().c_str(), "%u.%u.%u.%u", &this->NsightTegraVersion[0], &this->NsightTegraVersion[1], &this->NsightTegraVersion[2], &this->NsightTegraVersion[3]); - this->MSTools = !this->NsightTegra; + this->MSTools = !this->NsightTegra && !this->Android; this->Managed = false; this->TargetCompileAsWinRT = false; this->IsMissingFiles = false; @@ -333,6 +334,13 @@ void cmVisualStudio10TargetGenerator::Generate() this->ProjectType = csproj; this->Managed = true; } + + if (this->Android && + this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE && + !this->GeneratorTarget->Target->IsAndroidGuiExecutable()) { + this->GlobalGenerator->AddAndroidExecutableWarning(this->Name); + } + // Tell the global generator the name of the project file this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME", this->Name); @@ -427,7 +435,7 @@ void cmVisualStudio10TargetGenerator::Generate() e1.Attribute("Label", "Globals"); e1.Element("ProjectGuid", "{" + this->GUID + "}"); - if (this->MSTools && + if ((this->MSTools || this->Android) && this->GeneratorTarget->GetType() <= cmStateEnums::GLOBAL_TARGET) { this->WriteApplicationTypeSettings(e1); this->VerifyNecessaryFiles(); @@ -469,7 +477,11 @@ void cmVisualStudio10TargetGenerator::Generate() cmProp vsGlobalKeyword = this->GeneratorTarget->GetProperty("VS_GLOBAL_KEYWORD"); if (!vsGlobalKeyword) { - e1.Element("Keyword", "Win32Proj"); + if (this->GlobalGenerator->TargetsAndroid()) { + e1.Element("Keyword", "Android"); + } else { + e1.Element("Keyword", "Win32Proj"); + } } else { e1.Element("Keyword", *vsGlobalKeyword); } @@ -1134,9 +1146,11 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0) break; case cmStateEnums::EXECUTABLE: if (this->NsightTegra && - !this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) { + !this->GeneratorTarget->Target->IsAndroidGuiExecutable()) { // Android executables are .so too. configType = "DynamicLibrary"; + } else if (this->Android) { + configType = "DynamicLibrary"; } else { configType = "Application"; } @@ -1166,6 +1180,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0) } } else if (this->NsightTegra) { this->WriteNsightTegraConfigurationValues(e1, c); + } else if (this->Android) { + this->WriteAndroidConfigurationValues(e1, c); } } } @@ -1324,6 +1340,24 @@ void cmVisualStudio10TargetGenerator::WriteNsightTegraConfigurationValues( } } +void cmVisualStudio10TargetGenerator::WriteAndroidConfigurationValues( + Elem& e1, std::string const&) +{ + cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator; + if (cmProp projectToolsetOverride = + this->GeneratorTarget->GetProperty("VS_PLATFORM_TOOLSET")) { + e1.Element("PlatformToolset", *projectToolsetOverride); + } else if (const char* toolset = gg->GetPlatformToolset()) { + e1.Element("PlatformToolset", toolset); + } + if (cmProp stlType = + this->GeneratorTarget->GetProperty("ANDROID_STL_TYPE")) { + if (*stlType != "none") { + e1.Element("UseOfStl", *stlType); + } + } +} + void cmVisualStudio10TargetGenerator::WriteCustomCommands(Elem& e0) { this->CSharpCustomCommandNames.clear(); @@ -2909,7 +2943,9 @@ void cmVisualStudio10TargetGenerator::WriteClOptions( } } - if (this->MSTools) { + if (this->Android) { + e2.Element("ObjectFileName", "$(IntDir)%(filename).o"); + } else if (this->MSTools) { cmsys::RegularExpression clangToolset("v[0-9]+_clang_.*"); const char* toolset = this->GlobalGenerator->GetPlatformToolset(); if (toolset && clangToolset.find(toolset)) { @@ -4015,8 +4051,7 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups(Elem& e0) // output manifest flags <Manifest></Manifest> this->WriteManifestOptions(e1, c); if (this->NsightTegra && - this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE && - this->GeneratorTarget->GetPropertyAsBool("ANDROID_GUI")) { + this->GeneratorTarget->Target->IsAndroidGuiExecutable()) { this->WriteAntBuildOptions(e1, c); } } @@ -4131,8 +4166,9 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0) } // Don't reference targets that don't produce any output. - if (dt->GetManagedType(this->Configurations[0]) == - cmGeneratorTarget::ManagedType::Undefined) { + if (this->Configurations.empty() || + dt->GetManagedType(this->Configurations[0]) == + cmGeneratorTarget::ManagedType::Undefined) { e2.Element("ReferenceOutputAssembly", "false"); e2.Element("CopyToOutputDirectory", "Never"); } @@ -4348,6 +4384,7 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings(Elem& e1) bool isAppContainer = false; bool const isWindowsPhone = this->GlobalGenerator->TargetsWindowsPhone(); bool const isWindowsStore = this->GlobalGenerator->TargetsWindowsStore(); + bool const isAndroid = this->GlobalGenerator->TargetsAndroid(); std::string const& rev = this->GlobalGenerator->GetApplicationTypeRevision(); if (isWindowsPhone || isWindowsStore) { e1.Element("ApplicationType", @@ -4385,13 +4422,19 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings(Elem& e1) this->Name + "_$(Configuration)_$(Platform).xap"); } } + } else if (isAndroid) { + e1.Element("ApplicationType", "Android"); + e1.Element("ApplicationTypeRevision", + gg->GetAndroidApplicationTypeRevision()); } if (isAppContainer) { e1.Element("AppContainerApplication", "true"); - } else if (this->Platform == "ARM64") { - e1.Element("WindowsSDKDesktopARM64Support", "true"); - } else if (this->Platform == "ARM") { - e1.Element("WindowsSDKDesktopARMSupport", "true"); + } else if (!isAndroid) { + if (this->Platform == "ARM64") { + e1.Element("WindowsSDKDesktopARM64Support", "true"); + } else if (this->Platform == "ARM") { + e1.Element("WindowsSDKDesktopARMSupport", "true"); + } } std::string const& targetPlatformVersion = gg->GetWindowsTargetPlatformVersion(); diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 7c71de3..c54057a 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -70,6 +70,7 @@ private: void WriteExtraSource(Elem& e1, cmSourceFile const* sf); void WriteNsightTegraConfigurationValues(Elem& e1, std::string const& config); + void WriteAndroidConfigurationValues(Elem& e1, std::string const& config); void WriteSource(Elem& e2, cmSourceFile const* sf); void WriteExcludeFromBuild(Elem& e2, std::vector<size_t> const& exclude_configs); @@ -215,6 +216,7 @@ private: bool MSTools; bool Managed; bool NsightTegra; + bool Android; unsigned int NsightTegraVersion[4]; bool TargetCompileAsWinRT; std::set<std::string> IPOEnabledConfigurations; diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 162e807..27ecb4d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -64,10 +64,6 @@ # include "cmVariableWatch.h" #endif -#if !defined(CMAKE_BOOTSTRAP) -# define CMAKE_USE_ECLIPSE -#endif - #if defined(__MINGW32__) && defined(CMAKE_BOOTSTRAP) # define CMAKE_BOOT_MINGW #endif @@ -101,16 +97,13 @@ #if !defined(CMAKE_BOOTSTRAP) # include "cmGlobalNinjaGenerator.h" #endif -#include "cmExtraCodeLiteGenerator.h" -#if !defined(CMAKE_BOOT_MINGW) +#if !defined(CMAKE_BOOTSTRAP) # include "cmExtraCodeBlocksGenerator.h" -#endif -#include "cmExtraKateGenerator.h" -#include "cmExtraSublimeTextGenerator.h" - -#ifdef CMAKE_USE_ECLIPSE +# include "cmExtraCodeLiteGenerator.h" # include "cmExtraEclipseCDT4Generator.h" +# include "cmExtraKateGenerator.h" +# include "cmExtraSublimeTextGenerator.h" #endif #if defined(__linux__) || defined(_WIN32) @@ -201,7 +194,7 @@ cmake::cmake(Role role, cmState::Mode mode) }; // The "c" extension MUST precede the "C" extension. - setupExts(this->SourceFileExtensions, + setupExts(this->CLikeSourceFileExtensions, { "c", "C", "c++", "cc", "cpp", "cxx", "cu", "m", "M", "mm" }); setupExts(this->HeaderFileExtensions, { "h", "hh", "h++", "hm", "hpp", "hxx", "in", "txx" }); @@ -1137,13 +1130,9 @@ void cmake::AddDefaultExtraGenerators() #if !defined(CMAKE_BOOTSTRAP) this->ExtraGenerators.push_back(cmExtraCodeBlocksGenerator::GetFactory()); this->ExtraGenerators.push_back(cmExtraCodeLiteGenerator::GetFactory()); - this->ExtraGenerators.push_back(cmExtraSublimeTextGenerator::GetFactory()); - this->ExtraGenerators.push_back(cmExtraKateGenerator::GetFactory()); - -# ifdef CMAKE_USE_ECLIPSE this->ExtraGenerators.push_back(cmExtraEclipseCDT4Generator::GetFactory()); -# endif - + this->ExtraGenerators.push_back(cmExtraKateGenerator::GetFactory()); + this->ExtraGenerators.push_back(cmExtraSublimeTextGenerator::GetFactory()); #endif } @@ -1970,6 +1959,17 @@ void cmake::AddGlobCacheEntry(bool recurse, bool listDirectories, backtrace); } +std::vector<std::string> cmake::GetAllExtensions() const +{ + std::vector<std::string> allExt = this->CLikeSourceFileExtensions.ordered; + allExt.insert(allExt.end(), this->HeaderFileExtensions.ordered.begin(), + this->HeaderFileExtensions.ordered.end()); + // cuda extensions are also in SourceFileExtensions so we ignore it here + allExt.insert(allExt.end(), this->FortranFileExtensions.ordered.begin(), + this->FortranFileExtensions.ordered.end()); + return allExt; +} + std::string cmake::StripExtension(const std::string& file) const { auto dotpos = file.rfind('.'); @@ -1979,7 +1979,7 @@ std::string cmake::StripExtension(const std::string& file) const #else auto ext = cm::string_view(file).substr(dotpos + 1); #endif - if (this->IsSourceExtension(ext) || this->IsHeaderExtension(ext)) { + if (this->IsAKnownExtension(ext)) { return file.substr(0, dotpos); } } diff --git a/Source/cmake.h b/Source/cmake.h index 086ec87..c5d608f 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -264,44 +264,33 @@ public: this->GeneratorToolsetSet = true; } - const std::vector<std::string>& GetSourceExtensions() const + bool IsAKnownSourceExtension(cm::string_view ext) const { - return this->SourceFileExtensions.ordered; + return this->CLikeSourceFileExtensions.Test(ext) || + this->CudaFileExtensions.Test(ext) || + this->FortranFileExtensions.Test(ext); } - bool IsSourceExtension(cm::string_view ext) const + bool IsACLikeSourceExtension(cm::string_view ext) const { - return this->SourceFileExtensions.Test(ext); + return this->CLikeSourceFileExtensions.Test(ext); } - const std::vector<std::string>& GetHeaderExtensions() const - { - return this->HeaderFileExtensions.ordered; - } - - bool IsHeaderExtension(cm::string_view ext) const - { - return this->HeaderFileExtensions.Test(ext); - } - - const std::vector<std::string>& GetCudaExtensions() const + bool IsAKnownExtension(cm::string_view ext) const { - return this->CudaFileExtensions.ordered; + return this->IsAKnownSourceExtension(ext) || this->IsAHeaderExtension(ext); } - bool IsCudaExtension(cm::string_view ext) const - { - return this->CudaFileExtensions.Test(ext); - } + std::vector<std::string> GetAllExtensions() const; - const std::vector<std::string>& GetFortranExtensions() const + const std::vector<std::string>& GetHeaderExtensions() const { - return this->FortranFileExtensions.ordered; + return this->HeaderFileExtensions.ordered; } - bool IsFortranExtension(cm::string_view ext) const + bool IsAHeaderExtension(cm::string_view ext) const { - return this->FortranFileExtensions.Test(ext); + return this->HeaderFileExtensions.Test(ext); } // Strips the extension (if present and known) from a filename @@ -628,7 +617,7 @@ private: std::string CheckStampList; std::string VSSolutionFile; std::string EnvironmentGenerator; - FileExtensions SourceFileExtensions; + FileExtensions CLikeSourceFileExtensions; FileExtensions HeaderFileExtensions; FileExtensions CudaFileExtensions; FileExtensions FortranFileExtensions; diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index 75280fb..9fa6705 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -3,11 +3,13 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <algorithm> #include <cassert> #include <cctype> #include <climits> #include <cstring> #include <iostream> +#include <sstream> #include <string> #include <vector> @@ -517,6 +519,121 @@ int do_build(int ac, char const* const* av) #endif } +bool parse_default_directory_permissions(const std::string& permissions, + std::string& parsedPermissionsVar) +{ + std::vector<std::string> parsedPermissions; + enum Doing + { + DoingNone, + DoingOwner, + DoingGroup, + DoingWorld, + DoingOwnerAssignment, + DoingGroupAssignment, + DoingWorldAssignment, + }; + Doing doing = DoingNone; + + auto uniquePushBack = [&parsedPermissions](const std::string& e) { + if (std::find(parsedPermissions.begin(), parsedPermissions.end(), e) == + parsedPermissions.end()) { + parsedPermissions.push_back(e); + } + }; + + for (auto const& e : permissions) { + switch (doing) { + case DoingNone: + if (e == 'u') { + doing = DoingOwner; + } else if (e == 'g') { + doing = DoingGroup; + } else if (e == 'o') { + doing = DoingWorld; + } else { + return false; + } + break; + case DoingOwner: + if (e == '=') { + doing = DoingOwnerAssignment; + } else { + return false; + } + break; + case DoingGroup: + if (e == '=') { + doing = DoingGroupAssignment; + } else { + return false; + } + break; + case DoingWorld: + if (e == '=') { + doing = DoingWorldAssignment; + } else { + return false; + } + break; + case DoingOwnerAssignment: + if (e == 'r') { + uniquePushBack("OWNER_READ"); + } else if (e == 'w') { + uniquePushBack("OWNER_WRITE"); + } else if (e == 'x') { + uniquePushBack("OWNER_EXECUTE"); + } else if (e == ',') { + doing = DoingNone; + } else { + return false; + } + break; + case DoingGroupAssignment: + if (e == 'r') { + uniquePushBack("GROUP_READ"); + } else if (e == 'w') { + uniquePushBack("GROUP_WRITE"); + } else if (e == 'x') { + uniquePushBack("GROUP_EXECUTE"); + } else if (e == ',') { + doing = DoingNone; + } else { + return false; + } + break; + case DoingWorldAssignment: + if (e == 'r') { + uniquePushBack("WORLD_READ"); + } else if (e == 'w') { + uniquePushBack("WORLD_WRITE"); + } else if (e == 'x') { + uniquePushBack("WORLD_EXECUTE"); + } else if (e == ',') { + doing = DoingNone; + } else { + return false; + } + break; + } + } + if (doing != DoingOwnerAssignment && doing != DoingGroupAssignment && + doing != DoingWorldAssignment) { + return false; + } + + std::ostringstream oss; + for (auto i = 0u; i < parsedPermissions.size(); i++) { + if (i != 0) { + oss << ";"; + } + oss << parsedPermissions[i]; + } + + parsedPermissionsVar = oss.str(); + return true; +} + int do_install(int ac, char const* const* av) { #ifdef CMAKE_BOOTSTRAP @@ -527,6 +644,7 @@ int do_install(int ac, char const* const* av) std::string config; std::string component; + std::string defaultDirectoryPermissions; std::string prefix; std::string dir; bool strip = false; @@ -539,6 +657,7 @@ int do_install(int ac, char const* const* av) DoingConfig, DoingComponent, DoingPrefix, + DoingDefaultDirectoryPermissions, }; Doing doing = DoingDir; @@ -557,6 +676,8 @@ int do_install(int ac, char const* const* av) (strcmp(av[i], "-v") == 0)) { verbose = true; doing = DoingNone; + } else if (strcmp(av[i], "--default-directory-permissions") == 0) { + doing = DoingDefaultDirectoryPermissions; } else { switch (doing) { case DoingDir: @@ -575,6 +696,10 @@ int do_install(int ac, char const* const* av) prefix = av[i]; doing = DoingNone; break; + case DoingDefaultDirectoryPermissions: + defaultDirectoryPermissions = av[i]; + doing = DoingNone; + break; default: std::cerr << "Unknown argument " << av[i] << std::endl; dir.clear(); @@ -591,6 +716,8 @@ int do_install(int ac, char const* const* av) " <dir> = Project binary directory to install.\n" " --config <cfg> = For multi-configuration tools, choose <cfg>.\n" " --component <comp> = Component-based install. Only install <comp>.\n" + " --default-directory-permissions <permission> \n" + " Default install permission. Use default permission <permission>.\n" " --prefix <prefix> = The installation prefix CMAKE_INSTALL_PREFIX.\n" " --strip = Performing install/strip.\n" " -v --verbose = Enable verbose output.\n" @@ -631,6 +758,18 @@ int do_install(int ac, char const* const* av) args.emplace_back("-DCMAKE_INSTALL_CONFIG_NAME=" + config); } + if (!defaultDirectoryPermissions.empty()) { + std::string parsedPermissionsVar; + if (!parse_default_directory_permissions(defaultDirectoryPermissions, + parsedPermissionsVar)) { + std::cerr << "--default-directory-permissions is in incorrect format" + << std::endl; + return 1; + } + args.emplace_back("-DCMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS=" + + parsedPermissionsVar); + } + args.emplace_back("-P"); args.emplace_back(dir + "/cmake_install.cmake"); diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index de76d73..6882fdd 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -582,12 +582,10 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args) filesDiffer = cmsys::SystemTools::TextFilesDiffer(args[3], args[4]); } else { ::CMakeCommandUsage(args[0].c_str()); - return 1; + return 2; } if (filesDiffer) { - std::cerr << "Files \"" << args[args.size() - 2] << "\" to \"" - << args[args.size() - 1] << "\" are different.\n"; return 1; } return 0; diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index db6dbf3..067ffdb 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -206,6 +206,26 @@ if(BUILD_TESTING) set(${reg} 0) endif() endforeach() + if(COMMAND cmake_host_system_information) + set(info_vs15 "VS_15_DIR") + set(info_vs16 "VS_16_DIR") + set(vs_versions) + if(WIN32) + if(NOT CMAKE_VERSION VERSION_LESS 3.14) + set(vs_versions vs15 vs16) + elseif(NOT CMAKE_VERSION VERSION_LESS 3.8) + set(vs_versions vs15) + endif() + endif() + foreach(info ${vs_versions}) + cmake_host_system_information(RESULT found QUERY "${info_${info}}") + if(found) + set(${info} 1) + else() + set(${info} 0) + endif() + endforeach() + endif() endif() #--------------------------------------------------------------------------- @@ -697,38 +717,28 @@ if(BUILD_TESTING) # build the "Simple" test with the ExtraGenerators, if available # This doesn't test whether the generated project files work (unfortunately), # mainly it tests that cmake doesn't crash when generating these project files. - if(${CMAKE_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_GENERATOR} MATCHES "Ninja") - - # check which generators we have - execute_process(COMMAND ${CMAKE_CMAKE_COMMAND} --help - OUTPUT_VARIABLE cmakeOutput ERROR_VARIABLE cmakeOutput) - - set(extraGenerators - "CodeBlocks" - "CodeLite" - "Eclipse CDT4" - "Kate" - "Sublime Text 2") - - foreach(extraGenerator ${extraGenerators}) - if ("${cmakeOutput}" MATCHES "${extraGenerator} - ${CMAKE_GENERATOR}") - set(extraGeneratorTestName "Simple_${extraGenerator}Generator") - string(REPLACE " " "" extraGeneratorTestName ${extraGeneratorTestName}) - - add_test(${extraGeneratorTestName} ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/Simple" - "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}" - --build-two-config - --build-generator "${extraGenerator} - ${CMAKE_GENERATOR}" - --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" - --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" - --build-project Simple - --test-command Simple) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}") - endif () - endforeach(extraGenerator) - + if(CMAKE_GENERATOR MATCHES "^(Unix Makefiles|Ninja)$" + AND NOT "${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + foreach(extraGenerator + "CodeBlocks" + "CodeLite" + "Eclipse CDT4" + "Kate" + "Sublime Text 2" + ) + string(REPLACE " " "" extraGeneratorTestName "Simple_${extraGenerator}Generator") + add_test(${extraGeneratorTestName} ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/Simple" + "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}" + --build-two-config + --build-generator "${extraGenerator} - ${CMAKE_GENERATOR}" + --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}" + --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}" + --build-project Simple + --test-command Simple) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}") + endforeach() endif() # test for correct sub-project generation @@ -1451,6 +1461,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH Patch PostgreSQL Protobuf + SDL SQLite3 TIFF Vulkan @@ -2315,32 +2326,41 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH endforeach() endif() + macro(add_test_VSAndroid name generator platform) + add_test(NAME "VSAndroid.${name}.${platform}" COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VSAndroid" + "${CMake_BINARY_DIR}/Tests/VSAndroid/${name}/${platform}" + --build-generator "${generator}" + --build-project VSAndroid + --build-config $<CONFIGURATION> + --build-options -DCMAKE_SYSTEM_NAME=Android "-A${platform}" + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSAndroid/${name}") + endmacro() if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ") - macro(add_test_VSNsightTegra name generator) - add_test(NAME VSNsightTegra.${name} COMMAND ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/VSNsightTegra" - "${CMake_BINARY_DIR}/Tests/VSNsightTegra/${name}" - --build-generator "${generator}" - --build-project VSNsightTegra - --build-config $<CONFIGURATION> - --build-options -DCMAKE_SYSTEM_NAME=Android - ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSNsightTegra/${name}") - endmacro() if(vs10) - add_test_VSNsightTegra(vs10 "Visual Studio 10 2010") + add_test_VSAndroid(vs10 "Visual Studio 10 2010" "Tegra-Android") endif() if(vs11) - add_test_VSNsightTegra(vs11 "Visual Studio 11 2012") + add_test_VSAndroid(vs11 "Visual Studio 11 2012" "Tegra-Android") endif() if(vs12) - add_test_VSNsightTegra(vs12 "Visual Studio 12 2013") + add_test_VSAndroid(vs12 "Visual Studio 12 2013" "Tegra-Android") endif() if(vs14) - add_test_VSNsightTegra(vs14 "Visual Studio 14 2015") + add_test_VSAndroid(vs14 "Visual Studio 14 2015" "Tegra-Android") endif() endif() + if(vs14 AND CMake_TEST_ANDROID_VS14) + add_test_VSAndroid(vs14 "Visual Studio 14 2015" "ARM") + endif() + if(vs15 AND CMake_TEST_ANDROID_VS15) + add_test_VSAndroid(vs15 "Visual Studio 15 2017" "ARM") + endif() + if(vs16 AND CMake_TEST_ANDROID_VS16) + add_test_VSAndroid(vs16 "Visual Studio 16 2019" "ARM") + endif() if (APPLE) if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") diff --git a/Tests/COnly/CMakeLists.txt b/Tests/COnly/CMakeLists.txt index 20615fe..1c24017 100644 --- a/Tests/COnly/CMakeLists.txt +++ b/Tests/COnly/CMakeLists.txt @@ -1,5 +1,5 @@ # a simple C only test case -cmake_minimum_required (VERSION 2.6) +cmake_minimum_required(VERSION 2.8.12) project (COnly C) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") diff --git a/Tests/CSharpOnly/CMakeLists.txt b/Tests/CSharpOnly/CMakeLists.txt index 42cbe2e..195af05 100644 --- a/Tests/CSharpOnly/CMakeLists.txt +++ b/Tests/CSharpOnly/CMakeLists.txt @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.3) # a simple CSharp only test case project (CSharpOnly CSharp) diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt index 8207dd1..09689cb 100644 --- a/Tests/CxxOnly/CMakeLists.txt +++ b/Tests/CxxOnly/CMakeLists.txt @@ -1,4 +1,5 @@ # a simple CXX only test case +cmake_minimum_required(VERSION 2.8.12) project (CxxOnly CXX) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") diff --git a/Tests/FindSDL/CMakeLists.txt b/Tests/FindSDL/CMakeLists.txt new file mode 100644 index 0000000..e786204 --- /dev/null +++ b/Tests/FindSDL/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindSDL.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindSDL/Test" + "${CMake_BINARY_DIR}/Tests/FindSDL/Test" + ${build_generator_args} + --build-project TestFindSDL + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindSDL/Test/CMakeLists.txt b/Tests/FindSDL/Test/CMakeLists.txt new file mode 100644 index 0000000..61d4f4b --- /dev/null +++ b/Tests/FindSDL/Test/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.1) +project(TestFindSDL C) +include(CTest) + +find_package(SDL) + +add_definitions( + -DCMAKE_EXPECTED_SDL_VERSION_MAJOR=${SDL_VERSION_MAJOR} + -DCMAKE_EXPECTED_SDL_VERSION_MINOR=${SDL_VERSION_MINOR} + -DCMAKE_EXPECTED_SDL_VERSION_PATCH=${SDL_VERSION_PATCH}) + +add_executable(test_sdl_tgt main.c) +target_link_libraries(test_sdl_tgt SDL::SDL) +add_test(NAME test_sdl_tgt COMMAND test_sdl_tgt) + +add_executable(test_sdl_var main.c) +target_include_directories(test_sdl_var PRIVATE ${SDL_INCLUDE_DIRS}) +target_link_libraries(test_sdl_var PRIVATE ${SDL_LIBRARIES}) +add_test(NAME test_sdl_var COMMAND test_sdl_var) diff --git a/Tests/FindSDL/Test/main.c b/Tests/FindSDL/Test/main.c new file mode 100644 index 0000000..057289c --- /dev/null +++ b/Tests/FindSDL/Test/main.c @@ -0,0 +1,18 @@ +#include <SDL.h> + +int main() +{ + // Test 1 requires headers only. + SDL_version compiled; + SDL_VERSION(&compiled); + if (compiled.major != CMAKE_EXPECTED_SDL_VERSION_MAJOR || + compiled.minor != CMAKE_EXPECTED_SDL_VERSION_MINOR || + compiled.patch != CMAKE_EXPECTED_SDL_VERSION_PATCH) + return 1; + + // Test 2 requires to link to the library. + if (SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0) + return 2; + + return 0; +} diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index d24df2d..637f581 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required(VERSION 2.8.12) project(FortranOnly Fortran) message("CTEST_FULL_OUTPUT ") diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index 9d51342..ebbe288 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -40,9 +40,9 @@ add_custom_target(check-part1 ALL -Dtest_and_0_invalidcontent=$<AND:0,invalidcontent> -Dtest_config_0=$<CONFIG:$<CONFIGURATION>x> -Dtest_config_1=$<CONFIG:$<CONFIGURATION>> - -Dtest_config_debug=$<CONFIG:Debug>$<CONFIG:DEBUG>$<CONFIG:DeBuG> - -Dtest_config_release=$<CONFIG:Release>$<CONFIG:RELEASE>$<CONFIG:ReLeAsE> - -Dtest_config_relwithdebinfo=$<CONFIG:RelWithDebInfo>$<CONFIG:RELWITHDEBINFO>$<CONFIG:relwithdebinfo> + -Dtest_config_debug=$<CONFIG:Debug,DEBUG,DeBuG> + -Dtest_config_release=$<CONFIG:Release>$<CONFIG:RELEASE,ReLeAsE> + -Dtest_config_relwithdebinfo=$<CONFIG:RelWithDebInfo,RELWITHDEBINFO>$<CONFIG:relwithdebinfo> -Dtest_config_minsizerel=$<CONFIG:MinSizeRel>$<CONFIG:MINSIZEREL>$<CONFIG:minsizerel> -Dtest_not_0=$<NOT:0> -Dtest_not_1=$<NOT:1> @@ -180,9 +180,7 @@ set_property(TARGET imported3 PROPERTY IMPORTED_LOCATION_DEBUG debug_loc) set_property(TARGET imported3 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:DEBUG>:$<TARGET_PROPERTY:imported1,INTERFACE_INCLUDE_DIRECTORIES>>) set_property(TARGET imported3 APPEND PROPERTY - INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:RELEASE>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>) -set_property(TARGET imported3 APPEND PROPERTY - INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:RELWITHDEBINFO>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>) + INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:RELEASE,RELWITHDEBINFO>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>) set_property(TARGET imported3 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<$<CONFIG:MINSIZEREL>:$<TARGET_PROPERTY:imported2,INTERFACE_INCLUDE_DIRECTORIES>>) diff --git a/Tests/GeneratorExpression/check-part3.cmake b/Tests/GeneratorExpression/check-part3.cmake index 4fb7308..b5eafa6 100644 --- a/Tests/GeneratorExpression/check-part3.cmake +++ b/Tests/GeneratorExpression/check-part3.cmake @@ -13,7 +13,7 @@ if(config AND NOT config STREQUAL NoConfig) message(SEND_ERROR "test_imported_includes is not correct: ${test_imported_includes}") endif() else() - if(NOT "${test_imported_includes}" MATCHES "^;;;$") + if(NOT "${test_imported_includes}" MATCHES "^;;$") message(SEND_ERROR "test_imported_includes is not an empty list: ${test_imported_includes}") endif() endif() diff --git a/Tests/RunCMake/Android/RunCMakeTest.cmake b/Tests/RunCMake/Android/RunCMakeTest.cmake index 45798ce..81dd090 100644 --- a/Tests/RunCMake/Android/RunCMakeTest.cmake +++ b/Tests/RunCMake/Android/RunCMakeTest.cmake @@ -18,15 +18,33 @@ function(run_Android case) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") run_cmake(${case}) - run_cmake_command(${case}-build ${CMAKE_COMMAND} --build .) + set(configs ".") + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(configs Release Debug) + endif() + foreach(config IN LISTS configs) + set(build_suffix) + set(config_arg) + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(build_suffix "-${config}") + set(config_arg --config "${config}") + endif() + run_cmake_command(${case}-build${build_suffix} ${CMAKE_COMMAND} --build . ${config_arg}) + endforeach() endfunction() +set(RunCMake_GENERATOR_PLATFORM_OLD "${RunCMake_GENERATOR_PLATFORM}") + +if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(RunCMake_GENERATOR_PLATFORM "ARM") +endif() set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSROOT=${CMAKE_CURRENT_SOURCE_DIR} ) run_cmake(BadSYSROOT) unset(RunCMake_TEST_OPTIONS) +set(RunCMake_GENERATOR_PLATFORM "${RunCMake_GENERATOR_PLATFORM_OLD}") foreach(ndk IN LISTS TEST_ANDROID_NDK) # Load available toolchain versions and abis. @@ -70,6 +88,9 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) if(_versions MATCHES "clang") set(_versions "clang" ${_versions}) endif() + if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(_versions "clang") + endif() list(REMOVE_DUPLICATES _versions) list(SORT _versions) set(_versions ";${_versions}") @@ -77,44 +98,58 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) list(REMOVE_DUPLICATES _abis_${vers}) endforeach() + set(ndk_arg -DCMAKE_ANDROID_NDK=${ndk}) + if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(ndk_arg) + endif() + # Test failure cases. message(STATUS "ndk='${ndk}'") + if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(RunCMake_GENERATOR_PLATFORM "ARM") + endif() set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_ARCH_ABI=badabi ) run_cmake(ndk-badabi) + if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(RunCMake_GENERATOR_PLATFORM "x86") + endif() set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_ANDROID_ARM_MODE=0 ) run_cmake(ndk-badarm) + if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(RunCMake_GENERATOR_PLATFORM "ARM") + endif() if("armeabi" IN_LIST _abis_) set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_ARM_NEON=0 ) run_cmake(ndk-badneon) endif() set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=badver ) run_cmake(ndk-badver) set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=1.0 ) run_cmake(ndk-badvernum) set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=Android - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_STL_TYPE=badstl ) run_cmake(ndk-badstl) @@ -131,6 +166,7 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) run_cmake(ndk-sysroot-armeabi) unset(RunCMake_TEST_OPTIONS) endif() + set(RunCMake_GENERATOR_PLATFORM "${RunCMake_GENERATOR_PLATFORM_OLD}") # Find available STLs. set(stl_types @@ -157,23 +193,41 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) armeabi-v6 armeabi-v7a arm64-v8a - mips - mips64 x86 x86_64 ) + if(NOT RunCMake_GENERATOR MATCHES "Visual Studio") + list(APPEND abi_names mips mips64) + endif() + set(abi_to_arch_armeabi ARM) + set(abi_to_arch_armeabi-v6 ARM) + set(abi_to_arch_armeabi-v7a ARM) + set(abi_to_arch_arm64-v8a ARM64) + set(abi_to_arch_x86 x86) + set(abi_to_arch_x86_64 x64) # Test all combinations. foreach(vers IN LISTS _versions) foreach(stl IN LISTS stl_types) - foreach(config Release Debug) + set(configs Release Debug) + set(foreach_list "${configs}") + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(foreach_list ".") + endif() + foreach(config IN LISTS foreach_list) # Test this combination for all available abis. - message(STATUS "ndk='${ndk}' vers='${vers}' stl='${stl}' config='${config}'") + set(config_status " config='${config}'") + set(build_type_arg "-DCMAKE_BUILD_TYPE=${config}") + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(config_status) + string(REPLACE ";" "\\\\;" build_type_arg "-DCMAKE_CONFIGURATION_TYPES=${configs}") + endif() + message(STATUS "ndk='${ndk}' vers='${vers}' stl='${stl}'${config_status}") set(RunCMake_TEST_OPTIONS - -DCMAKE_ANDROID_NDK=${ndk} + ${ndk_arg} -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=${vers} -DCMAKE_ANDROID_STL_TYPE=${stl} - -DCMAKE_BUILD_TYPE=${config} + "${build_type_arg}" ) foreach(abi IN LISTS abi_names) # Skip ABIs not supported by this compiler. @@ -182,6 +236,9 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) endif() # Run the tests for this combination. + if(RunCMake_GENERATOR MATCHES "Visual Studio") + set(RunCMake_GENERATOR_PLATFORM "${abi_to_arch_${abi}}") + endif() if("${abi}" STREQUAL "armeabi") run_Android(ndk-armeabi-thumb) # default: -DCMAKE_ANDROID_ARCH_ABI=armeabi -DCMAKE_ANDROID_ARM_MODE=0 run_Android(ndk-armeabi-arm -DCMAKE_ANDROID_ARM_MODE=1) # default: -DCMAKE_ANDROID_ARCH_ABI=armeabi @@ -191,6 +248,7 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) run_Android(ndk-${abi}-neon -DCMAKE_ANDROID_ARCH_ABI=${abi} -DCMAKE_ANDROID_ARM_NEON=1) endif() endif() + set(RunCMake_GENERATOR_PLATFORM "${RunCMake_GENERATOR_PLATFORM_OLD}") endforeach() unset(RunCMake_TEST_OPTIONS) endforeach() diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake index d96ab86..32412aa 100644 --- a/Tests/RunCMake/Android/common.cmake +++ b/Tests/RunCMake/Android/common.cmake @@ -96,7 +96,7 @@ add_executable(android_c android.c) add_executable(android_cxx android.cxx) add_library(android_cxx_lib SHARED android_lib.cxx) -set(objdump "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}objdump") +set(objdump "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}objdump${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}") if(NOT EXISTS "${objdump}") message(FATAL_ERROR "Expected tool missing:\n ${objdump}") endif() diff --git a/Tests/RunCMake/Android/ndk-arm64-v8a-stderr.txt b/Tests/RunCMake/Android/ndk-arm64-v8a-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-arm64-v8a-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/Android/ndk-armeabi-arm-stderr.txt b/Tests/RunCMake/Android/ndk-armeabi-arm-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-armeabi-arm-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/Android/ndk-armeabi-thumb-stderr.txt b/Tests/RunCMake/Android/ndk-armeabi-thumb-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-armeabi-thumb-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stderr.txt b/Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/Android/ndk-armeabi-v7a-stderr.txt b/Tests/RunCMake/Android/ndk-armeabi-v7a-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-armeabi-v7a-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/Android/ndk-x86-stderr.txt b/Tests/RunCMake/Android/ndk-x86-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-x86-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/Android/ndk-x86_64-stderr.txt b/Tests/RunCMake/Android/ndk-x86_64-stderr.txt new file mode 100644 index 0000000..a3b3634 --- /dev/null +++ b/Tests/RunCMake/Android/ndk-x86_64-stderr.txt @@ -0,0 +1,7 @@ +^(CMake Warning: + You are using Visual Studio tools for Android, which does not support + standalone executables\. However, the following executable targets do not + have the ANDROID_GUI property set, and thus will not be built as expected\. + They will be built as shared libraries with executable filenames: + + android_c, android_cxx, android_sysinc_c, android_sysinc_cxx)?$ diff --git a/Tests/RunCMake/CMP0019/CMP0019-NEW-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-NEW-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0019/CMP0019-NEW-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt index 048762d..a446211 100644 --- a/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt @@ -1,4 +1,11 @@ -^CMake Deprecation Warning at CMP0019-OLD.cmake:[0-9]+ \(cmake_policy\): +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. ++ +CMake Deprecation Warning at CMP0019-OLD.cmake:[0-9]+ \(cmake_policy\): The OLD behavior for policy CMP0019 will be removed from a future version of CMake. diff --git a/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt index 1e4b47d..f7b9c0e 100644 --- a/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0019/CMP0019-WARN-stderr.txt @@ -1,3 +1,10 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. ++ CMake Warning \(dev\) in CMakeLists.txt: Policy CMP0019 is not set: Do not re-expand variables in include and link information. Run "cmake --help-policy CMP0019" for policy details. Use diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-shared-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-NEW-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-link_libraries-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt index 6a6a0c7..87404d3 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-empty-old-stderr.txt @@ -1,3 +1,10 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. ++ CMake Warning \(dev\) in CMakeLists.txt: Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link interface. Run "cmake --help-policy CMP0022" for policy details. Use the diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt index 2f7dfbf..5d75720 100644 --- a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt +++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt @@ -1,4 +1,11 @@ -^CMake Warning \(dev\) in CMakeLists.txt: +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. ++ +CMake Warning \(dev\) in CMakeLists.txt: Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link interface. Run "cmake --help-policy CMP0022" for policy details. Use the cmake_policy command to set the policy and suppress this warning. diff --git a/Tests/RunCMake/CMP0022/CMP0022-export-exe-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-export-exe-stderr.txt new file mode 100644 index 0000000..66a58fb --- /dev/null +++ b/Tests/RunCMake/CMP0022/CMP0022-export-exe-stderr.txt @@ -0,0 +1,6 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions.$ diff --git a/Tests/RunCMake/CMP0026/CMakeLists.txt b/Tests/RunCMake/CMP0026/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/CMP0026/CMakeLists.txt +++ b/Tests/RunCMake/CMP0026/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0027/CMakeLists.txt b/Tests/RunCMake/CMP0027/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/CMP0027/CMakeLists.txt +++ b/Tests/RunCMake/CMP0027/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0028/CMakeLists.txt b/Tests/RunCMake/CMP0028/CMakeLists.txt index 144cdb4..4f867df 100644 --- a/Tests/RunCMake/CMP0028/CMakeLists.txt +++ b/Tests/RunCMake/CMP0028/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) # policy used at end of dir diff --git a/Tests/RunCMake/CMP0037/CMakeLists.txt b/Tests/RunCMake/CMP0037/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/CMP0037/CMakeLists.txt +++ b/Tests/RunCMake/CMP0037/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0041/CMakeLists.txt b/Tests/RunCMake/CMP0041/CMakeLists.txt index f452db1..a06591c 100644 --- a/Tests/RunCMake/CMP0041/CMakeLists.txt +++ b/Tests/RunCMake/CMP0041/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0042/CMakeLists.txt b/Tests/RunCMake/CMP0042/CMakeLists.txt index f452db1..a06591c 100644 --- a/Tests/RunCMake/CMP0042/CMakeLists.txt +++ b/Tests/RunCMake/CMP0042/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0043/CMakeLists.txt b/Tests/RunCMake/CMP0043/CMakeLists.txt index d027f3e..cc8a6f8 100644 --- a/Tests/RunCMake/CMP0043/CMakeLists.txt +++ b/Tests/RunCMake/CMP0043/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) # policy used at end of dir diff --git a/Tests/RunCMake/CMP0045/CMakeLists.txt b/Tests/RunCMake/CMP0045/CMakeLists.txt index f452db1..a06591c 100644 --- a/Tests/RunCMake/CMP0045/CMakeLists.txt +++ b/Tests/RunCMake/CMP0045/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 6c634b5..192895b 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -683,8 +683,8 @@ add_RunCMake_test(AutoExportDll add_RunCMake_test(AndroidMK) if(CMake_TEST_ANDROID_NDK OR CMake_TEST_ANDROID_STANDALONE_TOOLCHAIN) - if(NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja") - message(FATAL_ERROR "Android tests supported only by Makefile and Ninja generators") + if(NOT "${CMAKE_GENERATOR}" MATCHES "Make|Ninja|Visual Studio 1[456]") + message(FATAL_ERROR "Android tests supported only by Makefile, Ninja, and Visual Studio >= 14 generators") endif() foreach(v TEST_ANDROID_NDK TEST_ANDROID_STANDALONE_TOOLCHAIN) if(CMake_${v}) diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake index 064b4dc..831f430 100644 --- a/Tests/RunCMake/CPack/RunCMakeTest.cmake +++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake @@ -46,3 +46,4 @@ run_cpack_test_subtests( "MONOLITHIC;COMPONENT" ) run_cpack_test(PROJECT_META "RPM.PROJECT_META;DEB.PROJECT_META" false "MONOLITHIC;COMPONENT") +run_cpack_test_package_target(PRE_POST_SCRIPTS "ZIP" false "MONOLITHIC;COMPONENT") diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake index 6f7c4c2..3db8014 100644 --- a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake @@ -29,3 +29,11 @@ expect_file(${CPACK_TEMPORARY_DIRECTORY}/f3/share/cpack-test/f3.txt) expect_file(${CPACK_TEMPORARY_DIRECTORY}/f4/share/cpack-test/f4.txt) message(STATUS "This status message is expected to be visible") + +set( + CPACK_EXTERNAL_BUILT_PACKAGES + ${CPACK_TEMPORARY_DIRECTORY}/f1/share/cpack-test/f1.txt + ${CPACK_TEMPORARY_DIRECTORY}/f2/share/cpack-test/f2.txt + ${CPACK_TEMPORARY_DIRECTORY}/f3/share/cpack-test/f3.txt + ${CPACK_TEMPORARY_DIRECTORY}/f4/share/cpack-test/f4.txt + ) diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt index 37d635f..587b2e8 100644 --- a/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/stage_and_package-stdout.txt @@ -1 +1,11 @@ -- This status message is expected to be visible +CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/external-0\.1\.1-.*\.json generated\. +CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/external-0\.1\.1-.*\.json\.sha1 generated\. +CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f1\.txt generated\. +CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f1\.txt\.sha1 generated\. +CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f2\.txt generated\. +CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f2\.txt\.sha1 generated\. +CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f3\.txt generated\. +CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f3\.txt\.sha1 generated\. +CPack: - package: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f4\.txt generated\. +CPack: - checksum file: .*/Tests/RunCMake/External/CPack/EXTERNAL-build-stage_and_package-subtest/f4\.txt\.sha1 generated\. diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake index bc9766b..d4781ba 100644 --- a/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake +++ b/Tests/RunCMake/CPack/tests/EXTERNAL/test.cmake @@ -17,6 +17,7 @@ elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "invalid_bad") elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "stage_and_package") set(CPACK_EXTERNAL_ENABLE_STAGING 1) set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/create_package.cmake") + set(CPACK_PACKAGE_CHECKSUM SHA1) endif() file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/f1.txt" test1) diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ExpectedFiles.cmake new file mode 100644 index 0000000..63a36a3 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ExpectedFiles.cmake @@ -0,0 +1,19 @@ +set(SATU "/satu;/satu/CMakeLists.txt") +set(DUA "/dua;/dua/CMakeLists.txt") + +if(GENERATOR_TYPE STREQUAL ZIP) + set(_ext "zip") +elseif(GENERATOR_TYPE STREQUAL TGZ) + set(_ext "tar.gz") +endif() + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(EXPECTED_FILES_COUNT "2") + set(EXPECTED_FILE_1 "*-satu.${_ext}") + set(EXPECTED_FILE_CONTENT_1_LIST ${SATU}) + set(EXPECTED_FILE_2 "*-dua.${_ext}") + set(EXPECTED_FILE_CONTENT_2_LIST ${DUA}) +else() + set(EXPECTED_FILES_COUNT "1") + set(EXPECTED_FILE_CONTENT_1_LIST ${SATU} ${DUA}) +endif() diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_COMPONENT-stdout.txt b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_COMPONENT-stdout.txt new file mode 100644 index 0000000..319d0da --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_COMPONENT-stdout.txt @@ -0,0 +1,4 @@ +-- The message from .*/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre\.cmake and generator ZIP +.* +-- The message from .*/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post\.cmake and generator ZIP +-- Built packages: .*/_CPack_Packages/.*/pre_post_scripts-.*-dua.zip;.*/_CPack_Packages/.*/pre_post_scripts-.*-satu.zip diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_MONOLITHIC-stdout.txt b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_MONOLITHIC-stdout.txt new file mode 100644 index 0000000..632c4d1 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/ZIP_MONOLITHIC-stdout.txt @@ -0,0 +1,4 @@ +-- The message from .*/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre\.cmake and generator ZIP +.* +-- The message from .*/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post\.cmake and generator ZIP +-- Built packages: .*/_CPack_Packages/.*/pre_post_scripts-0\.1\.1-.*\.zip diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post.cmake b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post.cmake new file mode 100644 index 0000000..cf0b149 --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/post.cmake @@ -0,0 +1,2 @@ +message(STATUS "The message from ${CMAKE_CURRENT_LIST_FILE} and generator ${CPACK_GENERATOR}") +message(STATUS "Built packages: ${CPACK_PACKAGE_FILES}") diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre.cmake b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre.cmake new file mode 100644 index 0000000..b04aa6b --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/pre.cmake @@ -0,0 +1 @@ +message(STATUS "The message from ${CMAKE_CURRENT_LIST_FILE} and generator ${CPACK_GENERATOR}") diff --git a/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/test.cmake new file mode 100644 index 0000000..f1b6d5f --- /dev/null +++ b/Tests/RunCMake/CPack/tests/PRE_POST_SCRIPTS/test.cmake @@ -0,0 +1,9 @@ +install(FILES CMakeLists.txt DESTINATION satu COMPONENT satu) +install(FILES CMakeLists.txt DESTINATION dua COMPONENT dua) + +set(CPACK_PRE_BUILD_SCRIPTS "${CMAKE_CURRENT_LIST_DIR}/pre.cmake") +set(CPACK_POST_BUILD_SCRIPTS "${CMAKE_CURRENT_LIST_DIR}/post.cmake") + +if(PACKAGING_TYPE STREQUAL "COMPONENT") + set(CPACK_COMPONENTS_ALL satu dua) +endif() diff --git a/Tests/RunCMake/CTest/CMakeLists.txt b/Tests/RunCMake/CTest/CMakeLists.txt index 73e6a78..f1a83e8 100644 --- a/Tests/RunCMake/CTest/CMakeLists.txt +++ b/Tests/RunCMake/CTest/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) if(NOT NoProject) project(${RunCMake_TEST} NONE) endif() diff --git a/Tests/RunCMake/CheckModules/CMakeLists.txt b/Tests/RunCMake/CheckModules/CMakeLists.txt index 9872df2..842c5cf 100644 --- a/Tests/RunCMake/CheckModules/CMakeLists.txt +++ b/Tests/RunCMake/CheckModules/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 2.8.12) cmake_policy(SET CMP0054 NEW) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-result.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-fail-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt b/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt index d2a2831..cf2c087 100644 --- a/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt +++ b/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt @@ -5,3 +5,4 @@ add_custom_command( add_custom_target(CustomTarget ALL DEPENDS output.txt) add_custom_target(CustomTarget2 ALL DEPENDS output.txt) add_custom_target(CustomTarget3 ALL DEPENDS output.txt) +add_custom_target(CustomTargetFail COMMAND DoesNotExist) diff --git a/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt b/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt deleted file mode 100644 index 4729ccb..0000000 --- a/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^Files ".*/compare_files/lf" to ".*/compare_files/crlf" are different.$ diff --git a/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt b/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt deleted file mode 100644 index 8a9ca81..0000000 --- a/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt +++ /dev/null @@ -1 +0,0 @@ -^Files "nonexistent_a" to "nonexistent_b" are different.$ diff --git a/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-result.txt b/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-result.txt new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-result.txt @@ -0,0 +1 @@ +2 diff --git a/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-stderr.txt b/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-stderr.txt new file mode 100644 index 0000000..8d98f9d --- /dev/null +++ b/Tests/RunCMake/CommandLine/E_compare_files-invalid-arguments-stderr.txt @@ -0,0 +1 @@ +.* diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 973391d..6d69945 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -22,6 +22,7 @@ run_cmake_command(E_compare_files-different-eol ${CMAKE_COMMAND} -E compare_file run_cmake_command(E_compare_files-ignore-eol-same ${CMAKE_COMMAND} -E compare_files --ignore-eol ${RunCMake_SOURCE_DIR}/compare_files/lf ${RunCMake_SOURCE_DIR}/compare_files/crlf) run_cmake_command(E_compare_files-ignore-eol-empty ${CMAKE_COMMAND} -E compare_files --ignore-eol ${RunCMake_SOURCE_DIR}/compare_files/empty1 ${RunCMake_SOURCE_DIR}/compare_files/empty2) run_cmake_command(E_compare_files-ignore-eol-nonexistent ${CMAKE_COMMAND} -E compare_files --ignore-eol nonexistent_a nonexistent_b) +run_cmake_command(E_compare_files-invalid-arguments ${CMAKE_COMMAND} -E compare_files file1.txt file2.txt file3.txt) run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append) run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename) run_cmake_command(E_server-arg ${CMAKE_COMMAND} -E server --extra-arg) @@ -66,6 +67,32 @@ run_cmake_command(install-bad-dir run_cmake_command(install-options-to-vars ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-install-options-to-vars --strip --prefix /var/test --config sample --component pack) +run_cmake_command(install-default-dir-permissions-all + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwx,g=rx,o=rx) +run_cmake_command(install-default-dir-permissions-afew + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwx,g=rx) +run_cmake_command(install-default-dir-permissions-none + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars) +run_cmake_command(install-default-dir-permissions-invalid-comma1 + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwxg=,x) +run_cmake_command(install-default-dir-permissions-invalid-comma2 + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwxg,=x) +run_cmake_command(install-default-dir-permissions-comma-at-the-end + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwx,) +run_cmake_command(install-default-dir-permissions-invalid-assignment + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwx,=x) +run_cmake_command(install-default-dir-permissions-assignment-at-the-end + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions u=rwx,g=) +run_cmake_command(install-default-dir-permissions-assignment-at-the-beginning + ${CMAKE_COMMAND} --install ${RunCMake_SOURCE_DIR}/dir-permissions-install-options-to-vars + --default-directory-permissions =u=rwx,g=rx) run_cmake_command(cache-bad-entry ${CMAKE_COMMAND} --build ${RunCMake_SOURCE_DIR}/cache-bad-entry/) @@ -134,6 +161,8 @@ function(run_BuildDir) ${CMAKE_COMMAND} --build BuildDir-build --target CustomTarget) run_cmake_command(BuildDir--build-multiple-targets ${CMAKE_COMMAND} -E chdir .. ${CMAKE_COMMAND} --build BuildDir-build -t CustomTarget2 --target CustomTarget3) + run_cmake_command(BuildDir--build-multiple-targets-fail ${CMAKE_COMMAND} -E chdir .. + ${CMAKE_COMMAND} --build BuildDir-build -t CustomTargetFail --target CustomTarget3) run_cmake_command(BuildDir--build-multiple-targets-jobs ${CMAKE_COMMAND} -E chdir .. ${CMAKE_COMMAND} --build BuildDir-build --target CustomTarget CustomTarget2 -j2 --target CustomTarget3) run_cmake_command(BuildDir--build-multiple-targets-with-clean-first ${CMAKE_COMMAND} -E chdir .. diff --git a/Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake b/Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake new file mode 100644 index 0000000..42ef745 --- /dev/null +++ b/Tests/RunCMake/CommandLine/dir-permissions-install-options-to-vars/cmake_install.cmake @@ -0,0 +1,3 @@ +if(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS) + message("CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is ${CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS}") +endif() diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt new file mode 100644 index 0000000..42f4b3f --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-afew-stderr.txt @@ -0,0 +1 @@ +CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is OWNER_READ;OWNER_WRITE;OWNER_EXECUTE;GROUP_READ;GROUP_EXECUTE diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt new file mode 100644 index 0000000..813d9c3 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-all-stderr.txt @@ -0,0 +1 @@ +CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is OWNER_READ;OWNER_WRITE;OWNER_EXECUTE;GROUP_READ;GROUP_EXECUTE;WORLD_READ;WORLD_EXECUTE diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt new file mode 100644 index 0000000..1b80952 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-beginning-stderr.txt @@ -0,0 +1 @@ +--default-directory-permissions is in incorrect format diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt new file mode 100644 index 0000000..6680932 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-assignment-at-the-end-stderr.txt @@ -0,0 +1 @@ +CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS is OWNER_READ;OWNER_WRITE;OWNER_EXECUTE diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt new file mode 100644 index 0000000..1b80952 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-comma-at-the-end-stderr.txt @@ -0,0 +1 @@ +--default-directory-permissions is in incorrect format diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt new file mode 100644 index 0000000..1b80952 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-assignment-stderr.txt @@ -0,0 +1 @@ +--default-directory-permissions is in incorrect format diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt new file mode 100644 index 0000000..1b80952 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma1-stderr.txt @@ -0,0 +1 @@ +--default-directory-permissions is in incorrect format diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt new file mode 100644 index 0000000..1b80952 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-invalid-comma2-stderr.txt @@ -0,0 +1 @@ +--default-directory-permissions is in incorrect format diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CommandLine/install-default-dir-permissions-none-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CompatibleInterface/CMakeLists.txt b/Tests/RunCMake/CompatibleInterface/CMakeLists.txt index f452db1..ebab7a3 100644 --- a/Tests/RunCMake/CompatibleInterface/CMakeLists.txt +++ b/Tests/RunCMake/CompatibleInterface/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake index 0196611..64b52d9 100644 --- a/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake +++ b/Tests/RunCMake/CompatibleInterface/DebugProperties.cmake @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.3) project(CompatibleInterface) diff --git a/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake b/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake index 5772856..f072eb0 100644 --- a/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake +++ b/Tests/RunCMake/CompatibleInterface/InterfaceString-builtin-prop.cmake @@ -5,5 +5,5 @@ add_library(bar UNKNOWN IMPORTED) set_property(TARGET foo APPEND PROPERTY COMPATIBLE_INTERFACE_STRING INCLUDE_DIRECTORIES) add_executable(user main.cpp) -set_property(TARGET user PROPERTY INCLUDE_DIRECTORIES bar_inc) +set_property(TARGET user PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/bar_inc) target_link_libraries(user foo bar) diff --git a/Tests/RunCMake/CompilerChange/CMakeLists.txt b/Tests/RunCMake/CompilerChange/CMakeLists.txt index b4b3016..14c47ad 100644 --- a/Tests/RunCMake/CompilerChange/CMakeLists.txt +++ b/Tests/RunCMake/CompilerChange/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) if(NOT RunCMake_TEST) set(RunCMake_TEST "$ENV{RunCMake_TEST}") # needed when cache is deleted endif() diff --git a/Tests/RunCMake/CompilerNotFound/CMakeLists.txt b/Tests/RunCMake/CompilerNotFound/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/CompilerNotFound/CMakeLists.txt +++ b/Tests/RunCMake/CompilerNotFound/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Configure/CMakeLists.txt b/Tests/RunCMake/Configure/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/Configure/CMakeLists.txt +++ b/Tests/RunCMake/Configure/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/DisallowedCommands/CMakeLists.txt b/Tests/RunCMake/DisallowedCommands/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/DisallowedCommands/CMakeLists.txt +++ b/Tests/RunCMake/DisallowedCommands/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt b/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt +++ b/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/ExternalData/CMakeLists.txt b/Tests/RunCMake/ExternalData/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/ExternalData/CMakeLists.txt +++ b/Tests/RunCMake/ExternalData/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FPHSA/CMakeLists.txt b/Tests/RunCMake/FPHSA/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/FPHSA/CMakeLists.txt +++ b/Tests/RunCMake/FPHSA/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FeatureSummary/CMakeLists.txt b/Tests/RunCMake/FeatureSummary/CMakeLists.txt index 72abfc8..74b3ff8 100644 --- a/Tests/RunCMake/FeatureSummary/CMakeLists.txt +++ b/Tests/RunCMake/FeatureSummary/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/File_Generate/CMakeLists.txt b/Tests/RunCMake/File_Generate/CMakeLists.txt index bc0cf5d..3178de5 100644 --- a/Tests/RunCMake/File_Generate/CMakeLists.txt +++ b/Tests/RunCMake/File_Generate/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) if(NOT TEST_FILE) set(TEST_FILE ${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/FindOpenGL/CMP0072-OLD-stderr.txt b/Tests/RunCMake/FindOpenGL/CMP0072-OLD-stderr.txt new file mode 100644 index 0000000..68d23d4 --- /dev/null +++ b/Tests/RunCMake/FindOpenGL/CMP0072-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0072-OLD.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0072 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/FindPkgConfig/CMakeLists.txt b/Tests/RunCMake/FindPkgConfig/CMakeLists.txt index 72abfc8..74b3ff8 100644 --- a/Tests/RunCMake/FindPkgConfig/CMakeLists.txt +++ b/Tests/RunCMake/FindPkgConfig/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt index 42dd0ce..130de2b 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt @@ -10,15 +10,6 @@ Call Stack \(most recent call first\): CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): Error evaluating generator expression: - \$<CONFIG:Foo,Bar> - - \$<CONFIG> expression requires one or zero parameters. -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -+ -CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): - Error evaluating generator expression: - \$<CONFIG:Foo-Bar> Expression syntax not recognized. diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake index 5c22aaa..1735ab7 100644 --- a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake @@ -1,6 +1,5 @@ add_custom_target(check ALL COMMAND check $<CONFIG:.> - $<CONFIG:Foo,Bar> $<CONFIG:Foo-Bar> $<$<CONFIG:Foo-Nested>:foo> VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/CMakeLists.txt b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/GeneratorExpression/CMakeLists.txt +++ b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries-check.cmake b/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries-check.cmake new file mode 100644 index 0000000..b43256b --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries-check.cmake @@ -0,0 +1,6 @@ +file(READ "${RunCMake_TEST_BINARY_DIR}/CONFIG-empty-entries-generated.txt" content) + +set(expected "1234") +if(NOT content STREQUAL expected) + set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n [[${expected}]]") +endif() diff --git a/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries.cmake b/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries.cmake new file mode 100644 index 0000000..a4d53f9 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CONFIG-empty-entries.cmake @@ -0,0 +1,9 @@ +cmake_policy(SET CMP0070 NEW) + +set(text) +string(APPEND text "$<$<CONFIG:>:1>") +string(APPEND text "$<$<CONFIG:Release,>:2>") +string(APPEND text "$<$<CONFIG:,Release>:3>") +string(APPEND text "$<$<CONFIG:Release,,Debug>:4>") +string(APPEND text "$<$<CONFIG:Release,Debug>:5>") +file(GENERATE OUTPUT CONFIG-empty-entries-generated.txt CONTENT ${text}) diff --git a/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries-check.cmake b/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries-check.cmake new file mode 100644 index 0000000..66f42c7 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries-check.cmake @@ -0,0 +1,6 @@ +file(READ "${RunCMake_TEST_BINARY_DIR}/CONFIG-multiple-entries-generated.txt" content) + +set(expected "14") +if(NOT content STREQUAL expected) + set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n [[${expected}]]") +endif() diff --git a/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries.cmake b/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries.cmake new file mode 100644 index 0000000..6829282 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/CONFIG-multiple-entries.cmake @@ -0,0 +1,8 @@ +cmake_policy(SET CMP0070 NEW) + +set(text) +string(APPEND text "$<$<CONFIG:CustomConfig>:1>") +string(APPEND text "$<$<CONFIG:Release>:2>") +string(APPEND text "$<$<CONFIG:Debug,Release>:3>") +string(APPEND text "$<$<CONFIG:Release,CustomConfig,Debug>:4>") +file(GENERATE OUTPUT CONFIG-multiple-entries-generated.txt CONTENT "${text}") diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake index 0278cf6..6349112 100644 --- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake @@ -12,6 +12,7 @@ run_cmake(BadTargetTypeInterface) run_cmake(BadTargetTypeObject) run_cmake(BadInstallPrefix) run_cmake(BadSHELL_PATH) +run_cmake(BadCONFIG) run_cmake(CMP0044-WARN) run_cmake(NonValidTarget-C_COMPILER_ID) run_cmake(NonValidTarget-CXX_COMPILER_ID) @@ -44,6 +45,19 @@ run_cmake(FILTER-InvalidOperator) run_cmake(FILTER-Exclude) run_cmake(FILTER-Include) +if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(RunCMake_TEST_OPTIONS [==[-DCMAKE_CONFIGURATION_TYPES=CustomConfig]==]) +else() + set(RunCMake_TEST_OPTIONS [==[-DCMAKE_BUILD_TYPE=CustomConfig]==]) +endif() +run_cmake(CONFIG-multiple-entries) +if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(RunCMake_TEST_OPTIONS [==[-DCMAKE_CONFIGURATION_TYPES=]==]) +else() + set(RunCMake_TEST_OPTIONS [==[-DCMAKE_BUILD_TYPE=]==]) +endif() +run_cmake(CONFIG-empty-entries) + set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0085:STRING=OLD) run_cmake(CMP0085-OLD) unset(RunCMake_TEST_OPTIONS) diff --git a/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt b/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt +++ b/Tests/RunCMake/GeneratorPlatform/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/GeneratorToolset/CMakeLists.txt b/Tests/RunCMake/GeneratorToolset/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/GeneratorToolset/CMakeLists.txt +++ b/Tests/RunCMake/GeneratorToolset/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake index 10cd2bc..4ce6b5c 100644 --- a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake +++ b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake @@ -9,6 +9,7 @@ # - All library depend on a common INTERFACE library holding compiler flags # - We have a custom target to generate a man page # - Someone has added an UNKNOWN, IMPORTED crypto mining library! +# - We have a circular dependency between two libraries add_subdirectory(test_project/third_party_project) @@ -23,6 +24,13 @@ target_link_libraries(CoreLibrary PUBLIC CompilerFlags) target_link_libraries(CoreLibrary PRIVATE SeriousLoggingLibrary) +add_library(SystemLibrary STATIC test_project/system_library.c) + +# Create a circular dependency. +# See https://gitlab.kitware.com/cmake/cmake/issues/20720 +target_link_libraries(CoreLibrary PRIVATE SystemLibrary) +target_link_libraries(SystemLibrary PRIVATE CoreLibrary) + add_library(GraphicLibraryObjects OBJECT test_project/graphic_library.c) add_library(GraphicLibrary SHARED) diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot index 8b0365a..31d88df 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot @@ -28,25 +28,28 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GenerateManPage", shape = box ]; - "node1" -> "node5" // ConsoleApplication -> GenerateManPage - "node6" [ label = "GraphicApplication", shape = egg ]; - "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node8" [ label = "\"-lm\"", shape = septagon ]; - "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" - "node7" -> "node0" // GraphicLibrary -> CompilerFlags - "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GenerateManPage", shape = box ]; + "node1" -> "node6" // ConsoleApplication -> GenerateManPage + "node7" [ label = "GraphicApplication", shape = egg ]; + "node7" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node8" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node9" [ label = "\"-lm\"", shape = septagon ]; + "node8" -> "node9" [ style = dotted ] // GraphicLibrary -> "-lm" + "node8" -> "node0" // GraphicLibrary -> CompilerFlags + "node8" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node10" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node8" -> "node10" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node7" -> "node8" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node11" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node11" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node11" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node12" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node12" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node12" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot index 1bbf25a..26f2f64 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot @@ -28,23 +28,26 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot index 1bbf25a..26f2f64 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot @@ -28,23 +28,26 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot index 558a470..7f2e01c 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot @@ -27,18 +27,21 @@ subgraph clusterLegend { "node1" -> "node0" // CoreLibrary -> CompilerFlags "node2" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node1" -> "node2" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary - "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node4" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node5" [ label = "\"-lm\"", shape = septagon ]; - "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm" - "node4" -> "node0" // GraphicLibrary -> CompilerFlags - "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node6" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node3" [ label = "SystemLibrary", shape = octagon ]; + "node3" -> "node1" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node1" -> "node3" [ style = dotted ] // CoreLibrary -> SystemLibrary + "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node5" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node6" [ label = "\"-lm\"", shape = septagon ]; + "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm" + "node5" -> "node0" // GraphicLibrary -> CompilerFlags + "node5" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node7" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node8" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node9" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot index 660af37..db675a8 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot @@ -28,19 +28,22 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "GraphicApplication", shape = egg ]; - "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node5" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node5" -> "node0" // GraphicLibrary -> CompilerFlags - "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node6" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node7" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node8" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "GraphicApplication", shape = egg ]; + "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node6" -> "node0" // GraphicLibrary -> CompilerFlags + "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node7" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot index 5af7fec..234ee39 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot @@ -28,8 +28,11 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "\"-lm\"", shape = septagon ]; + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "\"-lm\"", shape = septagon ]; } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot index 94ec41c..6dea88c 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot @@ -24,20 +24,23 @@ subgraph clusterLegend { } "node0" [ label = "ConsoleApplication", shape = egg ]; "node1" [ label = "CoreLibrary", shape = octagon ]; + "node2" [ label = "SystemLibrary", shape = octagon ]; + "node2" -> "node1" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node1" -> "node2" [ style = dotted ] // CoreLibrary -> SystemLibrary "node0" -> "node1" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node2" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node0" -> "node2" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node3" [ label = "GraphicApplication", shape = egg ]; - "node3" -> "node1" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node4" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node5" [ label = "\"-lm\"", shape = septagon ]; - "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm" - "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node6" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node3" -> "node4" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node0" -> "node3" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node4" [ label = "GraphicApplication", shape = egg ]; + "node4" -> "node1" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node5" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node6" [ label = "\"-lm\"", shape = septagon ]; + "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm" + "node5" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node7" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node8" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node9" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot index 65b7a71..df3d10a 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot @@ -28,17 +28,20 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot index 8116bc9..8f832a8 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot @@ -28,21 +28,24 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot index 1bbf25a..26f2f64 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot @@ -28,23 +28,26 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot index 439d1f7..e127daa 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot @@ -28,17 +28,20 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "\"-lm\"", shape = septagon ]; - "node7" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "\"-lm\"", shape = septagon ]; + "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot index 1be6550..4f242bb 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot @@ -28,21 +28,24 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "GraphicApplication", shape = egg ]; - "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node5" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node6" [ label = "\"-lm\"", shape = septagon ]; - "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm" - "node5" -> "node0" // GraphicLibrary -> CompilerFlags - "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node7" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "GraphicApplication", shape = egg ]; + "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node7" [ label = "\"-lm\"", shape = septagon ]; + "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" + "node6" -> "node0" // GraphicLibrary -> CompilerFlags + "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot index 1cfbe0f..c664af8 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot @@ -28,23 +28,26 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot index 9653c33..5579306 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot @@ -28,23 +28,26 @@ subgraph clusterLegend { "node2" -> "node0" // CoreLibrary -> CompilerFlags "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "node4" [ label = "SystemLibrary", shape = octagon ]; + "node4" -> "node2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "node2" -> "node4" [ style = dotted ] // CoreLibrary -> SystemLibrary "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "node5" [ label = "GraphicApplication", shape = egg ]; - "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "node6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "node7" [ label = "\"-lm\"", shape = septagon ]; - "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm" - "node6" -> "node0" // GraphicLibrary -> CompilerFlags - "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "node8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "node5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "node1" -> "node5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "node6" [ label = "GraphicApplication", shape = egg ]; + "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "node7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "node8" [ label = "\"-lm\"", shape = septagon ]; + "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm" + "node7" -> "node0" // GraphicLibrary -> CompilerFlags + "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "node9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot index 82d96d0..3bf20ec 100644 --- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot +++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot @@ -28,23 +28,26 @@ subgraph clusterLegend { "point2" -> "point0" // CoreLibrary -> CompilerFlags "point3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ]; "point2" -> "point3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary + "point4" [ label = "SystemLibrary", shape = octagon ]; + "point4" -> "point2" [ style = dotted ] // SystemLibrary -> CoreLibrary + "point2" -> "point4" [ style = dotted ] // CoreLibrary -> SystemLibrary "point1" -> "point2" [ style = dotted ] // ConsoleApplication -> CoreLibrary - "point4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; - "point1" -> "point4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary - "point5" [ label = "GraphicApplication", shape = egg ]; - "point5" -> "point2" [ style = dotted ] // GraphicApplication -> CoreLibrary - "point6" [ label = "GraphicLibrary", shape = doubleoctagon ]; - "point7" [ label = "\"-lm\"", shape = septagon ]; - "point6" -> "point7" [ style = dotted ] // GraphicLibrary -> "-lm" - "point6" -> "point0" // GraphicLibrary -> CompilerFlags - "point6" -> "point2" [ style = dotted ] // GraphicLibrary -> CoreLibrary - "point8" [ label = "GraphicLibraryObjects", shape = hexagon ]; - "point6" -> "point8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects - "point5" -> "point6" [ style = dotted ] // GraphicApplication -> GraphicLibrary - "point9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; - "point9" -> "point0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags - "point9" -> "point2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary - "point10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; - "point10" -> "point0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags - "point10" -> "point2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary + "point5" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ]; + "point1" -> "point5" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary + "point6" [ label = "GraphicApplication", shape = egg ]; + "point6" -> "point2" [ style = dotted ] // GraphicApplication -> CoreLibrary + "point7" [ label = "GraphicLibrary", shape = doubleoctagon ]; + "point8" [ label = "\"-lm\"", shape = septagon ]; + "point7" -> "point8" [ style = dotted ] // GraphicLibrary -> "-lm" + "point7" -> "point0" // GraphicLibrary -> CompilerFlags + "point7" -> "point2" [ style = dotted ] // GraphicLibrary -> CoreLibrary + "point9" [ label = "GraphicLibraryObjects", shape = hexagon ]; + "point7" -> "point9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects + "point6" -> "point7" [ style = dotted ] // GraphicApplication -> GraphicLibrary + "point10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ]; + "point10" -> "point0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags + "point10" -> "point2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary + "point11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ]; + "point11" -> "point0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags + "point11" -> "point2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary } diff --git a/Tests/RunCMake/Graphviz/test_project/system_library.c b/Tests/RunCMake/Graphviz/test_project/system_library.c new file mode 100644 index 0000000..5d67079 --- /dev/null +++ b/Tests/RunCMake/Graphviz/test_project/system_library.c @@ -0,0 +1,3 @@ +void initialize_system() +{ +} diff --git a/Tests/RunCMake/IncompatibleQt/CMakeLists.txt b/Tests/RunCMake/IncompatibleQt/CMakeLists.txt index f452db1..ebab7a3 100644 --- a/Tests/RunCMake/IncompatibleQt/CMakeLists.txt +++ b/Tests/RunCMake/IncompatibleQt/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/Languages/CMakeLists.txt b/Tests/RunCMake/Languages/CMakeLists.txt index 8996fef..74b3ff8 100644 --- a/Tests/RunCMake/Languages/CMakeLists.txt +++ b/Tests/RunCMake/Languages/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) -cmake_policy(SET CMP0042 NEW) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt b/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt index 411cd7c..5c7882d 100644 --- a/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt +++ b/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt @@ -3,7 +3,7 @@ CMake Error at MissingSource.cmake:1 \(add_library\): missing.c - Tried extensions( \.[A-Za-z+]+| - )* + Tried extensions \.c \.C .* +.* Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt b/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt index 65ac8e8..44b5d30 100644 --- a/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt +++ b/Tests/RunCMake/ObsoleteQtMacros/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST}) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt b/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt index 90afc12..c3922d6 100644 --- a/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt +++ b/Tests/RunCMake/PositionIndependentCode/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} CXX) # MSVC creates extra targets which pollute the stderr unless we set this. diff --git a/Tests/RunCMake/SourceProperties/CMakeLists.txt b/Tests/RunCMake/SourceProperties/CMakeLists.txt index a17c8cd..e93f0b6 100644 --- a/Tests/RunCMake/SourceProperties/CMakeLists.txt +++ b/Tests/RunCMake/SourceProperties/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} C) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetObjects/CMakeLists.txt b/Tests/RunCMake/TargetObjects/CMakeLists.txt index be9d403..44b5d30 100644 --- a/Tests/RunCMake/TargetObjects/CMakeLists.txt +++ b/Tests/RunCMake/TargetObjects/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST}) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetPolicies/CMakeLists.txt b/Tests/RunCMake/TargetPolicies/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/TargetPolicies/CMakeLists.txt +++ b/Tests/RunCMake/TargetPolicies/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetProperties/CMakeLists.txt b/Tests/RunCMake/TargetProperties/CMakeLists.txt index be9d403..44b5d30 100644 --- a/Tests/RunCMake/TargetProperties/CMakeLists.txt +++ b/Tests/RunCMake/TargetProperties/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST}) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt index 90afc12..c3922d6 100644 --- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} CXX) # MSVC creates extra targets which pollute the stderr unless we set this. diff --git a/Tests/RunCMake/TargetSources/CMakeLists.txt b/Tests/RunCMake/TargetSources/CMakeLists.txt index f452db1..a06591c 100644 --- a/Tests/RunCMake/TargetSources/CMakeLists.txt +++ b/Tests/RunCMake/TargetSources/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/VSSolution/CMakeLists.txt b/Tests/RunCMake/VSSolution/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/VSSolution/CMakeLists.txt +++ b/Tests/RunCMake/VSSolution/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/XcodeProject/CMakeLists.txt b/Tests/RunCMake/XcodeProject/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/XcodeProject/CMakeLists.txt +++ b/Tests/RunCMake/XcodeProject/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake b/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake index ab31387..75da7b1 100644 --- a/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.5) +cmake_minimum_required(VERSION 3.3) project(XcodeInstallIOS) diff --git a/Tests/RunCMake/add_dependencies/CMakeLists.txt b/Tests/RunCMake/add_dependencies/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/add_dependencies/CMakeLists.txt +++ b/Tests/RunCMake/add_dependencies/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/alias_targets/CMakeLists.txt b/Tests/RunCMake/alias_targets/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/alias_targets/CMakeLists.txt +++ b/Tests/RunCMake/alias_targets/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/alias_targets/invalid-name.cmake b/Tests/RunCMake/alias_targets/invalid-name.cmake index bbd39e3..01983e5 100644 --- a/Tests/RunCMake/alias_targets/invalid-name.cmake +++ b/Tests/RunCMake/alias_targets/invalid-name.cmake @@ -1,4 +1,4 @@ - +cmake_minimum_required(VERSION 2.8.12) enable_language(CXX) add_library(foo empty.cpp) diff --git a/Tests/RunCMake/build_command/CMakeLists.txt b/Tests/RunCMake/build_command/CMakeLists.txt index 73e6a78..f1a83e8 100644 --- a/Tests/RunCMake/build_command/CMakeLists.txt +++ b/Tests/RunCMake/build_command/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) if(NOT NoProject) project(${RunCMake_TEST} NONE) endif() diff --git a/Tests/RunCMake/cmake_minimum_required/Before2812-stderr.txt b/Tests/RunCMake/cmake_minimum_required/Before2812-stderr.txt new file mode 100644 index 0000000..7d40dcb --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/Before2812-stderr.txt @@ -0,0 +1,26 @@ +^CMake Deprecation Warning at Before2812.cmake:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Deprecation Warning at Before2812.cmake:2 \(cmake_policy\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Deprecation Warning at Before2812.cmake:6 \(cmake_policy\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/cmake_minimum_required/Before2812.cmake b/Tests/RunCMake/cmake_minimum_required/Before2812.cmake new file mode 100644 index 0000000..220e359 --- /dev/null +++ b/Tests/RunCMake/cmake_minimum_required/Before2812.cmake @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 2.8.11) +cmake_policy(VERSION 2.6) +cmake_policy(PUSH) +cmake_policy(VERSION 2.6) # simulate pre-3.18 install(EXPORT)-generated call +cmake_policy(POP) +cmake_policy(VERSION 2.8.11) diff --git a/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt b/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt index e8db6b0..667561e 100644 --- a/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt +++ b/Tests/RunCMake/cmake_minimum_required/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) -include(${RunCMake_TEST}.cmake) +include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt b/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt index a874466..81d26d2 100644 --- a/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt +++ b/Tests/RunCMake/cmake_minimum_required/CompatBefore24-stderr.txt @@ -1,3 +1,12 @@ +^CMake Deprecation Warning at CompatBefore24.cmake:1 \(cmake_minimum_required\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ CMake Error in CMakeLists.txt: You have set CMAKE_BACKWARDS_COMPATIBILITY to a CMake version less than 2.4. This version of CMake only supports backwards compatibility with diff --git a/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake index 1030211..3a959bb 100644 --- a/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake +++ b/Tests/RunCMake/cmake_minimum_required/RunCMakeTest.cmake @@ -4,6 +4,7 @@ run_cmake(Before24) run_cmake(CompatBefore24) run_cmake(Future) run_cmake(PolicyBefore24) +run_cmake(Before2812) run_cmake(Range) run_cmake(RangeBad) run_cmake(Unknown) diff --git a/Tests/RunCMake/ctest_memcheck/CMakeLists.txt.in b/Tests/RunCMake/ctest_memcheck/CMakeLists.txt.in index 3b8edf4..68a0fcb 100644 --- a/Tests/RunCMake/ctest_memcheck/CMakeLists.txt.in +++ b/Tests/RunCMake/ctest_memcheck/CMakeLists.txt.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 3.3) project(CTestTestMemcheck@CASE_NAME@ NONE) include(CTest) diff --git a/Tests/RunCMake/ctest_memcheck/test.cmake.in b/Tests/RunCMake/ctest_memcheck/test.cmake.in index 50b4b6a..eedf080 100644 --- a/Tests/RunCMake/ctest_memcheck/test.cmake.in +++ b/Tests/RunCMake/ctest_memcheck/test.cmake.in @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 3.3) # Settings: set(CTEST_SITE "@SITE@") diff --git a/Tests/RunCMake/export/CMakeLists.txt b/Tests/RunCMake/export/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/export/CMakeLists.txt +++ b/Tests/RunCMake/export/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/find_dependency/CMakeLists.txt b/Tests/RunCMake/find_dependency/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/find_dependency/CMakeLists.txt +++ b/Tests/RunCMake/find_dependency/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/find_package/CMakeLists.txt b/Tests/RunCMake/find_package/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/find_package/CMakeLists.txt +++ b/Tests/RunCMake/find_package/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/find_package/MissingNormalWarnNoModuleOld-stderr.txt b/Tests/RunCMake/find_package/MissingNormalWarnNoModuleOld-stderr.txt index b336b56..ebfd7d0 100644 --- a/Tests/RunCMake/find_package/MissingNormalWarnNoModuleOld-stderr.txt +++ b/Tests/RunCMake/find_package/MissingNormalWarnNoModuleOld-stderr.txt @@ -1,9 +1,10 @@ CMake Warning \(dev\) at MissingNormalWarnNoModuleOld.cmake:2 \(find_package\): - find_package called without NO_MODULE option and no FindNotHere.cmake - module is in CMAKE_MODULE_PATH. Add NO_MODULE to exclusively request - Config mode and search for a package configuration file provided by NotHere - \(NotHereConfig.cmake or nothere-config.cmake\). Otherwise make - FindNotHere.cmake available in CMAKE_MODULE_PATH. + find_package called without either MODULE or CONFIG option and no + FindNotHere.cmake module is in CMAKE_MODULE_PATH. Add MODULE to + exclusively request Module mode and fail if FindNotHere.cmake is missing. + Add CONFIG to exclusively request Config mode and search for a package + configuration file provided by NotHere \(NotHereConfig.cmake or + nothere-config.cmake\). \(Variable CMAKE_FIND_PACKAGE_WARN_NO_MODULE enabled this warning.\) Call Stack \(most recent call first\): diff --git a/Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt b/Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt new file mode 100644 index 0000000..331d465 --- /dev/null +++ b/Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt @@ -0,0 +1 @@ +-- FakeApp_EXECUTABLE='.*/Tests/RunCMake/find_program/BundleSpaceInName-build/Fake app.app/Contents/MacOS/Fake app' diff --git a/Tests/RunCMake/find_program/BundleSpaceInName.cmake b/Tests/RunCMake/find_program/BundleSpaceInName.cmake new file mode 100644 index 0000000..9152d5b --- /dev/null +++ b/Tests/RunCMake/find_program/BundleSpaceInName.cmake @@ -0,0 +1,8 @@ +set(fakeApp "${CMAKE_CURRENT_BINARY_DIR}/Fake app.app/Contents/MacOS/Fake app") +file(WRITE "${fakeApp}" "#!/bin/sh\n") +execute_process(COMMAND chmod a+rx "${fakeApp}") + +find_program(FakeApp_EXECUTABLE NAMES "Fake app" NO_DEFAULT_PATH + PATHS "${CMAKE_CURRENT_BINARY_DIR}" +) +message(STATUS "FakeApp_EXECUTABLE='${FakeApp_EXECUTABLE}'") diff --git a/Tests/RunCMake/find_program/ExeNoRead.cmake b/Tests/RunCMake/find_program/CMP0109-Common.cmake index 7e22dc5..525413a 100644 --- a/Tests/RunCMake/find_program/ExeNoRead.cmake +++ b/Tests/RunCMake/find_program/CMP0109-Common.cmake @@ -1,4 +1,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ExeNoRead" "#!/bin/sh\n") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ReadNoExe" "#ReadNoExe") execute_process(COMMAND chmod -r+x "${CMAKE_CURRENT_BINARY_DIR}/ExeNoRead") find_program(ExeNoRead_EXECUTABLE NAMES ExeNoRead NO_DEFAULT_PATH PATHS "${CMAKE_CURRENT_BINARY_DIR}") message(STATUS "ExeNoRead_EXECUTABLE='${ExeNoRead_EXECUTABLE}'") +find_program(ReadNoExe_EXECUTABLE NAMES ReadNoExe NO_DEFAULT_PATH PATHS "${CMAKE_CURRENT_BINARY_DIR}") +message(STATUS "ReadNoExe_EXECUTABLE='${ReadNoExe_EXECUTABLE}'") diff --git a/Tests/RunCMake/find_program/CMP0109-NEW-stdout.txt b/Tests/RunCMake/find_program/CMP0109-NEW-stdout.txt new file mode 100644 index 0000000..2744463 --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-NEW-stdout.txt @@ -0,0 +1,2 @@ +-- ExeNoRead_EXECUTABLE='.*/Tests/RunCMake/find_program/CMP0109-NEW-build/ExeNoRead' +-- ReadNoExe_EXECUTABLE='ReadNoExe_EXECUTABLE-NOTFOUND' diff --git a/Tests/RunCMake/find_program/CMP0109-NEW.cmake b/Tests/RunCMake/find_program/CMP0109-NEW.cmake new file mode 100644 index 0000000..b4a4033 --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-NEW.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0109 NEW) +include(CMP0109-Common.cmake) diff --git a/Tests/RunCMake/find_program/CMP0109-OLD-stdout.txt b/Tests/RunCMake/find_program/CMP0109-OLD-stdout.txt new file mode 100644 index 0000000..1a0e2a8 --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-OLD-stdout.txt @@ -0,0 +1,2 @@ +-- ExeNoRead_EXECUTABLE='ExeNoRead_EXECUTABLE-NOTFOUND' +-- ReadNoExe_EXECUTABLE='.*/Tests/RunCMake/find_program/CMP0109-OLD-build/ReadNoExe' diff --git a/Tests/RunCMake/find_program/CMP0109-OLD.cmake b/Tests/RunCMake/find_program/CMP0109-OLD.cmake new file mode 100644 index 0000000..8260161 --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-OLD.cmake @@ -0,0 +1,2 @@ +cmake_policy(SET CMP0109 OLD) +include(CMP0109-Common.cmake) diff --git a/Tests/RunCMake/find_program/CMP0109-WARN-stderr.txt b/Tests/RunCMake/find_program/CMP0109-WARN-stderr.txt new file mode 100644 index 0000000..202fc6d --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-WARN-stderr.txt @@ -0,0 +1,29 @@ +^CMake Warning \(dev\) at CMP0109-Common.cmake:4 \(find_program\): + Policy CMP0109 is not set: find_program\(\) requires permission to execute + but not to read. Run "cmake --help-policy CMP0109" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + The file + + .*/Tests/RunCMake/find_program/CMP0109-WARN-build/ExeNoRead + + is executable but not readable. CMake is ignoring it for compatibility. +Call Stack \(most recent call first\): + CMP0109-WARN.cmake:1 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at CMP0109-Common.cmake:6 \(find_program\): + Policy CMP0109 is not set: find_program\(\) requires permission to execute + but not to read. Run "cmake --help-policy CMP0109" for policy details. + Use the cmake_policy command to set the policy and suppress this warning. + + The file + + .*/Tests/RunCMake/find_program/CMP0109-WARN-build/ReadNoExe + + is readable but not executable. CMake is using it for compatibility. +Call Stack \(most recent call first\): + CMP0109-WARN.cmake:1 \(include\) + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it.$ diff --git a/Tests/RunCMake/find_program/CMP0109-WARN-stdout.txt b/Tests/RunCMake/find_program/CMP0109-WARN-stdout.txt new file mode 100644 index 0000000..baf560f --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-WARN-stdout.txt @@ -0,0 +1,2 @@ +-- ExeNoRead_EXECUTABLE='ExeNoRead_EXECUTABLE-NOTFOUND' +-- ReadNoExe_EXECUTABLE='.*/Tests/RunCMake/find_program/CMP0109-WARN-build/ReadNoExe' diff --git a/Tests/RunCMake/find_program/CMP0109-WARN.cmake b/Tests/RunCMake/find_program/CMP0109-WARN.cmake new file mode 100644 index 0000000..a3d59af --- /dev/null +++ b/Tests/RunCMake/find_program/CMP0109-WARN.cmake @@ -0,0 +1 @@ +include(CMP0109-Common.cmake) diff --git a/Tests/RunCMake/find_program/ExeNoRead-stdout.txt b/Tests/RunCMake/find_program/ExeNoRead-stdout.txt deleted file mode 100644 index f231178..0000000 --- a/Tests/RunCMake/find_program/ExeNoRead-stdout.txt +++ /dev/null @@ -1 +0,0 @@ --- ExeNoRead_EXECUTABLE='ExeNoRead_EXECUTABLE-NOTFOUND' diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake index 2bb777b..3e23920 100644 --- a/Tests/RunCMake/find_program/RunCMakeTest.cmake +++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake @@ -17,6 +17,12 @@ else() OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT "${uid}" STREQUAL "0") - run_cmake(ExeNoRead) + run_cmake(CMP0109-WARN) + run_cmake(CMP0109-OLD) + run_cmake(CMP0109-NEW) endif() endif() + +if(APPLE) + run_cmake(BundleSpaceInName) +endif() diff --git a/Tests/RunCMake/get_filename_component/IncorrectArguments-result.txt b/Tests/RunCMake/get_filename_component/IncorrectArguments-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/get_filename_component/IncorrectArguments-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/get_filename_component/IncorrectArguments-stderr.txt b/Tests/RunCMake/get_filename_component/IncorrectArguments-stderr.txt new file mode 100644 index 0000000..af08afa --- /dev/null +++ b/Tests/RunCMake/get_filename_component/IncorrectArguments-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at IncorrectArguments.cmake:1 \(get_filename_component\): + get_filename_component called with incorrect number of arguments +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_filename_component/IncorrectArguments.cmake b/Tests/RunCMake/get_filename_component/IncorrectArguments.cmake new file mode 100644 index 0000000..e329e29 --- /dev/null +++ b/Tests/RunCMake/get_filename_component/IncorrectArguments.cmake @@ -0,0 +1,2 @@ +get_filename_component(var) +message("The error is fatal, so this should not print") diff --git a/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake b/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake index 156fc8f..a7820a0 100644 --- a/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake +++ b/Tests/RunCMake/get_filename_component/RunCMakeTest.cmake @@ -1,4 +1,5 @@ include(RunCMake) +run_cmake(IncorrectArguments) run_cmake(KnownComponents) run_cmake(UnknownComponent) diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt b/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt index b146e5b..f86a688 100644 --- a/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt +++ b/Tests/RunCMake/get_filename_component/UnknownComponent-stderr.txt @@ -1,4 +1,4 @@ -CMake Error at UnknownComponent.cmake:1 \(get_filename_component\): +^CMake Error at UnknownComponent.cmake:1 \(get_filename_component\): get_filename_component unknown component BOGUS Call Stack \(most recent call first\): - CMakeLists.txt:[0-9]+ \(include\) + CMakeLists.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/get_filename_component/UnknownComponent.cmake b/Tests/RunCMake/get_filename_component/UnknownComponent.cmake index 06abc51..19521ba 100644 --- a/Tests/RunCMake/get_filename_component/UnknownComponent.cmake +++ b/Tests/RunCMake/get_filename_component/UnknownComponent.cmake @@ -1 +1,2 @@ get_filename_component(var "/path/to/filename.ext.in" BOGUS) +message("The error is fatal, so this should not print") diff --git a/Tests/RunCMake/get_property/CMakeLists.txt b/Tests/RunCMake/get_property/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/get_property/CMakeLists.txt +++ b/Tests/RunCMake/get_property/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/if/CMakeLists.txt b/Tests/RunCMake/if/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/if/CMakeLists.txt +++ b/Tests/RunCMake/if/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/include/CMakeLists.txt b/Tests/RunCMake/include/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/include/CMakeLists.txt +++ b/Tests/RunCMake/include/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/include_external_msproject/CMakeLists.txt b/Tests/RunCMake/include_external_msproject/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/include_external_msproject/CMakeLists.txt +++ b/Tests/RunCMake/include_external_msproject/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/interface_library/CMakeLists.txt b/Tests/RunCMake/interface_library/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/interface_library/CMakeLists.txt +++ b/Tests/RunCMake/interface_library/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/interface_library/global-interface-stderr.txt b/Tests/RunCMake/interface_library/global-interface-stderr.txt index 23b45d9..38585eb 100644 --- a/Tests/RunCMake/interface_library/global-interface-stderr.txt +++ b/Tests/RunCMake/interface_library/global-interface-stderr.txt @@ -3,7 +3,7 @@ CMake Error at global-interface.cmake:2 \(add_library\): GLOBAL - Tried extensions( \.[A-Za-z+]+| - )* + Tried extensions \.c \.C .* +.* Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/interface_library/invalid_name.cmake b/Tests/RunCMake/interface_library/invalid_name.cmake index 9a965aa..575fcc6 100644 --- a/Tests/RunCMake/interface_library/invalid_name.cmake +++ b/Tests/RunCMake/interface_library/invalid_name.cmake @@ -1,4 +1,4 @@ - +cmake_minimum_required(VERSION 2.8.12) add_library(if$ace INTERFACE) add_library(iface::target INTERFACE) diff --git a/Tests/RunCMake/list/CMakeLists.txt b/Tests/RunCMake/list/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/list/CMakeLists.txt +++ b/Tests/RunCMake/list/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt b/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt index a0f8837..9103bd2 100644 --- a/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt +++ b/Tests/RunCMake/list/GET-CMP0007-WARN-stderr.txt @@ -1,4 +1,13 @@ -^CMake Warning \(dev\) at GET-CMP0007-WARN.cmake:4 \(list\): +^CMake Deprecation Warning at GET-CMP0007-WARN.cmake:1 \(cmake_policy\): + Compatibility with CMake < 2.8.12 will be removed from a future version of + CMake. + + Update the VERSION argument <min> value or use a ...<max> suffix to tell + CMake that the project does not need compatibility with older versions. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Warning \(dev\) at GET-CMP0007-WARN.cmake:4 \(list\): Policy CMP0007 is not set: list command no longer ignores empty elements. Run "cmake --help-policy CMP0007" for policy details. Use the cmake_policy command to set the policy and suppress this warning. List has value = diff --git a/Tests/RunCMake/math/CMakeLists.txt b/Tests/RunCMake/math/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/math/CMakeLists.txt +++ b/Tests/RunCMake/math/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/message/CMakeLists.txt b/Tests/RunCMake/message/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/message/CMakeLists.txt +++ b/Tests/RunCMake/message/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/no_install_prefix/CMakeLists.txt b/Tests/RunCMake/no_install_prefix/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/no_install_prefix/CMakeLists.txt +++ b/Tests/RunCMake/no_install_prefix/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/project/CMakeLists.txt b/Tests/RunCMake/project/CMakeLists.txt index 12cd3c7..4b3de84 100644 --- a/Tests/RunCMake/project/CMakeLists.txt +++ b/Tests/RunCMake/project/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/string/CMakeLists.txt b/Tests/RunCMake/string/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/string/CMakeLists.txt +++ b/Tests/RunCMake/string/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake index 2e9cba8..6c72546 100644 --- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake +++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2.cmake @@ -1,4 +1,4 @@ - +cmake_minimum_required(VERSION 2.8.11) project(CMP0022-WARN) add_library(foo SHARED empty_vs6_1.cpp) diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake b/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake index fcc8da0..dfdf70b 100644 --- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake +++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN.cmake @@ -1,4 +1,4 @@ - +cmake_minimum_required(VERSION 2.8.11) project(CMP0022-WARN) add_library(foo SHARED empty_vs6_1.cpp) diff --git a/Tests/RunCMake/target_link_libraries/CMakeLists.txt b/Tests/RunCMake/target_link_libraries/CMakeLists.txt index 8f85fbf..667561e 100644 --- a/Tests/RunCMake/target_link_libraries/CMakeLists.txt +++ b/Tests/RunCMake/target_link_libraries/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 2.8.12) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake index 9b97918..9f86b18 100644 --- a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake +++ b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0022 NEW) enable_language(C) add_library(foo STATIC empty.c) add_library(not_exported STATIC empty.c) diff --git a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake index 7122ae9..20ec438 100644 --- a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake +++ b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotTarget.cmake @@ -1,4 +1,3 @@ -cmake_policy(SET CMP0022 NEW) enable_language(C) add_library(foo STATIC empty.c) target_link_libraries(foo PRIVATE not_a_target) diff --git a/Tests/RunCMake/try_compile/CMP0056.cmake b/Tests/RunCMake/try_compile/CMP0056.cmake index e8d3d4a..2ab79d5 100644 --- a/Tests/RunCMake/try_compile/CMP0056.cmake +++ b/Tests/RunCMake/try_compile/CMP0056.cmake @@ -1,3 +1,4 @@ +cmake_minimum_required(VERSION 3.1) enable_language(C) set(obj "${CMAKE_C_OUTPUT_EXTENSION}") if(BORLAND) diff --git a/Tests/RunCMake/try_compile/CMakeLists.txt b/Tests/RunCMake/try_compile/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/try_compile/CMakeLists.txt +++ b/Tests/RunCMake/try_compile/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/try_compile/proj/CMakeLists.txt b/Tests/RunCMake/try_compile/proj/CMakeLists.txt index 78a87c0..652f5b6 100644 --- a/Tests/RunCMake/try_compile/proj/CMakeLists.txt +++ b/Tests/RunCMake/try_compile/proj/CMakeLists.txt @@ -1,2 +1,2 @@ -cmake_minimum_required(VERSION 2.8.10) +cmake_minimum_required(VERSION 3.3) project(TestProject NONE) diff --git a/Tests/RunCMake/try_run/CMakeLists.txt b/Tests/RunCMake/try_run/CMakeLists.txt index e034780..e93f0b6 100644 --- a/Tests/RunCMake/try_run/CMakeLists.txt +++ b/Tests/RunCMake/try_run/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.0) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} C) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/variable_watch/CMakeLists.txt b/Tests/RunCMake/variable_watch/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/variable_watch/CMakeLists.txt +++ b/Tests/RunCMake/variable_watch/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/while/CMakeLists.txt b/Tests/RunCMake/while/CMakeLists.txt index 12cd3c7..74b3ff8 100644 --- a/Tests/RunCMake/while/CMakeLists.txt +++ b/Tests/RunCMake/while/CMakeLists.txt @@ -1,3 +1,3 @@ -cmake_minimum_required(VERSION 2.8.4) +cmake_minimum_required(VERSION 3.3) project(${RunCMake_TEST} NONE) include(${RunCMake_TEST}.cmake) diff --git a/Tests/SetLang/CMakeLists.txt b/Tests/SetLang/CMakeLists.txt index f24e5cb..af90f11 100644 --- a/Tests/SetLang/CMakeLists.txt +++ b/Tests/SetLang/CMakeLists.txt @@ -8,3 +8,10 @@ add_executable(SetLang bar.c) set_source_files_properties(foo.c bar.c PROPERTIES LANGUAGE CXX) target_link_libraries(SetLang foo) set_target_properties(SetLang PROPERTIES LINKER_LANGUAGE CXX) + +if((CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang|MSVC|Borland|Embarcadero|Intel|TI|XL)")) + add_library(zoom zoom.zzz) + set_source_files_properties(zoom.zzz PROPERTIES LANGUAGE CXX) + target_link_libraries(SetLang zoom) + target_compile_definitions(SetLang PRIVATE WITH_ZOOM) +endif() diff --git a/Tests/SetLang/bar.c b/Tests/SetLang/bar.c index b934356..515e8c2 100644 --- a/Tests/SetLang/bar.c +++ b/Tests/SetLang/bar.c @@ -1,10 +1,22 @@ #include <stdio.h> int foo(); + +#ifdef WITH_ZOOM +int zoom(); +#endif + class A { public: - A() { this->i = foo(); } + A() + { + this->i = foo(); +#ifdef WITH_ZOOM + i += zoom(); + i -= zoom(); +#endif + } int i; }; diff --git a/Tests/SetLang/zoom.zzz b/Tests/SetLang/zoom.zzz new file mode 100644 index 0000000..a0c8899 --- /dev/null +++ b/Tests/SetLang/zoom.zzz @@ -0,0 +1,7 @@ +int zoom() +{ + int r = 10; + r++; + int ret = r + 10; + return ret; +} diff --git a/Tests/VSNsightTegra/AndroidManifest.xml b/Tests/VSAndroid/AndroidManifest.xml index 951e8f3..951e8f3 100644 --- a/Tests/VSNsightTegra/AndroidManifest.xml +++ b/Tests/VSAndroid/AndroidManifest.xml diff --git a/Tests/VSNsightTegra/CMakeLists.txt b/Tests/VSAndroid/CMakeLists.txt index 6d74f2f..73b1e07 100644 --- a/Tests/VSNsightTegra/CMakeLists.txt +++ b/Tests/VSAndroid/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.3) -project(VSNsightTegra C CXX) +project(VSAndroid C CXX) set(CMAKE_ANDROID_ARCH armv7-a) set(CMAKE_ANDROID_STL_TYPE stlport_shared) diff --git a/Tests/VSNsightTegra/build.xml b/Tests/VSAndroid/build.xml index 17a2cc0..17a2cc0 100644 --- a/Tests/VSNsightTegra/build.xml +++ b/Tests/VSAndroid/build.xml diff --git a/Tests/VSNsightTegra/jni/first.c b/Tests/VSAndroid/jni/first.c index b9dee27..b9dee27 100644 --- a/Tests/VSNsightTegra/jni/first.c +++ b/Tests/VSAndroid/jni/first.c diff --git a/Tests/VSNsightTegra/jni/first.h b/Tests/VSAndroid/jni/first.h index 9dfd8b8..9dfd8b8 100644 --- a/Tests/VSNsightTegra/jni/first.h +++ b/Tests/VSAndroid/jni/first.h diff --git a/Tests/VSNsightTegra/jni/second.c b/Tests/VSAndroid/jni/second.c index 30bdc17..30bdc17 100644 --- a/Tests/VSNsightTegra/jni/second.c +++ b/Tests/VSAndroid/jni/second.c diff --git a/Tests/VSNsightTegra/proguard-android.txt b/Tests/VSAndroid/proguard-android.txt index fe73bae..fe73bae 100644 --- a/Tests/VSNsightTegra/proguard-android.txt +++ b/Tests/VSAndroid/proguard-android.txt diff --git a/Tests/VSNsightTegra/res/values/strings.xml b/Tests/VSAndroid/res/values/strings.xml index 858cdb4..858cdb4 100644 --- a/Tests/VSNsightTegra/res/values/strings.xml +++ b/Tests/VSAndroid/res/values/strings.xml diff --git a/Tests/VSNsightTegra/src/com/example/twolibs/TwoLibs.java b/Tests/VSAndroid/src/com/example/twolibs/TwoLibs.java index ef9da01..ef9da01 100644 --- a/Tests/VSNsightTegra/src/com/example/twolibs/TwoLibs.java +++ b/Tests/VSAndroid/src/com/example/twolibs/TwoLibs.java diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt index 558d5de..56e4c1d 100644 --- a/Tests/VSWinStorePhone/CMakeLists.txt +++ b/Tests/VSWinStorePhone/CMakeLists.txt @@ -114,7 +114,7 @@ set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "Assets") set_property(SOURCE ${STRING_FILES} PROPERTY VS_TOOL_OVERRIDE "PRIResource") set_property(SOURCE ${DEBUG_CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT $<CONFIG:Debug>) set_property(SOURCE ${RELEASE_CONTENT_FILES} PROPERTY - VS_DEPLOYMENT_CONTENT $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>,$<CONFIG:MinSizeRel>>) + VS_DEPLOYMENT_CONTENT $<CONFIG:Release,RelWithDebInfo,MinSizeRel>) set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_TYPE Pixel) set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainPS) diff --git a/Utilities/Sphinx/CTestConfig.cmake b/Utilities/Sphinx/CTestConfig.cmake index 9607e38..e5f4260 100644 --- a/Utilities/Sphinx/CTestConfig.cmake +++ b/Utilities/Sphinx/CTestConfig.cmake @@ -6,7 +6,9 @@ set(CTEST_PROJECT_NAME "CMake") set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC") -set(CTEST_DROP_METHOD "http") +if(NOT CTEST_DROP_METHOD STREQUAL "https") + set(CTEST_DROP_METHOD "http") +endif() set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=CMake") set(CTEST_DROP_SITE_CDASH TRUE) |