summaryrefslogtreecommitdiffstats
path: root/Help/guide/tutorial/Selecting Static or Shared Libraries.rst
diff options
context:
space:
mode:
authorChris Mahoney <chris.mahoney@kitware.com>2023-06-23 14:48:56 (GMT)
committerChris Mahoney <chris.mahoney@kitware.com>2023-07-17 15:22:03 (GMT)
commit5e56300742c2f5232c4a7f8cc67bf34e27a3722a (patch)
tree0ae17172e16ebb8f4dadfa94648de794426889a4 /Help/guide/tutorial/Selecting Static or Shared Libraries.rst
parent93289830eaac4ddbf6039f8e46316c2de9105bbf (diff)
downloadCMake-5e56300742c2f5232c4a7f8cc67bf34e27a3722a.zip
CMake-5e56300742c2f5232c4a7f8cc67bf34e27a3722a.tar.gz
CMake-5e56300742c2f5232c4a7f8cc67bf34e27a3722a.tar.bz2
Tutorial: Refactor Step 10
Diffstat (limited to 'Help/guide/tutorial/Selecting Static or Shared Libraries.rst')
-rw-r--r--Help/guide/tutorial/Selecting Static or Shared Libraries.rst13
1 files changed, 12 insertions, 1 deletions
diff --git a/Help/guide/tutorial/Selecting Static or Shared Libraries.rst b/Help/guide/tutorial/Selecting Static or Shared Libraries.rst
index 504e42f..a2f5e2a 100644
--- a/Help/guide/tutorial/Selecting Static or Shared Libraries.rst
+++ b/Help/guide/tutorial/Selecting Static or Shared Libraries.rst
@@ -44,7 +44,18 @@ SqrtLibrary to be ``True`` when building shared libraries.
:caption: MathFunctions/CMakeLists.txt
:name: MathFunctions/CMakeLists.txt-POSITION_INDEPENDENT_CODE
:language: cmake
- :lines: 37-42
+ :start-at: # state that SqrtLibrary need PIC when the default is shared libraries
+ :end-at: )
+
+Define ``EXPORTING_MYMATH`` stating we are using ``declspec(dllexport)`` when
+building on Windows.
+
+.. literalinclude:: Step11/MathFunctions/CMakeLists.txt
+ :caption: MathFunctions/CMakeLists.txt
+ :name: MathFunctions/CMakeLists.txt-dll-export
+ :language: cmake
+ :start-at: # define the symbol stating we are using the declspec(dllexport) when
+ :end-at: target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
**Exercise**: We modified ``MathFunctions.h`` to use dll export defines.
Using CMake documentation can you find a helper module to simplify this?