diff options
-rw-r--r-- | Help/manual/cmake-presets.7.rst | 4 | ||||
-rw-r--r-- | Help/manual/presets/example.json | 11 | ||||
-rw-r--r-- | Modules/UseSWIG.cmake | 3 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmSystemTools.cxx | 9 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresets/DocumentationExampleListAllPresets-stdout.txt | 18 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresets/RunCMakeTest.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresetsPackage/ListPresets-package-x-stdout.txt | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresetsPackage/ListPresets.cmake | 0 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresetsPackage/ListPresets.json.in | 20 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresetsPackage/RunCMakeTest.cmake | 1 |
11 files changed, 71 insertions, 2 deletions
diff --git a/Help/manual/cmake-presets.7.rst b/Help/manual/cmake-presets.7.rst index d7acbef..d5319f2 100644 --- a/Help/manual/cmake-presets.7.rst +++ b/Help/manual/cmake-presets.7.rst @@ -102,6 +102,10 @@ The root object recognizes the following fields: An optional array of `Test Preset`_ objects. This is allowed in preset files specifying version ``2`` or above. +``packagePresets`` + An optional array of `Package Preset`_ objects. + This is allowed in preset files specifying version ``6`` or above. + Includes ^^^^^^^^ diff --git a/Help/manual/presets/example.json b/Help/manual/presets/example.json index be5c791..06a1112 100644 --- a/Help/manual/presets/example.json +++ b/Help/manual/presets/example.json @@ -1,5 +1,5 @@ { - "version": 5, + "version": 6, "cmakeMinimumRequired": { "major": 3, "minor": 23, @@ -66,6 +66,15 @@ "execution": {"noTestsAction": "error", "stopOnFailure": true} } ], + "packagePresets": [ + { + "name": "default", + "configurePreset": "default", + "generators": [ + "TGZ" + ] + } + ], "vendor": { "example.com/ExampleIDE/1.0": { "autoFormat": false diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index 5b653ad..fd6596b 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -990,6 +990,9 @@ function(SWIG_ADD_LIBRARY name) endif() set_target_properties (${target_name} PROPERTIES PREFIX "") endif() + if (APPLE) + set_target_properties (${target_name} PROPERTIES SUFFIX ".dylib") + endif () else() # assume empty prefix because we expect the module to be dynamically loaded set_target_properties (${target_name} PROPERTIES PREFIX "") diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 13c69c8..f154945 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,7 +1,7 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 24) -set(CMake_VERSION_PATCH 20220923) +set(CMake_VERSION_PATCH 20220926) #set(CMake_VERSION_RC 0) set(CMake_VERSION_IS_DIRTY 0) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 8e77afa..5737cc1 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1642,9 +1642,18 @@ std::vector<std::string> cmSystemTools::GetEnvironmentVariables() { std::vector<std::string> env; int cc; +# ifdef _WIN32 + // if program starts with main, _wenviron is initially NULL, call to + // _wgetenv and create wide-character string environment + _wgetenv(L""); + for (cc = 0; _wenviron[cc]; ++cc) { + env.emplace_back(cmsys::Encoding::ToNarrow(_wenviron[cc])); + } +# else for (cc = 0; environ[cc]; ++cc) { env.emplace_back(environ[cc]); } +# endif return env; } diff --git a/Tests/RunCMake/CMakePresets/DocumentationExampleListAllPresets-stdout.txt b/Tests/RunCMake/CMakePresets/DocumentationExampleListAllPresets-stdout.txt new file mode 100644 index 0000000..b1fcc28 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/DocumentationExampleListAllPresets-stdout.txt @@ -0,0 +1,18 @@ +^Not searching for unused variables given on the command line\. +Available configure presets: + + "default" ?- Default Config + "ninja-multi" ?- Ninja Multi-Config( + "windows-only" - Windows-only configuration)? + +Available build presets: + + "default" + +Available test presets: + + "default" + +Available package presets: + + "default"$ diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake index 4f57e2f..efa838e 100644 --- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake @@ -408,4 +408,5 @@ set(CMakePresets_EXTRA_FILES "${RunCMake_SOURCE_DIR}/moreThings.json.in" ) run_cmake_presets(DocumentationExample --preset=default) +run_cmake_presets(DocumentationExampleListAllPresets --list-presets=all) unset(CMakePresets_EXTRA_FILES) diff --git a/Tests/RunCMake/CMakePresetsPackage/ListPresets-package-x-stdout.txt b/Tests/RunCMake/CMakePresetsPackage/ListPresets-package-x-stdout.txt new file mode 100644 index 0000000..307ec0a --- /dev/null +++ b/Tests/RunCMake/CMakePresetsPackage/ListPresets-package-x-stdout.txt @@ -0,0 +1,4 @@ +^Available package presets: + + "default" + "with-description" - With Description$ diff --git a/Tests/RunCMake/CMakePresetsPackage/ListPresets.cmake b/Tests/RunCMake/CMakePresetsPackage/ListPresets.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsPackage/ListPresets.cmake diff --git a/Tests/RunCMake/CMakePresetsPackage/ListPresets.json.in b/Tests/RunCMake/CMakePresetsPackage/ListPresets.json.in new file mode 100644 index 0000000..5f3cf48 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsPackage/ListPresets.json.in @@ -0,0 +1,20 @@ +{ + "version": 6, + "configurePresets": [ + { + "name": "default" + } + ], + "packagePresets": [ + { + "name": "default", + "configurePreset": "default" + }, + { + "name": "with-description", + "displayName": "With Description", + "description": "This preset has a description", + "configurePreset": "default" + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsPackage/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsPackage/RunCMakeTest.cmake index 0d5def1..269fb6e 100644 --- a/Tests/RunCMake/CMakePresetsPackage/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresetsPackage/RunCMakeTest.cmake @@ -99,3 +99,4 @@ endfunction() run_cmake_package_presets(UnsupportedVersion "x" "" "") run_cmake_package_presets(Good "default" "build-default-debug" "no-environment;with-environment;generators;configurations;variables;config-file;debug;verbose;package-name;package-version;package-directory;vendor-name") +run_cmake_package_presets(ListPresets "default" "" "x" "--list-presets") |