mirror of
https://github.com/ttroy50/cmake-examples.git
synced 2025-12-18 20:24:35 +03:00
link files from intro
This commit is contained in:
@@ -21,10 +21,10 @@ $ tree
|
|||||||
└── main.cpp
|
└── main.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
* CMakeLists.txt - Contains the CMake commands you wish to run
|
* link:CMakeLists.txt[] - Contains the CMake commands you wish to run
|
||||||
* inc/Hello.h - The header file to include
|
* link:inc/Hello.h[] - The header file to include
|
||||||
* src/Hello.cpp - A source file to compile
|
* link:src/Hello.cpp[] - A source file to compile
|
||||||
* src/main.cpp - The source file with main
|
* link:src/main.cpp[] - The source file with main
|
||||||
|
|
||||||
|
|
||||||
# Concepts
|
# Concepts
|
||||||
|
|||||||
@@ -24,11 +24,11 @@ $ tree
|
|||||||
└── main.cpp
|
└── main.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
* CMakeLists.txt - Contains the CMake commands you wish to run
|
* link:CMakeLists.txt[] - Contains the CMake commands you wish to run
|
||||||
* cmake-examples.conf - An example configuration file
|
* link:cmake-examples.conf[] - An example configuration file
|
||||||
* inc/Hello.h - The header file to include
|
* link:inc/Hello.h[] - The header file to include
|
||||||
* src/Hello.cpp - A source file to compile
|
* link:src/Hello.cpp[] - A source file to compile
|
||||||
* src/main.cpp - The source file with main
|
* link:src/main.cpp[] - The source file with main
|
||||||
|
|
||||||
# Concepts
|
# Concepts
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ $ tree
|
|||||||
├── main.cpp
|
├── main.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
* CMakeLists.txt - Contains the CMake commands you wish to run
|
* link:CMakeLists.txt[] - Contains the CMake commands you wish to run
|
||||||
* main.cpp - The source file with main
|
* link:main.cpp[] - The source file with main
|
||||||
|
|
||||||
# Concepts
|
# Concepts
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ $ tree
|
|||||||
├── main.cpp
|
├── main.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
* CMakeLists.txt - Contains the CMake commands you wish to run
|
* link:CMakeLists.txt[] - Contains the CMake commands you wish to run
|
||||||
* main.cpp - The source file with main
|
* link:main.cpp[] - The source file with main
|
||||||
|
|
||||||
# Concepts
|
# Concepts
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ $ tree
|
|||||||
├── main.cpp
|
├── main.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
* CMakeLists.txt - Contains the CMake commands you wish to run
|
* link:CMakeLists.txt[] - Contains the CMake commands you wish to run
|
||||||
* main.cpp - The source file with main
|
* link:main.cpp[] - The source file with main
|
||||||
|
|
||||||
# Requirements
|
# Requirements
|
||||||
|
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ method of changing the compiler from the default gcc to http://clang.llvm.org/[c
|
|||||||
The files in this tutorial are below:
|
The files in this tutorial are below:
|
||||||
|
|
||||||
```
|
```
|
||||||
A-hello-cmake$ tree
|
$ tree
|
||||||
.
|
.
|
||||||
├── CMakeLists.txt
|
├── CMakeLists.txt
|
||||||
├── main.cpp
|
├── main.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
* CMakeLists.txt - Contains the CMake commands you wish to run
|
* link:CMakeLists.txt[] - Contains the CMake commands you wish to run
|
||||||
* main.cpp - A simple "Hello World" cpp file.
|
* link:main.cpp[] - A simple "Hello World" cpp file.
|
||||||
|
|
||||||
# Concepts
|
# Concepts
|
||||||
|
|
||||||
|
|||||||
@@ -6,21 +6,21 @@ toc::[]
|
|||||||
|
|
||||||
# Introduction
|
# Introduction
|
||||||
|
|
||||||
As mentioned in the introduction, CMake is a meta-build system that can be used to
|
As mentioned, CMake is a meta-build system that can be used to
|
||||||
create the build files for many other build tools. This example shows how
|
create the build files for many other build tools. This example shows how
|
||||||
to have CMake use the https://ninja-build.org/[ninja build] tool.
|
to have CMake use the https://ninja-build.org/[ninja build] tool.
|
||||||
|
|
||||||
The files in this tutorial are below:
|
The files in this tutorial are below:
|
||||||
|
|
||||||
```
|
```
|
||||||
A-hello-cmake$ tree
|
$ tree
|
||||||
.
|
.
|
||||||
├── CMakeLists.txt
|
├── CMakeLists.txt
|
||||||
├── main.cpp
|
├── main.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
* CMakeLists.txt - Contains the CMake commands you wish to run
|
* link:CMakeLists.txt[] - Contains the CMake commands you wish to run
|
||||||
* main.cpp - A simple "Hello World" cpp file.
|
* link:main.cpp[] - A simple "Hello World" cpp file.
|
||||||
|
|
||||||
# Concepts
|
# Concepts
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ create the following:
|
|||||||
The files included in this example are:
|
The files included in this example are:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
$ tree
|
||||||
.
|
.
|
||||||
├── CMakeLists.txt
|
├── CMakeLists.txt
|
||||||
├── subbinary
|
├── subbinary
|
||||||
@@ -34,14 +35,14 @@ The files included in this example are:
|
|||||||
└── sublib2.h
|
└── sublib2.h
|
||||||
```
|
```
|
||||||
|
|
||||||
* CMakeLists.txt - Top level CMakeLists.txt
|
* link:CMakeLists.txt[] - Top level CMakeLists.txt
|
||||||
* subbinary/CMakeLists.txt - to make the executable
|
* link:subbinary/CMakeLists.txt[] - to make the executable
|
||||||
* subbinary/main.cpp - source for the executable
|
* link:subbinary/main.cpp[] - source for the executable
|
||||||
* sublibrary1/CMakeLists.txt - to make a static library
|
* link:sublibrary1/CMakeLists.txt[] - to make a static library
|
||||||
* sublibrary1/inc/sublib1.h
|
* link:sublibrary1/inc/sublib1.h[]
|
||||||
* sublibrary1/src/sublib2.cpp
|
* link:sublibrary1/src/sublib2.cpp[]
|
||||||
* sublibrary2/CMakeLists.txt - to setup header only library
|
* link:sublibrary2/CMakeLists.txt[] - to setup header only library
|
||||||
* sublibrary2/inc/sublib2.h
|
* link:sublibrary2/inc/sublib2.h[]
|
||||||
|
|
||||||
# Concepts
|
# Concepts
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ $ tree
|
|||||||
├── ver.h.in
|
├── ver.h.in
|
||||||
```
|
```
|
||||||
|
|
||||||
* CMakeLists.txt - Contains the CMake commands you wish to run
|
* link:CMakeLists.txt[] - Contains the CMake commands you wish to run
|
||||||
* main.cpp - The source file with main
|
* link:main.cpp[] - The source file with main
|
||||||
* path.h.in - File to contain a path to the build directory
|
* link:path.h.in[] - File to contain a path to the build directory
|
||||||
* ver.h.in - File to contain the version of the project
|
* link:ver.h.in[] - File to contain the version of the project
|
||||||
|
|
||||||
# Concepts
|
# Concepts
|
||||||
|
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ $ tree
|
|||||||
├── main.cpp
|
├── main.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
* AddressBook.proto - proto file from main protocol buffer https://developers.google.com/protocol-buffers/docs/cpptutorial[example]
|
* link:AddressBook.proto[] - proto file from main protocol buffer https://developers.google.com/protocol-buffers/docs/cpptutorial[example]
|
||||||
* CMakeLists.txt - Contains the CMake commands you wish to run
|
* link:CMakeLists.txt[] - Contains the CMake commands you wish to run
|
||||||
* main.cpp - The source file from the protobuf example.
|
* link:main.cpp[] - The source file from the protobuf example.
|
||||||
|
|
||||||
# Requirements
|
# Requirements
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ analysis on all sub-projects.
|
|||||||
The files included in this example are:
|
The files included in this example are:
|
||||||
|
|
||||||
```
|
```
|
||||||
cppcheck$ tree
|
$ tree
|
||||||
.
|
.
|
||||||
├── cmake
|
├── cmake
|
||||||
│ ├── analysis.cmake
|
│ ├── analysis.cmake
|
||||||
@@ -34,13 +34,13 @@ cppcheck$ tree
|
|||||||
└── main2.cpp
|
└── main2.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
* CMakeLists.txt - Top level CMakeLists.txt
|
* link:CMakeLists.txt[] - Top level CMakeLists.txt
|
||||||
* cmake/analysis.cmake - Includes functions to add analysis targets
|
* link:cmake/analysis.cmake[] - Includes functions to add analysis targets
|
||||||
* cmake/modules/FindCppCheck.cmake - A custom package module to find CppCheck
|
* link:cmake/modules/FindCppCheck.cmake[] - A custom package module to find CppCheck
|
||||||
* subproject1/CMakeLists.txt - CMake commands for subproject 1
|
* link:subproject1/CMakeLists.txt[] - CMake commands for subproject 1
|
||||||
* subproject1/main.cpp - source for a subproject with no errors
|
* link:subproject1/main.cpp[] - source for a subproject with no errors
|
||||||
* subproject2/CMakeLists.txt - CMake commands for subproject 2
|
* link:subproject2/CMakeLists.txt[] - CMake commands for subproject 2
|
||||||
* subproject2/main2.cpp - source for a subproject that includes errors
|
* link:subproject2/main2.cpp[] - source for a subproject that includes errors
|
||||||
|
|
||||||
# Requirements
|
# Requirements
|
||||||
|
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ $ tree
|
|||||||
├── unit_tests.cpp
|
├── unit_tests.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
* CMakeLists.txt - Contains the CMake commands you wish to run
|
* link:CMakeLists.txt[] - Contains the CMake commands you wish to run
|
||||||
* Reverse.h / .cpp - Class to reverse a string
|
* link:Reverse.h[] / link:Reverse.cpp[.cpp] - Class to reverse a string
|
||||||
* Palindrome.h / .cpp - Class to test if a string is a palindrome
|
* link:Palindrome.h[] / link:Palindrome.cpp[.cpp] - Class to test if a string is a palindrome
|
||||||
* unit_test.cpp - Unit Tests using boost unit test framework
|
* link:unit_test.cpp[] - Unit Tests using boost unit test framework
|
||||||
|
|
||||||
# Requirements
|
# Requirements
|
||||||
|
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ $ tree
|
|||||||
└── main.cpp
|
└── main.cpp
|
||||||
```
|
```
|
||||||
|
|
||||||
* CMakeLists.txt - Contains the CMake commands you wish to run
|
* link:CMakeLists.txt[] - Contains the CMake commands you wish to run
|
||||||
* cmake-examples.conf - An example configuration file
|
* link:cmake-examples.conf[] - An example configuration file
|
||||||
* inc/Hello.h - The header file to include
|
* link:inc/Hello.h[] - The header file to include
|
||||||
* src/Hello.cpp - A source file to compile
|
* link:src/Hello.cpp[] - A source file to compile
|
||||||
* src/main.cpp - The source file with main
|
* link:src/main.cpp[] - The source file with main
|
||||||
|
|
||||||
# Concepts
|
# Concepts
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user