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 Error #7

Closed
KivyGogh opened this issue Sep 18, 2016 · 7 comments
Closed

CMake Error #7

KivyGogh opened this issue Sep 18, 2016 · 7 comments

Comments

@KivyGogh
Copy link

起始项目的时候遇到:
goudandeMacBook-Pro:mini-JSON goudan$ cmake -DCMAKE_BUILD_TYPE=Debug ..
CMake Error: The source directory "/Users/kivygogh" does not appear to contain CMakeLists.txt.

/Users/kivygogh是我的根目录,第一次接触cmake,有点不知所以,求教作者大神原因?:)

@luminocean
Copy link

$ brew install cmake
$ cd github/json-tutorial/tutorial01
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Debug ..
$ make

注意示例里面是先创建了build目录以后,cd到这个build目录里面再执行cmake的。你执行命令的位置不对。
cmake要求指定的目录里面有CMakeLists.txt文件。

@yangruihan
Copy link

yangruihan commented Sep 18, 2016

cmake -DCMAKE_BUILD_TYPE=Debug ..

Debug 后面跟的是路径,..表示上一级目录

@KivyGogh
Copy link
Author

我确实没进到build里面……但是刚才cd build了一下,然后cmake -DCMAKE_BUILD_TYPE=Debug ..还是不行,目录里没CMakeLists.txt文件。但是我确实很认真的brew install cmake了啊 😢

@miloyip
Copy link
Owner

miloyip commented Sep 19, 2016

你在哪个目录?键入pwd 看看,再 ls .. 看看有没有 CMakeLists.txt

@KivyGogh
Copy link
Author

goudandeMacBook-Pro:~ goudan$ cd mini-json
goudandeMacBook-Pro:mini-json goudan$ pwd
/Users/kivygogh/mini-json
goudandeMacBook-Pro:mini-json goudan$ cd build
goudandeMacBook-Pro:build goudan$ pwd
/Users/kivygogh/mini-json/build
goudandeMacBook-Pro:build goudan$ ls ..
build
goudandeMacBook-Pro:build goudan$ cd CMakeLists.txt
-bash: cd: CMakeLists.txt: No such file or directory
goudandeMacBook-Pro:build goudan$ cd ..
goudandeMacBook-Pro:mini-json goudan$ cd CMakeLists.txt
-bash: cd: CMakeLists.txt: No such file or directory

...是我没装好么T-T

@miloyip
Copy link
Owner

miloyip commented Sep 19, 2016

你好像没有下载或 clone 这个项目的源文件。
简单一点的话,在主面右方找绿色的 Clone or download 按钮,或直接点 https://github.com/miloyip/json-tutorial/archive/master.zip

@KivyGogh
Copy link
Author

啊……抱歉🙈谢谢

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

4 participants