CMake issueshttps://gitlab.kitware.com/cmake/cmake/-/issues2023-11-30T09:03:55-05:00https://gitlab.kitware.com/cmake/cmake/-/issues/25446ccmake segfault on generation2023-11-30T09:03:55-05:00Mathieu Westphal (Kitware)ccmake segfault on generation`ccmake` segfault on generation of a specific project.
`cmake` does not segfault.
Steps to reproduce:
- install VTK
-
```
git clone https://github.com/f3d-app/f3d
cd f3d
mkdir build
cd build
ccmake ../
c
c
g
```
- segfault
It happe...`ccmake` segfault on generation of a specific project.
`cmake` does not segfault.
Steps to reproduce:
- install VTK
-
```
git clone https://github.com/f3d-app/f3d
cd f3d
mkdir build
cd build
ccmake ../
c
c
g
```
- segfault
It happens in cmGeneratorTarget::IsImported(), because this->Target is **nullptr**.3.28.0Ben BoeckelBen Boeckelhttps://gitlab.kitware.com/cmake/cmake/-/issues/25187cmake-gui: The text is too small2023-09-08T09:13:51-04:00dou fucmake-gui: The text is too smallMy Win11 system is configured with different dpi monitors(with scale 100% and 150), when dragging *cmake-gui* from one monitor to another, the text may become too small.
- normal:
![Snipaste_2023-08-15_11-12-16](/uploads/05ffe8756fc471...My Win11 system is configured with different dpi monitors(with scale 100% and 150), when dragging *cmake-gui* from one monitor to another, the text may become too small.
- normal:
![Snipaste_2023-08-15_11-12-16](/uploads/05ffe8756fc471a08e89ad5169eb8f31/Snipaste_2023-08-15_11-12-16.png)
- abnormal
![Snipaste_2023-08-15_11-12-36](/uploads/f0eac3660c3acd9005a930aba113f101/Snipaste_2023-08-15_11-12-36.png)3.28.0https://gitlab.kitware.com/cmake/cmake/-/issues/24248cmake-gui: Lots of runtime warnings while typing a regex with parentheses in ...2022-12-17T08:45:39-05:00Igor Kushnircmake-gui: Lots of runtime warnings while typing a regex with parentheses in the Search barWhen I enter an opening parenthesis into *cmake-gui*'s Search bar, it outputs hundreds? of identical warnings:
> QString(View)::contains(): called on an invalid QRegularExpression object (pattern is '(')
Probably can be fixed by checkin...When I enter an opening parenthesis into *cmake-gui*'s Search bar, it outputs hundreds? of identical warnings:
> QString(View)::contains(): called on an invalid QRegularExpression object (pattern is '(')
Probably can be fixed by checking `QRegularExpression::isValid()` and not calling `setFilterRegularExpression` if that returns `false`.3.26.0Kyle EdwardsKyle Edwardshttps://gitlab.kitware.com/cmake/cmake/-/issues/24034CMakePresets "toolchainFile" field ignored in cmake-gui2024-01-08T09:33:08-05:00Tim PattersonCMakePresets "toolchainFile" field ignored in cmake-guiWhen using the cmake-gui, the `CMakePresets.json` file below correctly selects and executes the toolchain file `toolchain.cmake`:
```json
{
"version": 3,
"cmakeMinimumRequired": { "major": 3, "minor": 24, "patch": 0 },
"configureP...When using the cmake-gui, the `CMakePresets.json` file below correctly selects and executes the toolchain file `toolchain.cmake`:
```json
{
"version": 3,
"cmakeMinimumRequired": { "major": 3, "minor": 24, "patch": 0 },
"configurePresets": [
{
"name": "default",
"generator": "Visual Studio 16 2019",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "toolchain.cmake"
},
"toolchainFile": "toolchain.cmake"
}
],
"buildPresets": [
{
"name": "release",
"configurePreset": "default",
"configuration": "Release"
}
]
}
```
This only works because the `CMAKE_TOOLCHAIN_FILE` cache variable is being set. After removing this line from the CMakePresets file, the toolchain file is NOT set despite the fact that the `toolchainFile` field exists; the field appears to be ignored.Robert MaynardRobert Maynardhttps://gitlab.kitware.com/cmake/cmake/-/issues/23965OS X: odd behaviour when selecting "How to install for command line use" from...2022-09-16T11:08:25-04:00Andrew WOS X: odd behaviour when selecting "How to install for command line use" from installed cmake-guiSteps to reproduce:
- download and install CMake (3.24.2) on OS X from .dmg
- run app (from Applications)
- choose "How to install for command line use"
- copy and execute command for "install symlinks to /usr/local/bin"
- quit CMake app...Steps to reproduce:
- download and install CMake (3.24.2) on OS X from .dmg
- run app (from Applications)
- choose "How to install for command line use"
- copy and execute command for "install symlinks to /usr/local/bin"
- quit CMake app
- from terminal, run "cmake-gui"
- GUI app starts
- choose "How to install for command line use"
Expected behaviour:
- same paths as last time
Actual behaviour
- source paths are now all /usr/local/bin (which if you ran the command again means you would replace the symlinks in /usr/local/bin with symlinks to the symlinks)
Impact: Minor, unless someone actually follows the instructions, in which case it breaks the install
Recommended behaviour: resolve symlinks and present the original file pathhttps://gitlab.kitware.com/cmake/cmake/-/issues/23859cmake-gui: buggy when compiled by MSVC 14.33 / VS 17.3 toolset2022-11-11T08:29:16-05:00Brad Kingcmake-gui: buggy when compiled by MSVC 14.33 / VS 17.3 toolsetAfter !7578 updated our CI to the MSVC 14.33 toolset (from VS 17.3), the `cmake-gui` built by our nightly packaging pipeline (published [here](https://cmake.org/files/dev/?C=M;O=D)), no longer works reliably. Configuring randomly fails ...After !7578 updated our CI to the MSVC 14.33 toolset (from VS 17.3), the `cmake-gui` built by our nightly packaging pipeline (published [here](https://cmake.org/files/dev/?C=M;O=D)), no longer works reliably. Configuring randomly fails with various unrepeatable errors in processing the `.cmake` language code. I've built several different versions of CMake in CI pipelines with MSVC 14.32 and 14.33 toolsets, and the distinction between the two MSVC versions is repeatable.
I suspect that the MSVC 14.33 toolset may be miscompiling Qt code in `cmake-gui` in a way that clobbers memory elsewhere in the process.3.25.0Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/23565cmake-gui: Fix non-ASCII characters on Windows with Qt62022-06-11T05:52:20-04:00Brad Kingcmake-gui: Fix non-ASCII characters on Windows with Qt6When built with Qt6, `cmake-gui` does not support non-ASCII characters on Windows.
See #23562 and https://gitlab.kitware.com/cmake/cmake/-/issues/23562#note_1193534.When built with Qt6, `cmake-gui` does not support non-ASCII characters on Windows.
See #23562 and https://gitlab.kitware.com/cmake/cmake/-/issues/23562#note_1193534.3.24.0https://gitlab.kitware.com/cmake/cmake/-/issues/23562cmake-gui: no longer opens paths with non-ASCII characters (ñ) on windows 102022-06-02T11:52:13-04:00Alberto Luacescmake-gui: no longer opens paths with non-ASCII characters (ñ) on windows 10This was working correctly in 3.18.4, but updating to 3.23.2 makes project configuration fail with
> CMake Error: The source directory "E:/alberto/tests/cmake espacios y e�es" does not exist.
Replacing the troubling directory name with...This was working correctly in 3.18.4, but updating to 3.23.2 makes project configuration fail with
> CMake Error: The source directory "E:/alberto/tests/cmake espacios y e�es" does not exist.
Replacing the troubling directory name with its short counterpart `cmakee~1` works, and cmake expands it again with a garbled result, `cmake espacios y eñes`, so I suspect is an issue of a latin-1 to utf-8 conversion.3.21.7Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/22721cmake-gui: Qt 6.2 bootstrap script failure2022-06-08T08:01:21-04:00Andrew Macleancmake-gui: Qt 6.2 bootstrap script failureDownload cmake-3.21.3.tar.gz and ran ./bootstrap. Then built OK. However when setting `BUILD_QtDialog:BOOL=ON` the build fails:
``` bash
CMake Error at /home/amaclean/Qt/6.2.0/gcc_64/lib/cmake/Qt6/QtPublicTargetHelpers.cmake:298 (cmake_...Download cmake-3.21.3.tar.gz and ran ./bootstrap. Then built OK. However when setting `BUILD_QtDialog:BOOL=ON` the build fails:
``` bash
CMake Error at /home/amaclean/Qt/6.2.0/gcc_64/lib/cmake/Qt6/QtPublicTargetHelpers.cmake:298 (cmake_language):
Unknown CMake command "cmake_language".
Call Stack (most recent call first):
/home/amaclean/Qt/6.2.0/gcc_64/lib/cmake/Qt6/Qt6Config.cmake:242 (__qt_internal_defer_promote_targets_in_dir_scope_to_global)
Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
/home/amaclean/Qt/6.2.0/gcc_64/lib/cmake/Qt6Widgets/Qt6WidgetsDependencies.cmake:8 (find_dependency)
/home/amaclean/Qt/6.2.0/gcc_64/lib/cmake/Qt6Widgets/Qt6WidgetsConfig.cmake:40 (include)
Source/QtDialog/CMakeLists.txt:23 (find_package)
```
There are no problems building cmake-gui from the CMake sources. This makes me think it is a configuration issue related to bootstrapping.3.21.4Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/22188ci: add testing with Qt 62021-10-08T10:07:36-04:00Brad Kingci: add testing with Qt 6Since !6117 our CI base images for Fedora have Qt 6 packages. We should update the Fedora CI jobs to cover Qt 6:
* Build cmake-gui with `CMake_QT_MAJOR_VERSION=6`.
* Add `Qt6Autogen` tests and enable them with a `CMake_TEST_Qt6` option...Since !6117 our CI base images for Fedora have Qt 6 packages. We should update the Fedora CI jobs to cover Qt 6:
* Build cmake-gui with `CMake_QT_MAJOR_VERSION=6`.
* Add `Qt6Autogen` tests and enable them with a `CMake_TEST_Qt6` option.
* Keep `Qt5Autogen` tests enabled with `CMake_TEST_Qt5`.
Currently turning on `BUILD_QtDialog=ON/CMake_QT_MAJOR_VERSION=6` and `CMake_TEST_Qt5=ON` together produces CMake configure errors.Craig ScottCraig Scotthttps://gitlab.kitware.com/cmake/cmake/-/issues/21884cmake-gui: Search bar no longer case-insensitive (3.20.0-rc3)2021-03-05T08:25:35-05:00Brad Kingcmake-gui: Search bar no longer case-insensitive (3.20.0-rc3)The search bar in CMake 3.19 and below was case insensitive. This was regressed by !5621, and not fully fixed by !5845. It is still case sensitive as of 3.20.0-rc3.The search bar in CMake 3.19 and below was case insensitive. This was regressed by !5621, and not fully fixed by !5845. It is still case sensitive as of 3.20.0-rc3.3.20.0Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/21850cmake-gui: Search bar does not work (3.20.0-rc1).2021-03-03T13:57:10-05:00ACDcmake-gui: Search bar does not work (3.20.0-rc1).Search bar does not filter the name-values like it used to. Tested on 64 bit Windows 10.
Please let me know if I can provide more information.Search bar does not filter the name-values like it used to. Tested on 64 bit Windows 10.
Please let me know if I can provide more information.3.20.0https://gitlab.kitware.com/cmake/cmake/-/issues/21682cmake-gui: Add/Remove Entry button icons missing in 3.192021-01-12T10:19:34-05:00Brad Kingcmake-gui: Add/Remove Entry button icons missing in 3.19@craig.scott pointed this out in https://gitlab.kitware.com/cmake/cmake/-/issues/21606#note_881056. It occurs on multiple platforms, so it is not just an effect of the macOS packaging updates.@craig.scott pointed this out in https://gitlab.kitware.com/cmake/cmake/-/issues/21606#note_881056. It occurs on multiple platforms, so it is not just an effect of the macOS packaging updates.3.19.3Kyle EdwardsKyle Edwardshttps://gitlab.kitware.com/cmake/cmake/-/issues/21589cmake-gui: 3.19.1 does not auto-complete source/build tree selection2020-12-17T08:47:32-05:00Brad Kingcmake-gui: 3.19.1 does not auto-complete source/build tree selectionWhile typing in the directory selection boxes in the main gui page, it's supposed to pop up suggested completions one can chose with arrow/enter keys.
This worked in 3.18.5. It doesn't work in 3.19.1.
EDIT: Completion using 3.19.1 wor...While typing in the directory selection boxes in the main gui page, it's supposed to pop up suggested completions one can chose with arrow/enter keys.
This worked in 3.18.5. It doesn't work in 3.19.1.
EDIT: Completion using 3.19.1 works if one types the path from the root, but not if one edits an existing path in the field. Completion using 3.18.5 works for both cases.3.19.2Ben BoeckelBen Boeckelhttps://gitlab.kitware.com/cmake/cmake/-/issues/21580cmake-gui: set_property INSTALL scope not cleared across projects2020-12-14T07:08:54-05:00Steven A Whitecmake-gui: set_property INSTALL scope not cleared across projectsI have noticed sense updating to 3.19.1 that if I use the "Where to build the binaries" drop down to switch between cmake projects then the GUI and underlying cmake will some how run cmake files from the previous project.
For instance ...I have noticed sense updating to 3.19.1 that if I use the "Where to build the binaries" drop down to switch between cmake projects then the GUI and underlying cmake will some how run cmake files from the previous project.
For instance if I build BioGears 7.4.X and then switch to a second project with out closing the GUI and click compile generate I will receive the following errors. The error seem to revolve around Generator statements which refer to TARGET names.
```
CMake Error at D:/remotes/sed-stash/core/projects/cli/CMakeLists.txt:125 (set_property):
Error evaluating generator expression:
$<TARGET_FILE_NAME:bg-cli>
No target "bg-cli"
CMake Error at D:/remotes/sed-stash/core/projects/cli/CMakeLists.txt:79 (set_property):
Error evaluating generator expression:
$<TARGET_FILE_NAME:bg-scenario>
No target "bg-scenario"
```
<details><summary>screenshots</summary>
![image](/uploads/11a7e4729ca669a36adc0278a2191006/image.png)
![image](/uploads/ed83344af14a36345e9832e98c9cab38/image.png)
</details>
I don't have a good feel for what is going on, but if given some direction I can help chase this down.
Recreate:
Configure/Generate in CMakeGUI a project which refers to its own targets using :: notati0n which will be differed until generation. Then switch to a second project and configure/generate it in the same GUI window on WINDOWS 103.19.2Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/21456cmake-gui Multiple Issues and Crashes on Fedora 332020-12-11T16:16:39-05:00Dirk Bartkoskicmake-gui Multiple Issues and Crashes on Fedora 33After recently upgrading to Fedora 33 KDE, the cmake-gui (CMake version 3.18.3, using QT 5.15.1) is exhibiting multiple issues. I have uninstalled and reinstalled it multiple times.
The interface can be seen in the attached image![Screen...After recently upgrading to Fedora 33 KDE, the cmake-gui (CMake version 3.18.3, using QT 5.15.1) is exhibiting multiple issues. I have uninstalled and reinstalled it multiple times.
The interface can be seen in the attached image![Screenshot_20201118_102023](/uploads/3131f58a2b549ba3263a8705ab6f57b5/Screenshot_20201118_102023.png)
In addition the issues with the interface, the Browse Source and Browse Build windows that do not populate the directory trees.
Furthermore, the gui crashes every time the Configure button is pressed.https://gitlab.kitware.com/cmake/cmake/-/issues/21449cmake-gui: environment variables stay defined when switching projects2021-05-25T10:04:09-04:00Deniz Bahadircmake-gui: environment variables stay defined when switching projects## Problem
CMake sets the environment variable `CC` and `CXX` when it finds the C and C++ compiler.
However, `cmake-gui` does not undefine these environment variables again, when cmaking another project (or clearing the cache). It onl...## Problem
CMake sets the environment variable `CC` and `CXX` when it finds the C and C++ compiler.
However, `cmake-gui` does not undefine these environment variables again, when cmaking another project (or clearing the cache). It only sets them to the empty string.
This impacts e.g. the result of `if (DEFINED ENV{CXX})` between runs of different (!) CMake projects.
## Steps to reproduce the problem
You can reproduce the problem quite simply with the following `CMakeLists.txt` file:
```cmake
cmake_minimum_required(VERSION 3.18)
if (DEFINED ENV{CC})
message( STATUS "Before project command: CC env-variable is DEFINED! Value: `$ENV{CC}`" )
else()
message( STATUS "Before project command: CC env-variable is NOT DEFINED!" )
endif()
if (DEFINED ENV{CXX})
message( STATUS "Before project command: CXX env-variable is DEFINED! Value: `$ENV{CXX}`" )
else()
message( STATUS "Before project command: CXX env-variable is NOT DEFINED!" )
endif()
if (DEFINED CMAKE_C_COMPILER)
message( STATUS "Before project command: CMAKE_C_COMPILER variable is DEFINED! Value: `${CMAKE_C_COMPILER}`" )
else()
message( STATUS "Before project command: CMAKE_C_COMPILER variable is NOT DEFINED!" )
endif()
if (DEFINED CMAKE_CXX_COMPILER})
message( STATUS "Before project command: CMAKE_CXX_COMPILER variable is DEFINED! Value: `${CMAKE_CXX_COMPILER}`" )
else()
message( STATUS "Before project command: CMAKE_CXX_COMPILER variable is NOT DEFINED!" )
endif()
if (DEFINED CACHE{CMAKE_C_COMPILER)
message( STATUS "Before project command: CMAKE_C_COMPILER cache variable is DEFINED! Value: `$CACHE{CMAKE_C_COMPILER}`" )
else()
message( STATUS "Before project command: CMAKE_C_COMPILER cache variable is NOT DEFINED!" )
endif()
if (DEFINED CACHE{CMAKE_CXX_COMPILER})
message( STATUS "Before project command: CMAKE_CXX_COMPILER cache variable is DEFINED! Value: `$CACHE{CMAKE_CXX_COMPILER}`" )
else()
message( STATUS "Before project command: CMAKE_CXX_COMPILER cache variable is NOT DEFINED!" )
endif()
project( EnvTest VERSION 3.18.0 )
if (DEFINED ENV{CC})
message( STATUS "After project command: CC env-variable is DEFINED! Value: `$ENV{CC}`" )
else()
message( STATUS "After project command: CC env-variable is NOT DEFINED!" )
endif()
if (DEFINED ENV{CXX})
message( STATUS "After project command: CXX env-variable is DEFINED! Value: `$ENV{CXX}`" )
else()
message( STATUS "After project command: CXX env-variable is NOT DEFINED!" )
endif()
if (DEFINED CMAKE_C_COMPILER)
message( STATUS "After project command: CMAKE_C_COMPILER variable is DEFINED! Value: `${CMAKE_C_COMPILER}`" )
else()
message( STATUS "After project command: CMAKE_C_COMPILER variable is NOT DEFINED!" )
endif()
if (DEFINED CMAKE_CXX_COMPILER})
message( STATUS "After project command: CMAKE_CXX_COMPILER variable is DEFINED! Value: `${CMAKE_CXX_COMPILER}`" )
else()
message( STATUS "After project command: CMAKE_CXX_COMPILER variable is NOT DEFINED!" )
endif()
if (DEFINED CACHE{CMAKE_C_COMPILER)
message( STATUS "After project command: CMAKE_C_COMPILER cache variable is DEFINED! Value: `$CACHE{CMAKE_C_COMPILER}`" )
else()
message( STATUS "After project command: CMAKE_C_COMPILER cache variable is NOT DEFINED!" )
endif()
if (DEFINED CACHE{CMAKE_CXX_COMPILER})
message( STATUS "After project command: CMAKE_CXX_COMPILER cache variable is DEFINED! Value: `$CACHE{CMAKE_CXX_COMPILER}`" )
else()
message( STATUS "After project command: CMAKE_CXX_COMPILER cache variable is NOT DEFINED!" )
endif()
```
Just run `cmake-gui`, cmake this `CMakeLists.txt` file into one directory `/tmp/build1`, and afterwards into a directory `/tmp/build2`. You will notice a difference in the output.
### Example output
Output for `/tmp/build1`:
```
Before project command: CC env-variable is NOT DEFINED!
Before project command: CXX env-variable is NOT DEFINED!
Before project command: CMAKE_C_COMPILER variable is NOT DEFINED!
Before project command: CMAKE_CXX_COMPILER variable is NOT DEFINED!
Before project command: CMAKE_C_COMPILER cache variable is NOT DEFINED!
Before project command: CMAKE_CXX_COMPILER cache variable is NOT DEFINED!
The C compiler identification is GNU 9.3.0
The CXX compiler identification is GNU 9.3.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: /usr/bin/cc - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: /usr/bin/c++ - skipped
Detecting CXX compile features
Detecting CXX compile features - done
After project command: CC env-variable is DEFINED! Value: `/usr/bin/cc`
After project command: CXX env-variable is DEFINED! Value: `/usr/bin/c++`
After project command: CMAKE_C_COMPILER variable is DEFINED! Value: `/usr/bin/cc`
After project command: CMAKE_CXX_COMPILER variable is NOT DEFINED!
After project command: CMAKE_C_COMPILER cache variable is NOT DEFINED!
After project command: CMAKE_CXX_COMPILER cache variable is DEFINED! Value: `/usr/bin/c++`
Configuring done
```
Output for `/tmp/build2`:
```
Before project command: CC env-variable is DEFINED! Value: ``
Before project command: CXX env-variable is DEFINED! Value: ``
Before project command: CMAKE_C_COMPILER variable is NOT DEFINED!
Before project command: CMAKE_CXX_COMPILER variable is NOT DEFINED!
Before project command: CMAKE_C_COMPILER cache variable is NOT DEFINED!
Before project command: CMAKE_CXX_COMPILER cache variable is NOT DEFINED!
The C compiler identification is GNU 9.3.0
The CXX compiler identification is GNU 9.3.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: /usr/bin/cc - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: /usr/bin/c++ - skipped
Detecting CXX compile features
Detecting CXX compile features - done
After project command: CC env-variable is DEFINED! Value: `/usr/bin/cc`
After project command: CXX env-variable is DEFINED! Value: `/usr/bin/c++`
After project command: CMAKE_C_COMPILER variable is DEFINED! Value: `/usr/bin/cc`
After project command: CMAKE_CXX_COMPILER variable is NOT DEFINED!
After project command: CMAKE_C_COMPILER cache variable is NOT DEFINED!
After project command: CMAKE_CXX_COMPILER cache variable is DEFINED! Value: `/usr/bin/c++`
Configuring done
```
These two outputs differ in the first two lines:
```diff
--- Output of /tmp/build1
+++ Output of /tmp/build2
@@ -1,5 +1,5 @@
-Before project command: CC env-variable is NOT DEFINED!
-Before project command: CXX env-variable is NOT DEFINED!
+Before project command: CC env-variable is DEFINED! Value: ``
+Before project command: CXX env-variable is DEFINED! Value: ``
Before project command: CMAKE_C_COMPILER variable is NOT DEFINED!
Before project command: CMAKE_CXX_COMPILER variable is NOT DEFINED!
Before project command: CMAKE_C_COMPILER cache variable is NOT DEFINED!
```
## Analysis
CMake sets the environment-variables `CC` and `CXX` but `cmake-gui` seems to be unable to unset and undefine them if cmaking another directory.
CMake sets the environment variables `CC` and `CXX` when it searches for (and finds) the C and C++ compiler, if the user did not specify them explicitly (by proving values for `CMAKE_C_COMPILER` and `CMAKE_CXX_COMPILER`). This is triggered when CMake encounters the `project` or `enable_language` command.
However, `cmake-gui` is not properly undefining these environment variables again when clearing the CMake cache (by clicking on `File --> Delete Cache` in the menu entry of `cmake-gui`) or when configuring into another build-directory or an entirely different project.
---
As you might have noticed, the above example `CMakeLists.txt` file demonstrates another inconsistency (which also occurs with `cmake` or `ccmake`). The `CMAKE_CXX_COMPILER` variable will be set as CMake cache variable, while the `CMAKE_C_COMPILER` variable will just be set as plain CMake variable.https://gitlab.kitware.com/cmake/cmake/-/issues/21400cmake-gui crashes when browsing for file2020-11-06T07:57:57-05:00Maartencmake-gui crashes when browsing for fileWhen browsing for a file/directory in cmake-gui the application crashes.
Using `Browse Source...` or `Browse Build...` works fine, but when using the `…` button in the list control (entries with a `PATH` or `FILEPATH` type), the Windows...When browsing for a file/directory in cmake-gui the application crashes.
Using `Browse Source...` or `Browse Build...` works fine, but when using the `…` button in the list control (entries with a `PATH` or `FILEPATH` type), the Windows file browser opens and then the application crashes.
Versions that crash are `3.19.0-rc1`, `3.19.0-rc2` and `cmake-3.19.20201104-g227cc60-win64-x64.zip`. Window 10 64 bit.
CMake 3.18 works fine.3.19.0Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/20981cmake-gui: crashes with Qt 5.152020-07-27T08:36:00-04:00Alexander Shirokovcmake-gui: crashes with Qt 5.15cmake-gui crashes after calling it.
**Example**:
```
cmake-gui .
[1] 56767 segmentation fault (core dumped) cmake-gui .
```
```
cmake-gui
[1] 58131 segmentation fault (core dumped) cmake-gui
```
**Backtrace**:
```
Thread 1 "...cmake-gui crashes after calling it.
**Example**:
```
cmake-gui .
[1] 56767 segmentation fault (core dumped) cmake-gui .
```
```
cmake-gui
[1] 58131 segmentation fault (core dumped) cmake-gui
```
**Backtrace**:
```
Thread 1 "cmake-gui" received signal SIGSEGV, Segmentation fault.
0x00007ffff6ba06c4 in qHash(QString const&, unsigned int) ()
from /usr/lib/libQt5Core.so.5
(gdb) bt
#0 0x00007ffff6ba06c4 in qHash(QString const&, unsigned int) ()
at /usr/lib/libQt5Core.so.5
#1 0x00005555556362a1 in QCMakeCacheModel::setProperties(QList<QCMakeProperty> const&)
()
#2 0x0000555555638b62 in QCMakeCacheModel::setViewType(QCMakeCacheModel::ViewType) ()
#3 0x000055555561576e in CMakeSetupDialog::setGroupedView(bool) ()
#4 0x0000555555616077 in CMakeSetupDialog::CMakeSetupDialog() ()
#5 0x0000555555607b84 in main ()
```
**Workaround**
This dirty modification fixes the trouble
```
--- a/Source/QtDialog/QCMakeCacheView.cxx 2020-07-15 14:19:20.000000000 +0300
+++ b/Source/QtDialog/QCMakeCacheView.cxx 2020-07-17 22:55:04.558439571 +0300
@@ -217,27 +217,27 @@
QSet<QCMakeProperty> newProps2;
if (this->ShowNewProperties) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+//#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
newProps = props.toSet();
-#else
- newProps = QSet<QCMakeProperty>(props.begin(), props.end());
-#endif
+//#else
+// newProps = QSet<QCMakeProperty>(props.begin(), props.end());
+//#endif
newProps2 = newProps;
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+//#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
QSet<QCMakeProperty> oldProps = this->properties().toSet();
-#else
- QSet<QCMakeProperty> oldProps = QSet<QCMakeProperty>(
- this->properties().begin(), this->properties().end());
-#endif
+//#else
+// QSet<QCMakeProperty> oldProps = QSet<QCMakeProperty>(
+// this->properties().begin(), this->properties().end());
+//#endif
oldProps.intersect(newProps);
newProps.subtract(oldProps);
newProps2.subtract(newProps);
} else {
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+//#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
newProps2 = props.toSet();
-#else
- newProps2 = QSet<QCMakeProperty>(props.begin(), props.end());
-#endif
+//#else
+// newProps2 = QSet<QCMakeProperty>(props.begin(), props.end());
+//#endif
}
bool b = this->blockSignals(true);
```
**System info**:
OS: ArchLinux
qt5-base : 5.15.0
cmake : 3.18.0
Please let me know if any additional information needed, and thank you for your time!3.18.1Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/20251cmake-gui: CMAKE_GENERATOR_PLATFORM environment variable isn't respected2020-02-07T10:37:39-05:00Code Smithcmake-gui: CMAKE_GENERATOR_PLATFORM environment variable isn't respectedI've got a project that needs to be built with MSVC 2017 x64. I've set the CMAKE_GENERATOR environment variable to "Visual Studio 15 2017", and CMAKE_GENERATOR_PLATFORM to "x64". On the command line, this is sufficient to get the correct...I've got a project that needs to be built with MSVC 2017 x64. I've set the CMAKE_GENERATOR environment variable to "Visual Studio 15 2017", and CMAKE_GENERATOR_PLATFORM to "x64". On the command line, this is sufficient to get the correct generator and platform. With cmake gui, the generator again defaults to "Visual Studio 15 2017" (which is nice given that I've got 2019 installed as well, so that seems to work), but the architecture still defaults to blank, resulting in Win32 getting used.
I think the simplest fix would be to just default that dropdown to the entry that matches CMAKE_GENERATOR_PLATFORM (if available/valid), and blank otherwise. If that works for you guys, I can probably fix this myself and open a PR.