aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/TopicCMakeGuide.dox
diff options
context:
space:
mode:
authorGravatar Sergiu Deitsch <sergiu.deitsch@gmail.com>2016-11-22 12:25:06 +0100
committerGravatar Sergiu Deitsch <sergiu.deitsch@gmail.com>2016-11-22 12:25:06 +0100
commit5c516e4e0a1290b9a233c8f3c379fd6bde5ef9c2 (patch)
tree12433b38431660667056804b05002a104ab5545c /doc/TopicCMakeGuide.dox
parent037b46762d48fdefef538dc76f0ad9638e3dffb0 (diff)
cmake: added Eigen3::Eigen imported target
Diffstat (limited to 'doc/TopicCMakeGuide.dox')
-rw-r--r--doc/TopicCMakeGuide.dox40
1 files changed, 40 insertions, 0 deletions
diff --git a/doc/TopicCMakeGuide.dox b/doc/TopicCMakeGuide.dox
new file mode 100644
index 000000000..5362413d6
--- /dev/null
+++ b/doc/TopicCMakeGuide.dox
@@ -0,0 +1,40 @@
+namespace Eigen {
+
+/**
+
+\page TopicCMakeGuide Using %Eigen in CMake Projects
+
+%Eigen provides native CMake support which allows the library to be easily
+used in CMake projects.
+
+\note %CMake 3.0 (or later) is required to enable this functionality.
+
+%Eigen exports a CMake target called `Eigen3::Eigen` which can be imported
+using the `find_package` CMake command and used by calling
+`target_link_libraries` as in the following example:
+\code{.cmake}
+cmake_minimum_required (VERSION 3.0)
+project (myproject)
+
+find_package (Eigen3 3.3 REQUIRED)
+
+add_executable (example example.cpp)
+target_link_libraries (example Eigen3::Eigen)
+\endcode
+
+The above code snippet must be placed in a file called `CMakeLists.txt` alongside
+`example.cpp`. After running
+\code{.sh}
+$ cmake path-to-example-directory
+\endcode
+CMake will produce project files that generate an executable called `example`
+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`.
+
+
+*/
+
+}
+
+// vim: set ft=cpp.doxygen