summaryrefslogtreecommitdiffstats
path: root/Help/guide/tutorial/Step7
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/Step7
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/Step7')
-rw-r--r--Help/guide/tutorial/Step7/CMakeLists.txt2
-rw-r--r--Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt1
-rw-r--r--Help/guide/tutorial/Step7/directions.txt40
-rw-r--r--Help/guide/tutorial/Step7/tutorial.cxx3
4 files changed, 5 insertions, 41 deletions
diff --git a/Help/guide/tutorial/Step7/CMakeLists.txt b/Help/guide/tutorial/Step7/CMakeLists.txt
index 33aa039..17e6a60 100644
--- a/Help/guide/tutorial/Step7/CMakeLists.txt
+++ b/Help/guide/tutorial/Step7/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)
diff --git a/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt
index dc3eb98..3c3a816 100644
--- a/Help/guide/tutorial/Step7/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/Step7/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/Step7/directions.txt b/Help/guide/tutorial/Step7/directions.txt
deleted file mode 100644
index 7d7c2ea..0000000
--- a/Help/guide/tutorial/Step7/directions.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-# Building an Installer #
-
-Next suppose that we want to distribute our project to other people so that they
-can use it. We want to provide both binary and source distributions on a variety
-of platforms. This is a little different from the install we did previously in
-the Installing and Testing section (Step 4), where we were installing the
-binaries that we had built from the source code. In this example we will be
-building installation packages that support binary installations and package
-management features. To accomplish this we will use CPack to create platform
-specific installers. Specifically we need to add a few lines to the bottom of
-our top-level CMakeLists.txt file.
-
- include(InstallRequiredSystemLibraries)
- set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
- set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
- set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
- include(CPack)
-
-That is all there is to it. We start by including InstallRequiredSystemLibraries.
-This module will include any runtime libraries that are needed by the project
-for the current platform. Next we set some CPack variables to where we have
-stored the license and version information for this project. The version
-information makes use of the variables we set earlier in this tutorial. Finally
-we include the CPack module which will use these variables and some other
-properties of the system you are on to setup an installer.
-
-The next step is to build the project in the usual manner and then run CPack
-on it. To build a binary distribution you would run:
-
- cpack
-
-To create a source distribution you would type:
-
- cpack -C CPackSourceConfig.cmake
-
-Alternatively, run “make package” or right click the Package target and
-“Build Project” from an IDE.
-
-Run the installer executable found in the binary directory. Then run the
-installed executable and verify that it works.
diff --git a/Help/guide/tutorial/Step7/tutorial.cxx b/Help/guide/tutorial/Step7/tutorial.cxx
index c2b89df..8156a9c 100644
--- a/Help/guide/tutorial/Step7/tutorial.cxx
+++ b/Help/guide/tutorial/Step7/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