Giter Site home page Giter Site logo

Comments (8)

Polytonic avatar Polytonic commented on May 13, 2024

You should not be running CMake in the top level directory. That is known as an in-source build.

After you clone the repository, you should cd Glitter. You should now be in the repository root. Now cd Build again, and then cmake .. to create the makefiles or project files. Do not go to {Project Root}/Glitter/Build (that folder does not exist). If for whatever reason you need a clean start, you can then delete and recreate the build folder, and rerun cmake. This is known as an out-of-source build.

If in doubt, please follow the instructions exactly as they appear.

from glitter.

gdwhite avatar gdwhite commented on May 13, 2024

Sorry to be such a bother.

I just gave it another shot following the instructions exactly as they appear (with the variation of specifying the "CodeBlocks - MinGW Makefiles" generator). I got the same results (i.e. "source directory xxx does not appear to contain CMakeLists.txt) as shown below.

I can see where my original post might have been confusing since the repository root was "C:/Download/Graphics Libs/Glitter/Glitter" and therefore the "C:/Download/Graphics Libs/Glitter/Glitter/Build" folder did exist and was the folder that I was in after following the instructions.

To make things a little clearer this time, I started in "C:\Users\Gary\Documents\CodeBlocksProjects" and therefore the repository root ended up being "C:\Users\Gary\Documents\CodeBlocksProjects\Glitter". The resulting error was:

CMake Error: The source directory "C:/Users/Gary/Documents/CodeBlocksProjects/Glitter/Build" does not appear to contain CMakeLists.txt.

Looking directly at the repository on Github, the "Glitter/Build" folder (https://github.com/Polytonic/Glitter/tree/master/Build) only contains a .gitignore file and not a CMakeLists.txt file. Am I completely missing something here?

C:\Users\Gary\Documents\CodeBlocksProjects>git clone --recursive https://github.com/Polytonic/Glitter
Cloning into 'Glitter'...
remote: Counting objects: 183, done.
.
.
.
Checking connectivity... done.
Submodule path 'Glitter/Vendor/stb': checked out 'c4082cfb890946a0c37df6b4c97f57b52042969e'

C:\Users\Gary\Documents\CodeBlocksProjects>cd Glitter

C:\Users\Gary\Documents\CodeBlocksProjects\Glitter>cd Build

C:\Users\Gary\Documents\CodeBlocksProjects\Glitter\Build>cmake -G "CodeBlocks - MinGW Makefiles"
CMake Error: The source directory "C:/Users/Gary/Documents/CodeBlocksProjects/Glitter/Build" does not appear to contain CMakeLists.txt.

Specify --help for usage, or press the help button on the CMake GUI.

C:\Users\Gary\Documents\CodeBlocksProjects\Glitter\Build>

from glitter.

Polytonic avatar Polytonic commented on May 13, 2024

You're missing .. when invoking CMake. You need to tell it where to find the CMakeLists.txt file, which in this case, is located in the parent directory.

cmake .. -G "CodeBlocks - MinGW Makefiles"

from glitter.

gdwhite avatar gdwhite commented on May 13, 2024

Ahhh...I thought that was an ellipse indicating any other options that I might want to specify. So much for following the instructions exactly.

Thanks again.

from glitter.

Polytonic avatar Polytonic commented on May 13, 2024

Ah, hm. Yeah I didn't realize that could be confusing. I figure most people on Windows tend to use the standard toolchain and stop as soon as they get their project file up and running. I think you're the second person now I've talked to that uses MinGW. I might add a line for that makefile generator.

Is everything working for you now?

from glitter.

gdwhite avatar gdwhite commented on May 13, 2024

Yes, cmake worked as expected this time.

I'm now trying to grok how to organize any projects (i.e. folder structure -> src, include etc.) created from the resulting output and how (if) I can make a template out of this without having to go through the clone/build process each time. The CodeBlocks project file ending up in the Build folder is a little counterintuitive and is throwing me off a bit. Also, I see that the paths are absolute instead of relative which complicates reuse of a specific build. Any thoughts?

from glitter.

Polytonic avatar Polytonic commented on May 13, 2024

The "Build" folder is where project files and output binaries go. You don't need to maintain a separate folder structure. If you want to organize your code differently, create new folders and modify the includes/sources in CMakeLists.txt as needed. Edit the source code in Glitter/Sources and Glitter/Headers and make to compile ...

At this point, I would strongly recommend that you work through a brief CMake tutorial.

from glitter.

Polytonic avatar Polytonic commented on May 13, 2024

Closing this as it seems you've resolved the original issue. Feel free to reopen or file a new ticket if you continue to have issues.

from glitter.

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.