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

CMake: Add UNIX install target #131

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

mattiasb
Copy link

Add installation target for UNIX systems.

This defaults to install under /usr/local/bin/ and
/usr/local/share/magicseteditor/ but is configurable through the
CMAKE_INSTALL_PREFIX variable.

@mattiasb
Copy link
Author

I'm not very well-versed with CMake and particularly not with Windows or OSX development so this PR might reflect that.

The reason I started looking at this was to be able to build MagicSetEditor as a Flatpak so that my friend that makes custom sets can install it on his Linux machine. He's currently running a Windows VM just for MSE. :P.

I could of course work around this by copying the files to the right paths inside the Flatpak manifest but adding an installation target seemed like the correct way to go about it since it would also make it easier to build and install to say ~/.local/ or /usr/local/ directly on your machine.

There are a couple things I'd like input on here:

  1. I removed the special MacOS notes about moving the binary and the resources to a SharedSupport directory since I believe this should Just Work™ with the install target instead. Does the code assume stuff about paths on MacOS in different ways than on Linux?
  2. Should I add an installation target for Windows? I have no access to a windows machine to build on currently but could install a VM for this if needed.
  3. I copied over the data directory as part of the installation. Is that needed or would I be good with just the resource directory?

@mattiasb
Copy link
Author

Also: if you'd like to have a chat regarding Flatpak and what I'm planning there we could perhaps schedule a call on https://meet.jit.si/ for example or some text chat app.

The current state is that I'm able to clone and build directly from GNOME Builder without any extra steps from my work-in-progress feature/flatpak branch:
Screenshot from 2021-04-18 02-46-30

- Change from quad-backticks to triple backticks
- Escape underscores (they are for making text italic)
- Add commandline prefix to all commands (to better visualize that this
  is run from the command line)
- Add shell highlighting
This shouldn't come as a surprise to anyone but might as well add it to
the instructions.
I had to install the libboost-regex-dev package on Ubuntu 20.04 to build
there.
This is apparently how one defines the build directory path using CMake.

From `cmake --help`:

  ...
   -B <path-to-build>           = Explicitly specify a build directory.
  ...
Add installation target for UNIX systems.

This defaults to install under /usr/local/bin/ and
/usr/local/share/magicseteditor/ but is configurable through the
CMAKE_INSTALL_PREFIX variable.
Add installation instructions to the build instructions.
@mattiasb mattiasb force-pushed the feature/cmake-install-target branch from f1ceb4d to 9432a32 Compare April 18, 2021 01:29
@mattiasb
Copy link
Author

mattiasb commented Apr 18, 2021

I tried to build using the new instructions in an Ubuntu 20.04 VM (I'm personally on Fedora 33) to test that stuff works on a regular build. This made me add some instructions to the README but unfortunately the build failed (something about hashmaps, not sure, will have to check further).

Note: if you prefer to skip the README fixes and additions I can easily just throw them away or put them up in a separate PR.

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.

1 participant