Skip to content

Commit

Permalink
Adapt chapter 1 to book
Browse files Browse the repository at this point in the history
  • Loading branch information
bernedom committed Jun 3, 2024
1 parent 1a04aec commit d4b4911
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion chapter01/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ if(CHAPTER1_PRINT_LANGUAGE_EXAMPLES)
list(APPEND MYLIST "xyz")
message(STATUS "Chapter1: MYLIST is: ${MYLIST}")

list(FIND MYLIST def ABC_INDEX)
#find the string abc in MYLIST and store it in ABC_INDEX
list(FIND MYLIST abc ABC_INDEX)
list(GET MYLIST ${ABC_INDEX} ABC)
message(STATUS "Chapter1: Index of 'def' in MYLIST is ${ABC_INDEX} the value at the index is '${ABC}'")

Expand Down
4 changes: 2 additions & 2 deletions chapter01/simple_executable/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ project(
LANGUAGES CXX)

# Add an executable target named `chapter1`
add_executable(chapter1)
add_executable(ch1_simple_executable)
# Add sources to the target `chapter1`
target_sources(chapter1 PRIVATE src/main.cpp)
target_sources(ch1_simple_executable PRIVATE src/main.cpp)

0 comments on commit d4b4911

Please sign in to comment.