From a94a4c12e159cce602cf44bf11c6e7087e957892 Mon Sep 17 00:00:00 2001 From: "betsy.mcphail" Date: Thu, 7 Sep 2023 10:57:19 -0400 Subject: Tutorial: Fix-up typos and inconsistencies * Fix typo in Step 2 * Fix incorrect code referenced in Step 3, TODO 7. Update comments in MathFunctions/CMakeLists.txt to unique strings. * Resolve inconsistencies between steps in MathFunctions/CMakeLists.txt --- .../tutorial/Adding Usage Requirements for a Library.rst | 12 +++++------- Help/guide/tutorial/Adding a Library.rst | 2 +- Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt | 3 +++ Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt | 3 +++ Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt | 3 +++ Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt | 3 +++ Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt | 2 +- Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt | 7 ++++--- Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt | 5 +++-- Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt | 4 +++- Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt | 3 ++- Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt | 3 ++- Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt | 3 +++ 13 files changed, 36 insertions(+), 17 deletions(-) diff --git a/Help/guide/tutorial/Adding Usage Requirements for a Library.rst b/Help/guide/tutorial/Adding Usage Requirements for a Library.rst index 5e803f5..e7aff9c 100644 --- a/Help/guide/tutorial/Adding Usage Requirements for a Library.rst +++ b/Help/guide/tutorial/Adding Usage Requirements for a Library.rst @@ -245,10 +245,9 @@ then use :command:`target_compile_features` to add the compiler feature Finally, with our interface library set up, we need to link our -executable ``Target``, our ``MathFunctions`` library, and our ``SqrtLibrary`` -library to our new -``tutorial_compiler_flags`` library. Respectively, the code will look like -this: +executable ``Tutorial``, our ``SqrtLibrary`` library and our ``MathFunctions`` +library to our new ``tutorial_compiler_flags`` library. Respectively, the code +will look like this: .. raw:: html @@ -275,7 +274,7 @@ this: :caption: TODO 6: MathFunctions/CMakeLists.txt :name: MathFunctions-CMakeLists.txt-target_link_libraries-step4 :language: cmake - :start-after: # link our compiler flags interface library + :start-after: # link SqrtLibrary to tutorial_compiler_flags :end-before: target_link_libraries(MathFunctions .. raw:: html @@ -292,8 +291,7 @@ and this: :caption: TODO 7: MathFunctions/CMakeLists.txt :name: MathFunctions-SqrtLibrary-target_link_libraries-step4 :language: cmake - :start-after: # link our compiler flags interface library - :end-before: target_link_libraries(MathFunctions PUBLIC SqrtLibrary) + :start-after: # link MathFunctions to tutorial_compiler_flags .. raw:: html diff --git a/Help/guide/tutorial/Adding a Library.rst b/Help/guide/tutorial/Adding a Library.rst index 178334a..18ced97 100644 --- a/Help/guide/tutorial/Adding a Library.rst +++ b/Help/guide/tutorial/Adding a Library.rst @@ -184,7 +184,7 @@ Now let's use our library. In ``tutorial.cxx``, include ``MathFunctions.h``: -Lastly, replace ``sqrt`` with our library function ``mathfunctions::mysqrt``. +Lastly, replace ``sqrt`` with the wrapper function ``mathfunctions::sqrt``. .. raw:: html diff --git a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt index b221506..1654564 100644 --- a/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Complete/MathFunctions/CMakeLists.txt @@ -33,10 +33,13 @@ if(USE_MYMATH) POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS} ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # define the symbol stating we are using the declspec(dllexport) when diff --git a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt index 36b3fe1..210563a 100644 --- a/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step10/MathFunctions/CMakeLists.txt @@ -26,10 +26,13 @@ if(USE_MYMATH) ${CMAKE_CURRENT_BINARY_DIR} ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # install libs diff --git a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt index 813bf90..eacc538 100644 --- a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt @@ -31,10 +31,13 @@ if(USE_MYMATH) POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS} ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # define the symbol stating we are using the declspec(dllexport) when diff --git a/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt index 38694dd..8aa5904 100644 --- a/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step12/MathFunctions/CMakeLists.txt @@ -33,10 +33,13 @@ if(USE_MYMATH) POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS} ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # define the symbol stating we are using the declspec(dllexport) when diff --git a/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt index 0ffb9e1..ffb2f35 100644 --- a/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step3/MathFunctions/CMakeLists.txt @@ -16,7 +16,7 @@ if (USE_MYMATH) # TODO 7: Link SqrtLibrary to tutorial_compiler_flags - target_link_libraries(MathFunctions PUBLIC SqrtLibrary) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() # TODO 6: Link MathFunctions to tutorial_compiler_flags diff --git a/Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt index 48561eb..6931898 100644 --- a/Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step4/MathFunctions/CMakeLists.txt @@ -17,10 +17,11 @@ if (USE_MYMATH) mysqrt.cxx ) - # link our compiler flags interface library + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) - target_link_libraries(MathFunctions PUBLIC SqrtLibrary) + + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() -# link our compiler flags interface library +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) diff --git a/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt index 0c688f2..61b3899 100644 --- a/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step5/MathFunctions/CMakeLists.txt @@ -16,12 +16,13 @@ if (USE_MYMATH) mysqrt.cxx ) - # link our compiler flags interface library + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() -# link our compiler flags interface library +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # TODO 1: Create a variable called installable_libs that is a list of all diff --git a/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt index b1b925e..8499a51 100644 --- a/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step6/MathFunctions/CMakeLists.txt @@ -16,11 +16,13 @@ if (USE_MYMATH) mysqrt.cxx ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() -# link our compiler flags interface library +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # install libs diff --git a/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt index 897ec0e..a0b3037 100644 --- a/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt @@ -16,6 +16,7 @@ if (USE_MYMATH) mysqrt.cxx ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) # TODO 1: Include CheckCXXSourceCompiles @@ -41,7 +42,7 @@ if (USE_MYMATH) target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() -# link our compiler flags interface library +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # install libs diff --git a/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt index 872a24a..b14d180 100644 --- a/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt @@ -10,6 +10,7 @@ if (USE_MYMATH) mysqrt.cxx ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) # does this system provide the log and exp functions? @@ -45,7 +46,7 @@ target_include_directories(MathFunctions INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -# link our compiler flags interface library +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # install libs diff --git a/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt index 54cecf8..5addc6d 100644 --- a/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt +++ b/Help/guide/tutorial/Step9/MathFunctions/CMakeLists.txt @@ -25,10 +25,13 @@ if (USE_MYMATH) ${CMAKE_CURRENT_BINARY_DIR} ) + # link SqrtLibrary to tutorial_compiler_flags target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags) + target_link_libraries(MathFunctions PRIVATE SqrtLibrary) endif() +# link MathFunctions to tutorial_compiler_flags target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags) # install libs -- cgit v0.12