jameskbride / cmake-hello-world Goto Github PK
View Code? Open in Web Editor NEWHello World application using CMake for the build.
License: MIT License
Hello World application using CMake for the build.
License: MIT License
I'm running stock ubuntu with all the updates, and had issues compiling:
% make Scanning dependencies of target Hello [ 50%] Building CXX object Hello/CMakeFiles/Hello.dir/Speaker.cpp.o Linking CXX static library libHello.a [ 50%] Built target Hello Scanning dependencies of target CMakeHelloWorld [100%] Building CXX object CMakeFiles/CMakeHelloWorld.dir/HelloWorld.cpp.o /home/lubuntu/cmake-hello-world/HelloWorld.cpp:1:21: fatal error: Speaker.h: No such file or directory compilation terminated. make[2]: *** [CMakeFiles/CMakeHelloWorld.dir/HelloWorld.cpp.o] Error 1 make[1]: *** [CMakeFiles/CMakeHelloWorld.dir/all] Error 2 make: *** [all] Error 2
The following change made the issue go away:
git diff -u diff --git a/CMakeLists.txt b/CMakeLists.txt index 68be95c..a9bb5c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,7 @@ set (CMakeHelloWorld_VERSION_MINOR 0) #include the subdirectory containing our libs add_subdirectory (Hello) +include_directories(Hello) #indicate the entry point for the executable add_executable (CMakeHelloWorld Hello HelloWorld.cpp)
Last login: Wed Oct 14 13:12:07 on ttys000
The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh
.
For more details, please visit https://support.apple.com/kb/HT208050.
PrivateNetwork:~ excel$ cd Downloads/
PrivateNetwork:Downloads excel$ git clone https://github.com/jameskbride/cmake-hello-world.git
Cloning into 'cmake-hello-world'...
remote: Enumerating objects: 56, done.
remote: Total 56 (delta 0), reused 0 (delta 0), pack-reused 56
Unpacking objects: 100% (56/56), done.
PrivateNetwork:Downloads excel$ cd cmake-hello-world
PrivateNetwork:cmake-hello-world excel$ ls
CMakeLists.txt Hello HelloWorld.cpp LICENSE README.md
PrivateNetwork:cmake-hello-world excel$ mkdir build
PrivateNetwork:cmake-hello-world excel$ cd build/
PrivateNetwork:build excel$ cmake ..
-bash: cmake: command not found
PrivateNetwork:build excel$ PATH="/Applications/CMake.app/Contents/bin":"$PATH"
PrivateNetwork:build excel$ cmake ..
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /Applications/Xcode 11.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode 11.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - broken
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"/Applications/Xcode 11.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/excel/Downloads/cmake-hello-world/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_faeb8/fast && /Applications/Xcode 11.3.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_faeb8.dir/build.make CMakeFiles/cmTC_faeb8.dir/build
make: /Applications/Xcode: No such file or directory
make: *** [cmTC_faeb8/fast] Error 1
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
See also "/Users/excel/Downloads/cmake-hello-world/build/CMakeFiles/CMakeOutput.log".
See also "/Users/excel/Downloads/cmake-hello-world/build/CMakeFiles/CMakeError.log".
PrivateNetwork:build excel$
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.