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

Remove "cd Build" from "Getting Started" instructions? #18

Closed
gdwhite opened this issue Oct 9, 2015 · 8 comments
Closed

Remove "cd Build" from "Getting Started" instructions? #18

gdwhite opened this issue Oct 9, 2015 · 8 comments

Comments

@gdwhite
Copy link

gdwhite commented Oct 9, 2015

I get the following error when running cmake in the Build directory as instructed in "Getting Started":

CMake Error: The source directory "C:/Download/Graphics Libs/Glitter/Glitter/Build" does not appear to contain CMakeLists.txt.

It works fine when running it from the top-level directory. It appears that the "cd Build" step should be removed.

BTW, is the Build directory used as an interim location during the build process? I ask because I didn't see anything there either before or after building (I didn't check during the build).

@Polytonic
Copy link
Owner

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.

@gdwhite
Copy link
Author

gdwhite commented Oct 12, 2015

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>

@Polytonic
Copy link
Owner

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"

@gdwhite
Copy link
Author

gdwhite commented Oct 12, 2015

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.

@Polytonic
Copy link
Owner

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?

@gdwhite
Copy link
Author

gdwhite commented Oct 12, 2015

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?

@Polytonic
Copy link
Owner

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.

@Polytonic
Copy link
Owner

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.

Repository owner deleted a comment Jun 2, 2019
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

No branches or pull requests

2 participants