X Tutup
Skip to content

Fix installed directory structure on Windows#5686

Merged
sturnclaw merged 3 commits intopioneerspacesim:masterfrom
sturnclaw:windows-install-dirs
Dec 22, 2023
Merged

Fix installed directory structure on Windows#5686
sturnclaw merged 3 commits intopioneerspacesim:masterfrom
sturnclaw:windows-install-dirs

Conversation

@sturnclaw
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://github.com/pioneerspacesim/pioneer/actions/runs/7293314137

@sturnclaw
Copy link
Member Author

That should also be fixed now.

@bszlrd
Copy link
Contributor

bszlrd commented Dec 22, 2023

Confirmed, it works properly now.

@sturnclaw sturnclaw merged commit b18e985 into pioneerspacesim:master Dec 22, 2023
@sturnclaw
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.

@sturnclaw sturnclaw 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

X Tutup