diff options
author | Sergiu Deitsch <sergiu.deitsch@gmail.com> | 2016-11-30 15:41:38 +0100 |
---|---|---|
committer | Sergiu Deitsch <sergiu.deitsch@gmail.com> | 2016-11-30 15:41:38 +0100 |
commit | 3440b46e2fead97d0ae4fc2f9c499727278a739f (patch) | |
tree | fde3fd05de4cdf241ff02ea50681a902acd88857 /doc/TopicCMakeGuide.dox | |
parent | 5c516e4e0a1290b9a233c8f3c379fd6bde5ef9c2 (diff) |
doc: mention the NO_MODULE option and target availability
(grafted from 65f09be8d2aaeda054cce574ea14a74b00507011
)
Diffstat (limited to 'doc/TopicCMakeGuide.dox')
-rw-r--r-- | doc/TopicCMakeGuide.dox | 11 |
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 */ |