add helloworld-cpp-cmake
This commit is contained in:
		
							parent
							
								
									ceffdfb561
								
							
						
					
					
						commit
						2d29797403
					
				
							
								
								
									
										14
									
								
								helloworld-cpp-cmake/.clang-format
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								helloworld-cpp-cmake/.clang-format
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,14 @@ | ||||
| BasedOnStyle: WebKit | ||||
| IndentWidth: 4 | ||||
| ColumnLimit: 80 | ||||
| IndentCaseLabels: true | ||||
| BreakBeforeBraces: Custom | ||||
| BraceWrapping: | ||||
|     AfterFunction: true | ||||
|     SplitEmptyFunction: false | ||||
| AlignAfterOpenBracket: BlockIndent | ||||
| AlignOperands: AlignAfterOperator | ||||
| BreakBeforeBinaryOperators: true | ||||
| BinPackArguments: false | ||||
| BinPackParameters: false | ||||
| 
 | ||||
							
								
								
									
										3
									
								
								helloworld-cpp-cmake/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								helloworld-cpp-cmake/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| build/ | ||||
| .cache/ | ||||
| 
 | ||||
							
								
								
									
										13
									
								
								helloworld-cpp-cmake/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								helloworld-cpp-cmake/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,13 @@ | ||||
| 
 | ||||
| cmake_minimum_required(VERSION 3.29) | ||||
| project(MyProject VERSION 1.0.0 LANGUAGES C CXX) | ||||
| 
 | ||||
| set(CMAKE_EXPORT_COMPILE_COMMANDS true) | ||||
| 
 | ||||
| add_executable( | ||||
|     helloworld-cpp-cmake | ||||
|     src/main.cpp | ||||
| ) | ||||
| 
 | ||||
| install(TARGETS helloworld-cpp-cmake) | ||||
| 
 | ||||
							
								
								
									
										20
									
								
								helloworld-cpp-cmake/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								helloworld-cpp-cmake/README.md
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,20 @@ | ||||
| 
 | ||||
| # helloworld-cpp-cmake | ||||
| 
 | ||||
| ``` | ||||
| mkdir build | ||||
| cd build | ||||
| cmake .. | ||||
| make | ||||
| ./helloworld-cpp-cmake | ||||
| ``` | ||||
| 
 | ||||
| ``` | ||||
| mkdir build | ||||
| cd build | ||||
| cmake .. -CMAKE_BUILD_TYPE=Release | ||||
| make | ||||
| sudo make install | ||||
| ./helloworld-cpp-cmake | ||||
| ``` | ||||
| 
 | ||||
							
								
								
									
										3
									
								
								helloworld-cpp-cmake/src/main.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								helloworld-cpp-cmake/src/main.cpp
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| #include <iostream> | ||||
| 
 | ||||
| int main() { std::cout << "Hello, world!\n"; } | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user