From dbe99ba37d661c22e18af01ef1e0ccaa01ca0a0e Mon Sep 17 00:00:00 2001 From: Oscar Fuentes Date: Sun, 10 Apr 2011 16:17:49 +0000 Subject: CMake: support for using LLVM from client projects with find_package. Patch by arrowdodger! llvm-svn: 129247 --- llvm/docs/CMake.html | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'llvm/docs') 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.)

+

Alternativaly, you can utilize CMake's find_package + functionality. Here is an equivalent variant of snippet shown above:

+ +
+
+    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})
+    
+
+ -- cgit v1.2.3