summaryrefslogtreecommitdiffstats
path: root/Help/guide/tutorial/Step11/MathFunctions
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/Step11/MathFunctions
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/Step11/MathFunctions')
-rw-r--r--Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt5
1 files changed, 3 insertions, 2 deletions
diff --git a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt
index df9f4df..e6cb8ba 100644
--- a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt
@@ -11,6 +11,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)
target_link_libraries(MakeTable tutorial_compiler_flags)
@@ -33,13 +35,12 @@ 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}
)
target_link_libraries(SqrtLibrary PUBLIC tutorial_compiler_flags)
-
- target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
endif()