summaryrefslogtreecommitdiffstats
path: root/Help/guide/tutorial/Step8
diff options
context:
space:
mode:
authorBetsy McPhail <betsy.mcphail@kitware.com>2019-06-18 14:49:40 (GMT)
committerBrad King <brad.king@kitware.com>2019-06-19 12:57:12 (GMT)
commiteef3e020c21d2fdba19aab0daf1b99f8de0a16fe (patch)
tree30c79204ed261551c611d6f1f159ef682c8b2b74 /Help/guide/tutorial/Step8
parent862cfc0e6c3f275db73281f3b9b989704251ab6a (diff)
downloadCMake-eef3e020c21d2fdba19aab0daf1b99f8de0a16fe.zip
CMake-eef3e020c21d2fdba19aab0daf1b99f8de0a16fe.tar.gz
CMake-eef3e020c21d2fdba19aab0daf1b99f8de0a16fe.tar.bz2
Help: Populate tutorial guide text
Migrate tutorial text from individual `directions.txt` files to the main tutorial document. Add some comments to source code to provide anchors for inclusion.
Diffstat (limited to 'Help/guide/tutorial/Step8')
-rw-r--r--Help/guide/tutorial/Step8/CMakeLists.txt3
-rw-r--r--Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt1
-rw-r--r--Help/guide/tutorial/Step8/directions.txt38
-rw-r--r--Help/guide/tutorial/Step8/tutorial.cxx3
4 files changed, 6 insertions, 39 deletions
diff --git a/Help/guide/tutorial/Step8/CMakeLists.txt b/Help/guide/tutorial/Step8/CMakeLists.txt
index 03dc7c0..86725e8 100644
--- a/Help/guide/tutorial/Step8/CMakeLists.txt
+++ b/Help/guide/tutorial/Step8/CMakeLists.txt
@@ -3,7 +3,7 @@ project(Tutorial)
set(CMAKE_CXX_STANDARD 14)
-# the version number.
+# set the version number
set(Tutorial_VERSION_MAJOR 1)
set(Tutorial_VERSION_MINOR 0)
@@ -74,6 +74,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/Step8/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt
index dc3eb98..3c3a816 100644
--- a/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step8/MathFunctions/CMakeLists.txt
@@ -25,5 +25,6 @@ target_include_directories(MathFunctions
${CMAKE_CURRENT_BINARY_DIR}
)
+# install rules
install(TARGETS MathFunctions DESTINATION lib)
install(FILES MathFunctions.h DESTINATION include)
diff --git a/Help/guide/tutorial/Step8/directions.txt b/Help/guide/tutorial/Step8/directions.txt
deleted file mode 100644
index 588d9c6..0000000
--- a/Help/guide/tutorial/Step8/directions.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-# Adding Support for a Dashboard #
-
-Adding support for submitting our test results to a dashboard is very easy. We
-already defined a number of tests for our project in the earlier steps of this
-tutorial. We just have to run those tests and submit them to a dashboard. To
-include support for dashboards we include the CTest module in our top-level
-CMakeLists.txt.
-
-Replace:
- # enable testing
- enable_testing()
-
-With:
- # enable dashboard scripting
- include(CTest)
-
-The CTest module will automatically call enable_testing(), so
-we can remove it from our CMake files.
-
-We will also need to create a CTestConfig.cmake file where we can specify the
-name of the project and where to submit the dashboard.
-
- set(CTEST_PROJECT_NAME "CMakeTutorial")
- set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
-
- set(CTEST_DROP_METHOD "http")
- set(CTEST_DROP_SITE "my.cdash.org/")
- set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
- set(CTEST_DROP_SITE_CDASH TRUE)
-
-CTest will read in this file when it runs. To create a simple dashboard you can
-run cmake or cmake-gui to configure the project, but do not build it yet.
-Instead, change directory to the binary tree, and then run:
- 'ctest [-VV] –D Experimental'. On Windows, build the EXPERIMENTAL target.
-
-Ctest will build and test the project and submit results to the Kitware public
-dashboard. The results of your dashboard will be uploaded to Kitware's public
-dashboard here: https://my.cdash.org/index.php?project=CMakeTutorial.
diff --git a/Help/guide/tutorial/Step8/tutorial.cxx b/Help/guide/tutorial/Step8/tutorial.cxx
index c2b89df..8156a9c 100644
--- a/Help/guide/tutorial/Step8/tutorial.cxx
+++ b/Help/guide/tutorial/Step8/tutorial.cxx
@@ -5,6 +5,7 @@
#include "TutorialConfig.h"
+// should we include the MathFunctions header?
#ifdef USE_MYMATH
# include "MathFunctions.h"
#endif
@@ -12,6 +13,7 @@
int main(int argc, char* argv[])
{
if (argc < 2) {
+ // report version
std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
<< Tutorial_VERSION_MINOR << std::endl;
std::cout << "Usage: " << argv[0] << " number" << std::endl;
@@ -20,6 +22,7 @@ int main(int argc, char* argv[])
double inputValue = std::stod(argv[1]);
+ // which square root function should we use?
#ifdef USE_MYMATH
double outputValue = mysqrt(inputValue);
#else