summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitdbe99ba37d661c22e18af01ef1e0ccaa01ca0a0e (patch)
treee3558d515b7cf57a11d3b18ceae1c12ee191264e /llvm/docs
parent643f1868de57768f5eaddd1251541d1f1b5057ff (diff)
downloadbcm5719-llvm-dbe99ba37d661c22e18af01ef1e0ccaa01ca0a0e.tar.gz
bcm5719-llvm-dbe99ba37d661c22e18af01ef1e0ccaa01ca0a0e.zip
CMake: support for using LLVM from client projects with find_package.
Patch by arrowdodger! llvm-svn: 129247
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/CMake.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/docs/CMake.html b/llvm/docs/CMake.html
index fcf2972a728..6778d6b7315 100644
--- a/llvm/docs/CMake.html
+++ b/llvm/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>
<!-- *********************************************************************** -->
OpenPOWER on IntegriCloud