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

Support cmake installs with VS project templates #705

Conversation

tobil4sk
Copy link
Member

@tobil4sk tobil4sk commented Sep 1, 2024

When hashlink is installed via cmake, the library files end up in the lib subdirectory

When hashlink is installed via cmake, the library files end up in the
`lib` subdirectory
@yuxiaomao
Copy link
Collaborator

Hi, I never used cmake, could you please detail a little bit how to use cmake for generation and what libraries ends up in lib? Especially, it that possible to just adjust where is the HASHLINK variables?
I know that I have made ci template, where I have to split src directory and dll directory, I'm wondering if that's a similar problem.

@tobil4sk
Copy link
Member Author

tobil4sk commented Sep 6, 2024

Hi, I never used cmake, could you please detail a little bit how to use cmake for generation and what libraries ends up in lib? Especially, it that possible to just adjust where is the HASHLINK variables?

These are the rough steps to build and install via cmake:

mkdir build
cd build
cmake ..
cmake --build .
# this last step is currently missing from haxe ci:
cmake --build . --target install

The cmake install generates the following directories in the install directory:

You can see the structure of the generated windows-cmake-64 artefacts: https://github.com/HaxeFoundation/hashlink/actions/runs/10735720378/artifacts/1900367023

If it is preferred, an alternative would be to change the cmake install structure on windows to match what is generated for the vs2019 builds? Then we don't need this PR, that might be simpler and it is how neko used to install.

I know that I have made ci template, where I have to split src directory and dll directory, I'm wondering if that's a similar problem.

Yes, I'm trying to solve a similar problem. With #517 and if this issue is solved, then haxe ci can just add the cmake install step (and set only HASHLINK) and there should no longer be a need for a special ci template. I think it is ideal for CI to build with the same template that a regular user will be using.

@yuxiaomao
Copy link
Collaborator

Thank you for the explanation!
I just did a quick search on CMake and merged the other PR, as it can help CMake users x).
I see that CMake generate bin/include/lib structure for all targets, and this structure is different than what make/vs2019 generates. If possible, I think it would better to let them generate the same structure and keep things simple?

@tobil4sk
Copy link
Member Author

tobil4sk commented Sep 6, 2024

I just did a quick search on CMake and merged the other PR, as it can help CMake users x).

Thanks!

If possible, I think it would better to let them generate the same structure and keep things simple?

Ok, that sounds good. I'll open a new PR that does that instead!

@tobil4sk tobil4sk closed this Sep 6, 2024
@tobil4sk tobil4sk deleted the fix/vs-templates-cmake-install branch September 6, 2024 11:07
@tobil4sk
Copy link
Member Author

tobil4sk commented Sep 6, 2024

I've opened: #709

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.

2 participants