|
@@ -127,7 +127,7 @@ Remove this line:
|
|
|
|
|
|
</details>
|
|
</details>
|
|
|
|
|
|
-And the lines:
|
|
|
|
|
|
+And remove ``EXTRA_INCLUDES`` from ``target_include_directories``:
|
|
|
|
|
|
.. raw:: html
|
|
.. raw:: html
|
|
|
|
|
|
@@ -143,23 +143,6 @@ And the lines:
|
|
|
|
|
|
</details>
|
|
</details>
|
|
|
|
|
|
-The remaining code looks like:
|
|
|
|
-
|
|
|
|
-.. raw:: html
|
|
|
|
-
|
|
|
|
- <details><summary>Click to show/hide the resulting code</summary>
|
|
|
|
-
|
|
|
|
-.. literalinclude:: Step4/CMakeLists.txt
|
|
|
|
- :caption: Remaining code after removing EXTRA_INCLUDES
|
|
|
|
- :name: CMakeLists.txt-after-removing-EXTRA_INCLUDES
|
|
|
|
- :language: cmake
|
|
|
|
- :start-after: add_subdirectory(MathFunctions)
|
|
|
|
-
|
|
|
|
-.. raw:: html
|
|
|
|
-
|
|
|
|
- </details>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
Notice that with this technique, the only thing our executable target does to
|
|
Notice that with this technique, the only thing our executable target does to
|
|
use our library is call :command:`target_link_libraries` with the name
|
|
use our library is call :command:`target_link_libraries` with the name
|
|
of the library target. In larger projects, the classic method of specifying
|
|
of the library target. In larger projects, the classic method of specifying
|
|
@@ -309,8 +292,8 @@ and this:
|
|
:caption: TODO 7: MathFunctions/CMakeLists.txt
|
|
:caption: TODO 7: MathFunctions/CMakeLists.txt
|
|
:name: MathFunctions-SqrtLibrary-target_link_libraries-step4
|
|
:name: MathFunctions-SqrtLibrary-target_link_libraries-step4
|
|
:language: cmake
|
|
:language: cmake
|
|
- :start-after: target_link_libraries(SqrtLibrary
|
|
|
|
- :end-before: endif()
|
|
|
|
|
|
+ :start-after: # link our compiler flags interface library
|
|
|
|
+ :end-before: target_link_libraries(MathFunctions PUBLIC SqrtLibrary)
|
|
|
|
|
|
.. raw:: html
|
|
.. raw:: html
|
|
|
|
|