summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorOscar Fuentes <ofv@wanadoo.es>2011-04-10 16:17:49 +0000
committerOscar Fuentes <ofv@wanadoo.es>2011-04-10 16:17:49 +0000
commit3447b4f01bd82f5b3b1c8b315a9db507fdd71b91 (patch)
tree6ed4ed13aec935ddb6b19646ed60bdea71ac130e /docs
parent64cfcefdeb05bd955659dfe07435c9ca6ae8efac (diff)
downloadllvm-3447b4f01bd82f5b3b1c8b315a9db507fdd71b91.tar.gz
llvm-3447b4f01bd82f5b3b1c8b315a9db507fdd71b91.tar.bz2
llvm-3447b4f01bd82f5b3b1c8b315a9db507fdd71b91.tar.xz
CMake: support for using LLVM from client projects with find_package.
Patch by arrowdodger! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129247 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/CMake.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/CMake.html b/docs/CMake.html
index fcf2972a72..6778d6b731 100644
--- a/docs/CMake.html
+++ b/docs/CMake.html
@@ -436,6 +436,26 @@
headers on the LLVM source directory (if we are building
out-of-source.)</p>
+ <p>Alternativaly, you can utilize CMake's <i>find_package</i>
+ functionality. Here is an equivalent variant of snippet shown above:</p>
+
+ <div class="doc_code">
+ <pre>
+ find_package(LLVM)
+
+ if( NOT LLVM_FOUND )
+ message(FATAL_ERROR "LLVM package can't be found. Set CMAKE_PREFIX_PATH variable to LLVM's installation prefix.")
+ endif()
+
+ include_directories( ${LLVM_INCLUDE_DIRS} )
+ link_directories( ${LLVM_LIBRARY_DIRS} )
+
+ llvm_map_components_to_libraries(REQ_LLVM_LIBRARIES jit native)
+
+ target_link_libraries(mycompiler ${REQ_LLVM_LIBRARIES})
+ </pre>
+ </div>
+
</div>
<!-- *********************************************************************** -->