aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/TopicCMakeGuide.dox
diff options
context:
space:
mode:
authorGravatar Sergiu Deitsch <sergiu.deitsch@gmail.com>2016-11-30 15:41:38 +0100
committerGravatar Sergiu Deitsch <sergiu.deitsch@gmail.com>2016-11-30 15:41:38 +0100
commit3440b46e2fead97d0ae4fc2f9c499727278a739f (patch)
treefde3fd05de4cdf241ff02ea50681a902acd88857 /doc/TopicCMakeGuide.dox
parent5c516e4e0a1290b9a233c8f3c379fd6bde5ef9c2 (diff)
doc: mention the NO_MODULE option and target availability
Diffstat (limited to 'doc/TopicCMakeGuide.dox')
-rw-r--r--doc/TopicCMakeGuide.dox11
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/TopicCMakeGuide.dox b/doc/TopicCMakeGuide.dox
index 5362413d6..a540db68e 100644
--- a/doc/TopicCMakeGuide.dox
+++ b/doc/TopicCMakeGuide.dox
@@ -16,7 +16,7 @@ using the `find_package` CMake command and used by calling
cmake_minimum_required (VERSION 3.0)
project (myproject)
-find_package (Eigen3 3.3 REQUIRED)
+find_package (Eigen3 3.3 REQUIRED NO_MODULE)
add_executable (example example.cpp)
target_link_libraries (example Eigen3::Eigen)
@@ -32,6 +32,15 @@ which requires at least version 3.3 of %Eigen. Here, `path-to-example-directory`
is the path to the directory that contains both `CMakeLists.txt` and
`example.cpp`.
+If the `REQUIRED` option is omitted when locating %Eigen using
+`find_package`, one can check whether the package was found as follows:
+\code{.cmake}
+find_package (Eigen3 3.3 NO_MODULE)
+
+if (TARGET Eigen3::Eigen)
+ # Use the imported target
+endif (TARGET Eigen3::Eigen)
+\endcode
*/