-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from SYaoJun/temp
feat: give example for add_custom_target and add_dependencies
- Loading branch information
Showing
65 changed files
with
52 additions
and
21,229 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
# CMake教程 | ||
- 手把手教你使用C++玩转工程项目,学完后直接上手开源项目 | ||
## 课程大纲 | ||
1. 单个文件 | ||
2. 生成与使用库 | ||
3. 引用第三方库 | ||
4. 交叉编译 | ||
5. 单元测试 | ||
6. 编译优化 | ||
## 参考文件 | ||
[CMake Cookbook](https://www.bookstack.cn/read/CMake-Cookbook/content-chapter1-1.2-chinese.md) | ||
# CMakeTutorial | ||
- A useful tutorial for CMake | ||
|
||
## Syllabus | ||
- add_executable() | ||
- add_library() | ||
- target_link_libraries() | ||
- target_include_directories() | ||
- add_subdirectory() | ||
- find_package() | ||
- target_compile_definitions() | ||
- target_compile_options() | ||
- add_dependencies() | ||
- add_custom_target() | ||
- add_custom_command() | ||
- execute_process() | ||
- configure_file() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# CMake教程 | ||
- 手把手教你使用C++玩转工程项目,学完后直接上手开源项目 | ||
## 课程大纲 | ||
1. 单个文件 | ||
2. 生成与使用库 | ||
3. 引用第三方库 | ||
4. 交叉编译 | ||
5. 单元测试 | ||
6. 编译优化 | ||
## 参考文件 | ||
[CMake Cookbook](https://www.bookstack.cn/read/CMake-Cookbook/content-chapter1-1.2-chinese.md) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
project(add_custom_target_test) | ||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
add_executable(add_custom_target_test main.cpp) | ||
add_custom_command(TARGET add_custom_target_test POST_BUILD COMMAND echo "Hello World") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cp_file: | ||
cp README.md README.md.bak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# add_custom_command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include <iostream> | ||
int main(){ | ||
std::cout << "Hello World!" << std::endl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
project(add_custom_target_test) | ||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
add_executable(add_custom_target_test main.cpp) | ||
add_custom_target(run_test COMMAND cp ../README.md README.md.bak) | ||
add_dependencies(run_test add_custom_target_test) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include <iostream> | ||
int main(){ | ||
std::cout << "Hello World!" << std::endl; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.