summaryrefslogtreecommitdiffstats
path: root/Help/guide
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2019-07-23 17:41:00 (GMT)
committerBrad King <brad.king@kitware.com>2019-07-25 11:34:41 (GMT)
commit98164b707f4024c4c2b2a6f31c7d4e51eb53a9d4 (patch)
tree0b715bf84f704b16f93c4808a9f52f3311926139 /Help/guide
parenta1c6d7e9af5a241b1afa29b3f7459ee9ee4ec77a (diff)
downloadCMake-98164b707f4024c4c2b2a6f31c7d4e51eb53a9d4.zip
CMake-98164b707f4024c4c2b2a6f31c7d4e51eb53a9d4.tar.gz
CMake-98164b707f4024c4c2b2a6f31c7d4e51eb53a9d4.tar.bz2
Tutorial: MultiPackage now correctly compiles
Diffstat (limited to 'Help/guide')
-rw-r--r--Help/guide/tutorial/MultiPackage/CMakeLists.txt17
-rw-r--r--Help/guide/tutorial/MultiPackage/MathFunctions/CMakeLists.txt2
2 files changed, 13 insertions, 6 deletions
diff --git a/Help/guide/tutorial/MultiPackage/CMakeLists.txt b/Help/guide/tutorial/MultiPackage/CMakeLists.txt
index 067e807..bea611c 100644
--- a/Help/guide/tutorial/MultiPackage/CMakeLists.txt
+++ b/Help/guide/tutorial/MultiPackage/CMakeLists.txt
@@ -1,19 +1,26 @@
cmake_minimum_required(VERSION 3.3)
project(Tutorial)
-# control how we mark up Debug libraries compared to Release libraries
-set(CMAKE_DEBUG_POSTFIX "-d")
+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}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
-# the version number.
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
+if(APPLE)
+ set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
+elseif(UNIX)
+ set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
+endif()
# configure a header file to pass the version number only
configure_file(
diff --git a/Help/guide/tutorial/MultiPackage/MathFunctions/CMakeLists.txt b/Help/guide/tutorial/MultiPackage/MathFunctions/CMakeLists.txt
index 161ad64..63c0f5f 100644
--- a/Help/guide/tutorial/MultiPackage/MathFunctions/CMakeLists.txt
+++ b/Help/guide/tutorial/MultiPackage/MathFunctions/CMakeLists.txt
@@ -1,4 +1,3 @@
-
# add the library that runs
add_library(MathFunctions MathFunctions.cxx)
@@ -62,6 +61,7 @@ target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
set_property(TARGET MathFunctions PROPERTY VERSION "1.0.0")
set_property(TARGET MathFunctions PROPERTY SOVERSION "1")
+# install rules
install(TARGETS MathFunctions
DESTINATION lib
EXPORT MathFunctionsTargets)