summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorBetsy McPhail <betsy.mcphail@kitware.com>2020-01-08 17:55:36 (GMT)
committerBetsy McPhail <betsy.mcphail@kitware.com>2020-01-10 16:38:00 (GMT)
commitcf2afb10653eb0705760e07f1113aa710ae7e6c3 (patch)
treed5dd0307ca29f351d6dadfff9aa16a00d07a5fe8 /Help
parent77b515f3eb0494721824e7ee47e32621b947c67f (diff)
downloadCMake-cf2afb10653eb0705760e07f1113aa710ae7e6c3.zip
CMake-cf2afb10653eb0705760e07f1113aa710ae7e6c3.tar.gz
CMake-cf2afb10653eb0705760e07f1113aa710ae7e6c3.tar.bz2
Tutorial: Remove 'Consumer' example
This example was incomplete and did not follow the format of the tutorial.
Diffstat (limited to 'Help')
-rw-r--r--Help/guide/tutorial/Consumer/CMakeLists.txt51
-rw-r--r--Help/guide/tutorial/Consumer/Config.cmake.in14
-rw-r--r--Help/guide/tutorial/Consumer/consumer.cxx11
3 files changed, 0 insertions, 76 deletions
diff --git a/Help/guide/tutorial/Consumer/CMakeLists.txt b/Help/guide/tutorial/Consumer/CMakeLists.txt
deleted file mode 100644
index a0e4598..0000000
--- a/Help/guide/tutorial/Consumer/CMakeLists.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-cmake_minimum_required(VERSION 3.10)
-
-if(NOT DEFINED CMAKE_CXX_STANDARD)
- set(CMAKE_CXX_STANDARD 11)
- set(CMAKE_CXX_STANDARD_REQUIRED True)
-endif()
-
-
-function(find_external_dependency name)
- set(${name}_ROOT "" CACHE PATH "Root directory to find ${name}")
- mark_as_advanced(${name}_DIR)
- find_package(${name} PATHS ${${name}_ROOT} REQUIRED)
-endfunction()
-
-
-project(Consumer)
-
-find_external_dependency(MathFunctions)
-
-add_library(consumer consumer.cxx)
-target_link_libraries(consumer PUBLIC MathFunctions)
-
-# install the consumer library
-install(TARGETS consumer DESTINATION bin EXPORT ConsumerTargets)
-
-# install the configuration targets
-install(EXPORT ConsumerTargets
- FILE ConsumerTargets.cmake
- DESTINATION lib/cmake/Consumer
-)
-
-include(CMakePackageConfigHelpers)
-# generate the config file that is includes the exports
-configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
- "${CMAKE_CURRENT_BINARY_DIR}/ConsumerConfig.cmake"
- INSTALL_DESTINATION "lib/cmake/example"
- NO_SET_AND_CHECK_MACRO
- NO_CHECK_REQUIRED_COMPONENTS_MACRO
- )
-
-# install the configuration file
-install(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/ConsumerConfig.cmake
- DESTINATION lib/cmake/Consumer
- )
-
-# generate the export targets for the build tree
-# needs to be after the install(TARGETS ) command
-export(EXPORT ConsumerTargets
- FILE "${CMAKE_CURRENT_BINARY_DIR}/ConsumerTargets.cmake"
-)
diff --git a/Help/guide/tutorial/Consumer/Config.cmake.in b/Help/guide/tutorial/Consumer/Config.cmake.in
deleted file mode 100644
index 0b3f1e4..0000000
--- a/Help/guide/tutorial/Consumer/Config.cmake.in
+++ /dev/null
@@ -1,14 +0,0 @@
-
-@PACKAGE_INIT@
-
-include(CMakeFindDependencyMacro)
-
-function(find_external_dependency name)
- set(${name}_ROOT "" CACHE PATH "Root directory to find ${name}")
- mark_as_advanced(${name}_DIR)
- find_dependency(${name} PATHS ${${name}_ROOT} REQUIRED)
-endfunction()
-
-find_external_dependency(MathFunctions)
-
-include ( "${CMAKE_CURRENT_LIST_DIR}/ConsumerTargets.cmake" )
diff --git a/Help/guide/tutorial/Consumer/consumer.cxx b/Help/guide/tutorial/Consumer/consumer.cxx
deleted file mode 100644
index ae7877b..0000000
--- a/Help/guide/tutorial/Consumer/consumer.cxx
+++ /dev/null
@@ -1,11 +0,0 @@
-// A simple function that computes the square root of a number
-#include <iostream>
-#include <sstream>
-#include <string>
-
-#include "MathFunctions.h"
-
-double string_square_root(std::string const& value)
-{
- return mathfunctions::sqrt(std::stod(value));
-}