summaryrefslogtreecommitdiffstats
path: root/Help/guide/tutorial/Step10/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-20 13:16:35 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-08-20 13:19:22 (GMT)
commitb80417f0fd1491d1c0f5d57019b47d4c13729545 (patch)
treee55ae56966bd154cec46c56184a9f4a6f1b09d7e /Help/guide/tutorial/Step10/CMakeLists.txt
parent8c1d3e3b79fb921bfada3b19e6bb4115da4a4e6e (diff)
parent6f6a32a0f601688da24e1737509a0b6e1ed4f63f (diff)
downloadCMake-b80417f0fd1491d1c0f5d57019b47d4c13729545.zip
CMake-b80417f0fd1491d1c0f5d57019b47d4c13729545.tar.gz
CMake-b80417f0fd1491d1c0f5d57019b47d4c13729545.tar.bz2
Merge topic 'cmake-tutorial'
6f6a32a0f6 Tutorial: Improve Step 9 6a35d630dc Tutorial: Improve Step 8 61d4d990d6 Tutorial: Improve Step 7 a36731c634 Tutorial: Improve Step 6 df9cdf629c Tutorial: Improve Step 5 442c0f0d46 Tutorial: Improve Step 4 bc64401c3d Tutorial: Improve Step 3 49ce4d6ff4 Tutorial: Improve Step 2 ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3528
Diffstat (limited to 'Help/guide/tutorial/Step10/CMakeLists.txt')
-rw-r--r--Help/guide/tutorial/Step10/CMakeLists.txt20
1 files changed, 8 insertions, 12 deletions
diff --git a/Help/guide/tutorial/Step10/CMakeLists.txt b/Help/guide/tutorial/Step10/CMakeLists.txt
index 25bc0c1..34ae70c 100644
--- a/Help/guide/tutorial/Step10/CMakeLists.txt
+++ b/Help/guide/tutorial/Step10/CMakeLists.txt
@@ -1,13 +1,12 @@
-cmake_minimum_required(VERSION 3.3)
-project(Tutorial)
+cmake_minimum_required(VERSION 3.10)
+# set the project name and version
+project(Tutorial VERSION 1.0)
+
+# specify the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
-# Set the version number
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
-
# control where the static and shared libraries are built so that on windows
# we don't need to tinker with the path to run the executable
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
@@ -17,17 +16,14 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
# configure a header file to pass the version number only
-configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
+configure_file(TutorialConfig.h.in TutorialConfig.h)
# add the MathFunctions library
add_subdirectory(MathFunctions)
# add the executable
add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial MathFunctions)
+target_link_libraries(Tutorial PUBLIC MathFunctions)
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
@@ -42,7 +38,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)