From 971cc5d7c70069f3a50ec264bd2d5da7ece76493 Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Sat, 10 Mar 2018 22:05:33 +0100 Subject: [PATCH] Adding a few small fixes --- chapters/exporting.md | 4 ++-- chapters/smallinc.md | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/chapters/exporting.md b/chapters/exporting.md index dc54ceb..440ff4c 100644 --- a/chapters/exporting.md +++ b/chapters/exporting.md @@ -104,8 +104,8 @@ Since we've made a `ConfigVersion` file, this is a good place to install it too. configure_file(MyLibConfig.cmake.in MyLibConfig.cmake @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/MyLibConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/Minuit2ConfigVersion.cmake" - DESTINATION lib/cmake/MyLib - ) + DESTINATION lib/cmake/MyLib + ) ``` That's it! Now once you install a package, there will be files in `lib/cmake/MyLib` that CMake will search for (specifically, `MyLibConfig.cmake` and `MyLibConfigVersion.cmake`), and the targets file that config uses should be there as well. diff --git a/chapters/smallinc.md b/chapters/smallinc.md index cf4e13e..824635f 100644 --- a/chapters/smallinc.md +++ b/chapters/smallinc.md @@ -67,3 +67,6 @@ execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD There are several different methods to get CMake to download data, either at configure time or compile time. The latter is build directly into CMake with the x command. If you prefer configure time, see the [Crascit/DownloadProject](https://github.com/Crascit/DownloadProject) repository for a drop-in solution. Submodules work so well, though, that I've discontinued most of the downloads for things like GoogleTest and moved them to submodules. Auto downloads are harder to mimic if you don't have internet access, and they are often implemented in the build directory, wasting time and space if you have multiple build directories. +{% hint style='working' %} +A new module in CMake 3.11, [FetchContent](https://cmake.org/cmake/help/v3.11/module/FetchContent.html) will build in this feature into CMake, stay tuned! +{% endhint %}