Giter VIP home page Giter VIP logo

Comments (5)

gamedev-mario avatar gamedev-mario commented on August 16, 2024

I got started on some ways to fix up the CMakeLists file (see: https://github.com/gamedevmarz/IsometricEngine/tree/fix-cmake). However, it appears your find modules are a mix of things found on the internet - so the SDL2_image/ttf ones are quite dated and don't actually create an imported library, whereas the SDL2 one does.

I can update the find modules if you'd like, but this may break your setup until you test it yourself. Changing the hard-coded Windows paths to SDL libraries will also definitely break your setup (the find modules should be all you need).

Ideally, there is no need for the include_directories, and you would have something like:

target_link_libraries(
  ${PROJECT_NAME}
  PRIVATE
    SDL::SDL2
    SDL::SDL2_Image
    SDL::SDL2_Ttf
)

And each library you link with has specified where their include directory is as a property. For example, in the FindSDL2.cmake:

set_property(TARGET SDL2::SDL2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${SDL2_INCLUDE_DIR})

from cytopia.

gamedev-mario avatar gamedev-mario commented on August 16, 2024

I have tested changes in the fix-cmake branch and they work on Ubuntu 16.04, Windows 10 with mingw, and it appears they are successful on Travis as well. Please test on your own machine, review, and let me know if you encounter any issues.

from cytopia.

SimplyLiz avatar SimplyLiz commented on August 16, 2024

It also works for Visual Studio.
Looks very clean, i like what you did there!

We should add to the README that it's now required to set the PATH env variable to the SDL2 Directory. (for windows, if one just downloads SDL2)

On windows, it'd be a nice addition to also copy over the found sdl libraries to the working directory, so the build will work out of the box. (like the resources dir) What do you think about that?

from cytopia.

gamedev-mario avatar gamedev-mario commented on August 16, 2024

I've updated the README's build instructions.

As for the second part, I think you mean copying the .dll file over to the build directory? You don't need to copy the .lib over.

I'm not really sure how to do that with CMake. I think find_library only searches for .lib, not .dll? I'd also have no way to test it myself (without installing VStudio) so anything I script would be in the dark.

from cytopia.

SimplyLiz avatar SimplyLiz commented on August 16, 2024

yes, i meant the shared libraries. It's not worth the effort.

I think you can merge this! Good workt

from cytopia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.