Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting the App's window class name via CMake #2394

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gamagan
Copy link

@gamagan gamagan commented Sep 11, 2023

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.

Allow setting the App's window class name via the CMake command line:
    cmake . -DGLFW_WNDCLASSNAME="MyWindowClassName"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant