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 installed directory structure on Windows #5686

Merged
merged 3 commits into from
Dec 22, 2023

Conversation

Web-eWorks
Copy link
Member

During the last major change to CMake I accidentally broke the install structure on Windows. This PR resolves that and should make the installation behavior on Windows systems more robust and easier to understand.

I've also included a potential fix for MSVC doing strange things with unicode character escape sequences in C string literals by explicitly specifying that we want the UTF-8 encoding of the unicode character.

CC @nozmajner @pcercuei to give this a test on Windows if able.

- Don't use GNUInstallDirs on a non-unix system
- Default to installing binaries + data together in the same folder
This may resolve some issues where MSVC is generating UTF-16 or other non UTF-8 bitpatterns to encode these characters
@pcercuei
Copy link
Contributor

What I see if that you have a install() in the top CMake script, why isn't it in the cmake/InstallPioneer.cmake, below the spot where CMAKE_INSTALL_BINDIR is overriden?

@bszlrd
Copy link
Contributor

bszlrd commented Dec 22, 2023

@Web-eWorks
The binaries are now put in their proper place, but the data is in a pioneer directory:
image
I've tried this artifact: https:/pioneerspacesim/pioneer/actions/runs/7293314137

@Web-eWorks
Copy link
Member Author

That should also be fixed now.

@bszlrd
Copy link
Contributor

bszlrd commented Dec 22, 2023

Confirmed, it works properly now.

@Web-eWorks Web-eWorks merged commit b18e985 into pioneerspacesim:master Dec 22, 2023
5 checks passed
@Web-eWorks
Copy link
Member Author

What I see if that you have a install() in the top CMake script, why isn't it in the cmake/InstallPioneer.cmake, below the spot where CMAKE_INSTALL_BINDIR is overriden?

Replying after the fact, but essentially the InstallPioneer script is intended to setup installation directories at the start of the CMakeFile, but the install statements cannot be effectively used until the targets they're installing are defined. I'd welcome a PR to further reorganize and deduplicate the CMakeLists.txt file, but at this time I'm not going to make any major changes not required to restore existing functionality.

@Web-eWorks Web-eWorks deleted the windows-install-dirs branch January 7, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installer createws wrong directory structure on windows
3 participants