summaryrefslogtreecommitdiffstats
path: root/Help/guide/tutorial/MultiPackage
diff options
context:
space:
mode:
authorBetsy McPhail <betsy.mcphail@kitware.com>2019-07-18 19:40:25 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-19 15:49:05 (GMT)
commit6f6a32a0f601688da24e1737509a0b6e1ed4f63f (patch)
treea8a6f89b0a8126172337f543ebaca43d8a0469c2 /Help/guide/tutorial/MultiPackage
parent6a35d630dce6e9da6115cc4acb3393ce62a017ad (diff)
downloadCMake-6f6a32a0f601688da24e1737509a0b6e1ed4f63f.zip
CMake-6f6a32a0f601688da24e1737509a0b6e1ed4f63f.tar.gz
CMake-6f6a32a0f601688da24e1737509a0b6e1ed4f63f.tar.bz2
Tutorial: Improve Step 9
* Move USE_MYMATH from configured header to target_compile_definitions
Diffstat (limited to 'Help/guide/tutorial/MultiPackage')
-rw-r--r--Help/guide/tutorial/MultiPackage/MathFunctions/CMakeLists.txt5
-rw-r--r--Help/guide/tutorial/MultiPackage/tutorial.cxx1
2 files changed, 3 insertions, 3 deletions
diff --git a/Help/guide/tutorial/MultiPackage/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/MultiPackage/MathFunctions/CMakeLists.txt
index 483e20c..a2df2a7 100644
--- a/Help/guide/tutorial/MultiPackage/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/MultiPackage/MathFunctions/CMakeLists.txt
@@ -13,6 +13,8 @@ target_include_directories(MathFunctions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
if(USE_MYMATH)
+ target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
+
# first we add the executable that generates the table
add_executable(MakeTable MakeTable.cxx)
@@ -34,6 +36,7 @@ if(USE_MYMATH)
${CMAKE_CURRENT_BINARY_DIR}
)
+ # state that SqrtLibrary need PIC when the default is shared libraries
set_target_properties(SqrtLibrary PROPERTIES
POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
)
@@ -41,8 +44,6 @@ if(USE_MYMATH)
target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
endif()
-target_compile_definitions(MathFunctions PRIVATE "$<$<BOOL:${USE_MYMATH}>:USE_MYMATH>")
-
# define the symbol stating we are using the declspec(dllexport) when
# building on windows
target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
diff --git a/Help/guide/tutorial/MultiPackage/tutorial.cxx b/Help/guide/tutorial/MultiPackage/tutorial.cxx
index ddc6364..f97805b 100644
--- a/Help/guide/tutorial/MultiPackage/tutorial.cxx
+++ b/Help/guide/tutorial/MultiPackage/tutorial.cxx
@@ -1,6 +1,5 @@
// A simple program that computes the square root of a number
#include <iostream>
-#include <sstream>
#include <string>
#include "MathFunctions.h"