-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
241cf4b
commit f04977c
Showing
41 changed files
with
251 additions
and
61 deletions.
There are no files selected for viewing
Binary file not shown.
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
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,2 +1,12 @@ | ||
|
||
## Create simple executable | ||
|
||
# Exercise: | ||
|
||
Comment out the first line of `CMakeLists.txt` (cmake_minimum_required) and execute `./run.sh` | ||
A comment is all text after a hash symbol, eg: | ||
|
||
``` | ||
# this line is comment | ||
# cmake_minimum_required (VERSION 3.0) # this does not execute now | ||
``` |
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
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,2 +1,16 @@ | ||
|
||
## Create simple executable and configure it as a test via ctest | ||
|
||
# Exercise: | ||
|
||
Add to run.sh | ||
|
||
``` | ||
export CXX=ccg | ||
``` | ||
|
||
or to cmake command | ||
|
||
``` | ||
-DCMAKE_CXX_COMPILER=ccg | ||
``` |
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
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
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,2 +1,17 @@ | ||
|
||
## Create static library and link it to executable | ||
|
||
Scope keywords | ||
|
||
PRIVATE - Only used for target | ||
INTERFACE - Only used for targets that consume this target | ||
PUBLIC - Both | ||
|
||
https://cmake.org/cmake/help/latest/command/target_link_libraries.html#command:target_link_libraries | ||
|
||
|
||
# Exercise: try add in `src/CMakeLists.txt` | ||
|
||
``` | ||
target_compile_definitions(${PROJECT_NAME} PRIVATE ABC=1 INTERFACE XYZ=2) | ||
``` |
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
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,7 +1,6 @@ | ||
project(project_library) | ||
|
||
cmake_minimum_required (VERSION 3.18) | ||
|
||
set(SOURCE_CPP src.cpp) | ||
|
||
add_library(${PROJECT_NAME} STATIC ${SOURCE_CPP} ${SOURCE_INC}) | ||
project(project_library) | ||
|
||
add_library(${PROJECT_NAME} STATIC src.cpp) | ||
# target_compile_definitions(${PROJECT_NAME} PRIVATE ABC=1 INTERFACE XYZ=2) |
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
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,7 +1,5 @@ | ||
project(project_library) | ||
|
||
cmake_minimum_required (VERSION 3.18) | ||
|
||
set(SOURCE_CPP src.cpp) | ||
|
||
add_library(${PROJECT_NAME} SHARED ${SOURCE_CPP} ${SOURCE_INC}) | ||
project(project_library) | ||
|
||
add_library(${PROJECT_NAME} SHARED src.cpp) |
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
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
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,6 +1,7 @@ | ||
cmake_minimum_required (VERSION 3.18) | ||
|
||
project(project_library) | ||
|
||
set(SOURCE_CPP src.cpp) | ||
|
||
add_library(${PROJECT_NAME} STATIC ${SOURCE_CPP} ${SOURCE_INC}) | ||
add_library(${PROJECT_NAME} STATIC src.cpp) | ||
|
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
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
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,7 +1,8 @@ | ||
cmake_minimum_required (VERSION 3.18) | ||
|
||
project(project_library) | ||
|
||
|
||
set(SOURCE_CPP src.cpp) | ||
|
||
add_library(${PROJECT_NAME} STATIC ${SOURCE_CPP} ${SOURCE_INC}) | ||
add_library(${PROJECT_NAME} STATIC src.cpp) | ||
|
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
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
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,7 +1,8 @@ | ||
cmake_minimum_required (VERSION 3.18) | ||
|
||
project(project_library) | ||
|
||
|
||
set(SOURCE_CPP src.cpp) | ||
|
||
add_library(${PROJECT_NAME} STATIC ${SOURCE_CPP} ${SOURCE_INC}) | ||
add_library(${PROJECT_NAME} STATIC src.cpp) | ||
|
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
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,7 +1,7 @@ | ||
project(project_library) | ||
cmake_minimum_required (VERSION 3.18) | ||
|
||
project(project_library) | ||
|
||
set(SOURCE_CPP src.cpp) | ||
|
||
add_library(${PROJECT_NAME} STATIC ${SOURCE_CPP} ${SOURCE_INC}) | ||
add_library(${PROJECT_NAME} STATIC src.cpp) | ||
|
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
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
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
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,24 @@ | ||
{ | ||
"version": 3, | ||
"cmakeMinimumRequired": { | ||
"major": 3, | ||
"minor": 19, | ||
"patch": 0 | ||
}, | ||
"configurePresets": [ | ||
{ | ||
"name": "default", | ||
"description": "Base preset for library developers", | ||
"binaryDir": "${sourceDir}/build" | ||
}, | ||
{ | ||
"name": "dev-werror", | ||
"description": "Linux preset for library developers", | ||
"hidden": false, | ||
"inherits": "default", | ||
"cacheVariables": { | ||
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion -Wcast-align -Wcast-qual -Wnull-dereference -Woverloaded-virtual -Wformat=2 -Werror" | ||
} | ||
} | ||
] | ||
} |
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
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
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
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 @@ | ||
.run.sh.* |
Oops, something went wrong.