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

Fix installation in Windows #36

Closed
wants to merge 5 commits into from
Closed

Conversation

davidegorbani
Copy link
Collaborator

In the CMakeLists.txt I added an if statement to check if the operating system that is installing the project is Windows and if it is the flag BUILD_SHARED_LIBS is set to OFF.

CC @dariosortino

@traversaro
Copy link
Contributor

It would be great if in the long term we fixed BUILD_SHARED_LIBS=ON on Windows. In theory it should be sufficient to have

# To build shared libraries in Windows, we set CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS to TRUE.
# See https://cmake.org/cmake/help/v3.4/variable/CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS.html
# See https://blog.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
, but probably something is not working as expected. Can we at least open an issue in which you copy&paste the problem with BUILD_SHARED_LIBS=ON?

@davidegorbani
Copy link
Collaborator Author

Can we at least open an issue in which you copy&paste the problem with BUILD_SHARED_LIBS=ON?

Yes, we opened #37.

@davidegorbani
Copy link
Collaborator Author

I rebased the branch and now the Windows CI is failing due to the ResolveRoboticsURICpp library.

@traversaro
Copy link
Contributor

That is because for static libraries private dependencies are promoted to public dependencies (as in general if B.a links A.a, to create an executable that links B.a you also need to link A.a, while if B.so links A.so you only need to link B.so).

This is not a problem for header-only library, but CMake does not know this. See robotology/idyntree#1065 for a description of this.

@davidegorbani
Copy link
Collaborator Author

I would close this PR and not merge it since we found a solution to install the examples on Windows (see #37 (comment)).

@davidegorbani davidegorbani deleted the fix-windows-installation branch June 26, 2024 09:42
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.

3 participants