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

Text example setup #41

Closed
Guillaume227 opened this issue May 1, 2018 · 9 comments
Closed

Text example setup #41

Guillaume227 opened this issue May 1, 2018 · 9 comments

Comments

@Guillaume227
Copy link

I have tried to follow closely the documentation to run the
I am on windows, using vcpkg (it's quite neat!).
I have vcpkg-installed: sdl2, magnum, corrade, magnum-plugins[freetypefont]
I am trying to stay entirely within visual studio (2017 community edition) so I have edited CMakeSettings.json to include the CMake directives:

WITH_TEXT_EXAMPLE=ON
CMAKE_TOOLCHAIN_FILE=<points to vcpkg.cmake>
CMAKE_RUNTIME_OUTPUT_DIRECTORY="bin"

I have one blocking issue and two minor ones:
A) at runtime I get the error:
PluginManager::Manager::load(): plugin FreeTypeFont is not static and was not found in
What step am I missing?

B)when I run the install target, only magnum-text.exe and magnum-triangle.exe get copied in the install location (magnum-examples\install\x86-Debug\bin), none of the supporting libs are present so I am running from the build directory for the time being, i.e. magnum-examples\build\x86-Debug\src\text\bin
image

C)SDL2.dll doesn't get copied to the build directory along with the other libs, I have to do it manually. I thought the point of CMAKE_RUNTIME_OUTPUT_DIRECTORY was to grab all the dependencies?

image

@mosra
Copy link
Owner

mosra commented May 1, 2018

Hi!

first of all: sorry about things at the moment, I'm in a process of releasing a new version and everything is a bit unstable and confusing at the moment.

Are you using the stable (2018.02) version or latest --head? The 2018.02 version has some issues regarding plugin usability when using vcpkg. Most of the issues are already ironed out if you install --head, the version I'm in process of releasing right now will contain last remaining fixes.

So, options:

  1. try to install the --head version of all packages (but be aware that some things are still broken there)
  2. wait a bit until new version comes out (I'll let you know)
  3. it's possible to patch and fix things yourself (as you already did: copying the DLLs), plus adapting the sources a bit (details here)

Cheers (and sorry again for the unfortunate timing)! :)

@mosra mosra added this to the 2018.0b milestone May 1, 2018
@Guillaume227
Copy link
Author

Thanks for the fast reply!
I am indeed using stable.
I think I am going to go with option 2) so I can test a clean and conformant setup.

My first dabbling with magnum dates back to last fall - to see the magnitude of changes (improvements!) since then is staggering. Great work!

One idea for the Visual studio users like me would be to include the CMakeSettings.json in the repo to achieve a git-clone-and-run-experience without any extra setup beyond the vcpkg step.

@mosra
Copy link
Owner

mosra commented May 1, 2018

One idea for the Visual studio users like me would be to include the CMakeSettings.json in the repo to achieve a git-clone-and-run-experience without any extra setup beyond the vcpkg step.

You mean for the examples repo or all repos? If that's the three lines above, I'm not sure if it could be done in a generic way -- someone else might want to enable a different set of examples, or have vcpkg installed in a different place. But maybe it would be worth to include this in the docs, at least?

@mosra mosra added this to TODO in Project management via automation May 1, 2018
@Guillaume227
Copy link
Author

You are right that in most cases paths would need to be customized. However one thing I feel would be very useful is to include a commented out sample version with some comments to mark them as 'to be adapted'.
My experience is that I spent more time than I should have piecing together the various parts of the documentation (magnum, magnum plugins, magnum examples, visual studio, cmake).
Documentation in code / sample code would help greatly with getting up to speed.

@mosra
Copy link
Owner

mosra commented May 3, 2018

The 2018.04 package update was merged to vcpkg: microsoft/vcpkg#3407

I agree documentation for visual studio isn't great, as you have to go to really a lot of spots in the docs. The plan is to provide a "Getting Started" guide dedicated for Visual Studio, code samples included. Unfortunately I was not able to do it in time for 2018.04 -- the progress is tracked in mosra/magnum#236. Thanks for the feedback! :)

@mosra mosra closed this as completed May 3, 2018
Project management automation moved this from TODO to Done May 3, 2018
@Guillaume227
Copy link
Author

Nice, I can now run the test example after updating the packages (I had to rebuild vcpkg and reinstall the packages but I don't think that's magnum related).

From the issues I listed above, B and C are not resolved, I still had to copy the SDL2.dll manually and the install directory is missing the deps.

@Squareys
Copy link
Contributor

Squareys commented May 4, 2018

I still had to copy the SDL2.dll manually and the install directory is missing the deps.

Yes, I noticed that, too! @mosra This is due to Sdl2Application always being a static library and vcpkg can therefore not detect the dependency on SDL2.dll through it... honestly it should on the .exe, though. I wonder what's going on there. Opening an issue.

@mosra
Copy link
Owner

mosra commented May 4, 2018

@Squareys thanks! Yeah, I also think it has to do something with being a static lib.

@Guillaume227 For the issue B, CMake install target always installs only what's explicitly specified in the CMakeLists.txt, it doesn't do any dependency handling or anything, as that's not feasible to cover fully for all platforms. All the dependency copying you see there is done by vcpkg itself. It always copies the dependencies next to the executable in the build dir. It has nothing to do with the install() target. The CMAKE_RUNTIME_OUTPUT_DIRECTORY setting only defines where the built executable gets placed, which in turn affects where vcpkg puts the dependencies.

@mosra mosra reopened this May 4, 2018
Project management automation moved this from Done to In progress May 4, 2018
@mosra
Copy link
Owner

mosra commented May 4, 2018

Okay, moving the SDL2 issue to #42 :)

@mosra mosra closed this as completed May 4, 2018
Project management automation moved this from In progress to Done May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants