Allow setting the App's window class name via CMake #2394
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow setting the App's window class name via the CMake command line:
cmake . -DGLFW_WNDCLASSNAME="MyWindowClassName"
In Windows, it's important to be able to compile an application with an unique Window Class Name (WCN). A WCN can be used to, programmatically, locate an App at runtime. This allows 2 running apps to locate each other at runtime, and then send messages back and forth to each other via the native Windows RPC functionality.
By default, GLFW sets the WCN to "GLFW30". That value is set in file
win32_window.c
, at around line 1271. There is already code to use the #define named_GLFW_WNDCLASSNAME
to set the WCN. However, setting that #define is not currently possible via CMake.This patch allows setting the value of the existing define
_GLFW_WNDCLASSNAME
from CMake.Additionally, this opens up the possibility of setting that value via
vcpkg
ports functionality.