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

Add version resource to Windows shared library DLL #6487

Open
ahuj9 opened this issue May 18, 2024 · 3 comments
Open

Add version resource to Windows shared library DLL #6487

ahuj9 opened this issue May 18, 2024 · 3 comments

Comments

@ahuj9
Copy link

ahuj9 commented May 18, 2024

Description

Open62541 when built as a shared library on Windows could use a version resource .rc file configured from ${OPEN62541_VER_X} CMake variables.

@jpfr
Copy link
Member

jpfr commented May 19, 2024

Sounds good. Where should this be installed?

@irostagno
Copy link
Contributor

The easy way is to add this, this and this to tools/cmake. Then in the CMakeLists.txt you should add:

generate_product_version(
    open62541_resource_version
    NAME "open62541"
    VERSION_MAJOR ${OPEN62541_VER_MAJOR}
    VERSION_MINOR $OPEN62541_VER_MINOR}
    VERSION_PATCH ${OPEN62541_VER_PATCH}
    VERSION_REVISION ${OPEN62541_VER_LABEL}
)

This generates variable open62541_resource_version to add into the add_library command:

add_library(open62541 ... ${open62541_resource_version})

For Windows, metadata is embedded into the DLL, so, no installation is needed.

@OgreTransporter
Copy link
Contributor

It is not necessary to make it so complicated with macros and different files. A simple template and configure_file is completely sufficient.

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

No branches or pull requests

4 participants