> > *hi,Óscar:* > * * > >Why? Please describe a case. >> >I need to do some futher experiment and to see whether I have been > wrong. >Since I touch this problem several months ago, so I did some test using the 3.2svn, the reason why uninstalled build 'cmake not work lies in set(LLVM_INSTALL_PREFIX @LLVM_INSTALL_PREFIX@) set(LLVM_INCLUDE_DIRS ${LLVM_INSTALL_PREFIX}/include) set(LLVM_LIBRARY_DIRS ${LLVM_INSTALL_PREFIX}/lib) LLVM_INCLUDE_DIRS and LLVM_LIBRARY_DIRS points to the user specified or install tree location, but for uninstalled version, they are non-exist yet(because not run make install), so set CMAKE_PREFIX_PATH to builddir\share\llvm\cmake and then do things as described in http://llvm.org/docs/CMake.html using find_package(LLVM) and then include_directories( ${LLVM_INCLUDE_DIRS} ) link_directories( ${LLVM_LIBRARY_DIRS} ) will cause the problem, the directory are not present for the built but uninstalled source tree.> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120629/ca472e2b/attachment.html>
*hi,Óscar:* * * *so following patch should address both the relocation problem and uninstall tree problem, not fully tested just for discussion.* * * Index: LLVMConfig.cmake.in ==================================================================--- LLVMConfig.cmake.in (revision 159425) +++ LLVMConfig.cmake.in (working copy) @@ -32,8 +32,11 @@ set(LLVM_ON_WIN32 @LLVM_ON_WIN32@) set(LLVM_INSTALL_PREFIX @LLVM_INSTALL_PREFIX@) -set(LLVM_INCLUDE_DIRS ${LLVM_INSTALL_PREFIX}/include) -set(LLVM_LIBRARY_DIRS ${LLVM_INSTALL_PREFIX}/lib) + +get_filename_component(LLVM_CURRENT_LIST_DIR CMAKE_CURRENT_LIST_FILE PATH) +set(LLVM_INCLUDE_DIRS ${LLVM_CURRENT_LIST_DIR}/../../../include) +set(LLVM_LIBRARY_DIRS ${LLVM_CURRENT_LIST_DIR}/../../../lib) + set(LLVM_DEFINITIONS "-D__STDC_LIMIT_MACROS" "-D__STDC_CONSTANT_MACROS") # We try to include using the current setting of CMAKE_MODULE_PATH, @@ -47,5 +50,7 @@ ${CMAKE_MODULE_PATH} "@LLVM_SOURCE_DIR@/cmake/modules") include( LLVM-Config ) + + set(LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS} "@LLVM_SOURCE_DIR@/include") endif() -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120629/5c64f69f/attachment.html>
hume npx <humeafo at gmail.com> writes:> *hi,Óscar:* > * > * > *so following patch should address both the relocation problem and > uninstall tree problem, not fully tested just for discussion.* > * > * > Index: LLVMConfig.cmake.in > ==================================================================> --- LLVMConfig.cmake.in (revision 159425) > +++ LLVMConfig.cmake.in (working copy) > @@ -32,8 +32,11 @@ > set(LLVM_ON_WIN32 @LLVM_ON_WIN32@) > > set(LLVM_INSTALL_PREFIX @LLVM_INSTALL_PREFIX@) > -set(LLVM_INCLUDE_DIRS ${LLVM_INSTALL_PREFIX}/include) > -set(LLVM_LIBRARY_DIRS ${LLVM_INSTALL_PREFIX}/lib) > + > +get_filename_component(LLVM_CURRENT_LIST_DIR CMAKE_CURRENT_LIST_FILE PATH) > +set(LLVM_INCLUDE_DIRS ${LLVM_CURRENT_LIST_DIR}/../../../include) > +set(LLVM_LIBRARY_DIRS ${LLVM_CURRENT_LIST_DIR}/../../../lib) > +What about LLVM_TOOLS_BINARY_DIR ? Have you checked that CMAKE_CURRENT_LIST_FILE is available for CMake 2.8.0 ?> set(LLVM_DEFINITIONS "-D__STDC_LIMIT_MACROS" "-D__STDC_CONSTANT_MACROS") > > # We try to include using the current setting of CMAKE_MODULE_PATH, > @@ -47,5 +50,7 @@ > ${CMAKE_MODULE_PATH} > "@LLVM_SOURCE_DIR@/cmake/modules") > include( LLVM-Config ) > + > + set(LLVM_INCLUDE_DIRS ${LLVM_INCLUDE_DIRS} "@LLVM_SOURCE_DIR@/include") > endif()Once you address the two questions above, please upload the patch to the bugzilla ticket you opened for this bug. Thanks!