summaryrefslogtreecommitdiffstats
path: root/Help/guide/tutorial/Step11
diff options
context:
space:
mode:
Diffstat (limited to 'Help/guide/tutorial/Step11')
-rw-r--r--Help/guide/tutorial/Step11/CMakeLists.txt6
-rw-r--r--Help/guide/tutorial/Step11/License.txt2
-rw-r--r--Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt5
-rw-r--r--Help/guide/tutorial/Step11/tutorial.cxx1
4 files changed, 9 insertions, 5 deletions
diff --git a/Help/guide/tutorial/Step11/CMakeLists.txt b/Help/guide/tutorial/Step11/CMakeLists.txt
index 1044748..046bfc9 100644
--- a/Help/guide/tutorial/Step11/CMakeLists.txt
+++ b/Help/guide/tutorial/Step11/CMakeLists.txt
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.15)
# set the project name and version
project(Tutorial VERSION 1.0)
+# specify the C++ standard
add_library(tutorial_compiler_flags INTERFACE)
target_compile_features(tutorial_compiler_flags INTERFACE cxx_std_11)
@@ -31,7 +32,7 @@ add_subdirectory(MathFunctions)
# add the executable
add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC MathFunctions)
+target_link_libraries(Tutorial PUBLIC MathFunctions tutorial_compiler_flags)
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
@@ -46,7 +47,7 @@ install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
# enable testing
-enable_testing()
+include(CTest)
# does the application run
add_test(NAME Runs COMMAND Tutorial 25)
@@ -74,6 +75,7 @@ do_test(Tutorial 25 "25 is 5")
do_test(Tutorial -25 "-25 is (-nan|nan|0)")
do_test(Tutorial 0.0001 "0.0001 is 0.01")
+# setup installer
include(InstallRequiredSystemLibraries)
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
diff --git a/Help/guide/tutorial/Step11/License.txt b/Help/guide/tutorial/Step11/License.txt
index c62d00b..85760e5 100644
--- a/Help/guide/tutorial/Step11/License.txt
+++ b/Help/guide/tutorial/Step11/License.txt
@@ -1,2 +1,2 @@
This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
+CMake/Tutorial/Step9...
diff --git a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt
index 0d287ca..a60fb63 100644
--- a/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step11/MathFunctions/CMakeLists.txt
@@ -47,13 +47,14 @@ endif()
target_link_libraries(MathFunctions PUBLIC tutorial_compiler_flags)
# define the symbol stating we are using the declspec(dllexport) when
-#building on windows
+# building on windows
target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
-# install rules
+# install libs
set(installable_libs MathFunctions tutorial_compiler_flags)
if(TARGET SqrtLibrary)
list(APPEND installable_libs SqrtLibrary)
endif()
install(TARGETS ${installable_libs} DESTINATION lib)
+# install include headers
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/Step11/tutorial.cxx b/Help/guide/tutorial/Step11/tutorial.cxx
index a4f44d5..37a0333 100644
--- a/Help/guide/tutorial/Step11/tutorial.cxx
+++ b/Help/guide/tutorial/Step11/tutorial.cxx
@@ -1,5 +1,6 @@
// A simple program that computes the square root of a number
#include <iostream>
+#include <sstream>
#include <string>
#include "MathFunctions.h"