Skip to content

Conversation

@JBenda
Copy link
Owner

@JBenda JBenda commented Jun 9, 2022

Add different components to allow clean installs, also adds support for cpack and cmake find_package

Description https://github.com/brwarner/inkcpp/wiki/building

inspired from issue #40

@LilithSilver
Copy link
Contributor

Hi! Finally taking a look at this. I'm only testing the lib component on Windows since I don't have Unreal.

It looks good, and I got it running with some modifications. Some notes:

  • The inkcpp/include/inkcpp directory should be renamed to inkcpp/include/ink
    • Allows referencing the headers as #include <ink/story.h> like in the README
  • Missing Debug and Release distribution:
    • Different .lib files are required for Debug vs. Release projects. This just uses Release by default.
    • A distribution file structure could like:
      • inkcpp/lib/release/ contains: inkcpp.lib (release), inkcpp_compiler.lib (release)
      • inkcpp/lib/debug contains: inkcpp.lib (debug), inkcpp_compiler.lib (debug), inkcpp.pdb, inkcpp_compiler.pdb
  • It shouldn't install by default to the Program Files directory on Windows. Not only does this require command prompt admin access, but most people wouldn't want their C++ libraries to go there. Generally, distribution for C++ packages will involve uploading the built library section to github or a website anyways, so it should build into an ignored folder into the repository, probably; the dev can just copy the folder from there.
  • I'd update the README as part of this PR to include the build steps, and remove the convoluted steps I had added as part of my issue I submitted, since as of this PR they won't be required anymore.

It's looking way better! Thank you for your help on this!

@JBenda
Copy link
Owner Author

JBenda commented Jul 4, 2022

Thank you for the feedback ^^

  • The include-path will be changed to inkcpp/include/ink to match with the examples.
  • regarding the debug and non debug build, if you set CMAKE_BUILD_TYPE=Debug the libraries will the debug version, for build systems like ninja and mvsc you need also to define cmake --build . --config Release/Debug (or at least should, will test it on Windows later this week)
    providing both is against the sprite of cmake (where you can decide which version you want to build, at least with my current knowledge).
    • we can think about creating artifacts and make debug and non debug version downloadable without building (this would then be a new issue/PR)
  • the installation directory is set with cmake -B build -DCMAKE_INSTALL_PREFIX=<path> and defaults to the OS typical installation path, I will properly change the example to use a install directory beside the build to make this clear ^^

@JBenda JBenda self-assigned this Jul 4, 2022
@JBenda JBenda marked this pull request as ready for review July 4, 2022 16:05
@JBenda JBenda merged commit ba5a8a1 into JBenda:master Jul 12, 2022
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