diff options
author | Oscar Fuentes <ofv@wanadoo.es> | 2011-04-10 16:17:49 +0000 |
---|---|---|
committer | Oscar Fuentes <ofv@wanadoo.es> | 2011-04-10 16:17:49 +0000 |
commit | 3447b4f01bd82f5b3b1c8b315a9db507fdd71b91 (patch) | |
tree | 6ed4ed13aec935ddb6b19646ed60bdea71ac130e /docs | |
parent | 64cfcefdeb05bd955659dfe07435c9ca6ae8efac (diff) | |
download | external_llvm-3447b4f01bd82f5b3b1c8b315a9db507fdd71b91.zip external_llvm-3447b4f01bd82f5b3b1c8b315a9db507fdd71b91.tar.gz external_llvm-3447b4f01bd82f5b3b1c8b315a9db507fdd71b91.tar.bz2 |
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.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/CMake.html b/docs/CMake.html index fcf2972..6778d6b 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> <!-- *********************************************************************** --> |