[LLVMdev] [cfe-dev] is configure+make dead yet?

Óscar Fuentes ofv at wanadoo.es
Fri Jun 29 06:07:29 PDT 2012


hume npx <humeafo at gmail.com> writes:

> Hi, Óscar:
>   nice to hear some voice on this. about LLVM_TOOLS_BINARY_DIR, yes, it
> made the installed version work only, if you'd like the uninstalled version
> to work, it should be detected as you suggested.
>
>   about LLVM_INSTALL_PREFIX the purpose is to make it really relocatable,
> eg, when installed under /lib/llvm I just later need to move the
> installation tree to /lusr/local/lib/llvm without re-run cmake and the
> time-boring build/install process, and this is especially convinient on
> Windows.

LLVM_INSTALL_PREFIX is supposed to contain the value of
CMAKE_INSTALL_PREFIX when you configured LLVM. Using it for setting
other variables is just a convenience.

> Use CMAKE_CURRENT_LIST_DIR while not the absolute predefined
> LLVM_INSTALL_PREFIX is just to give the freedom to this, if just installed and
> not moved, this will work identical to the value original absolute
> LLVM_INSTALL_PREFIX points.

I've never heard CMAKE_CURRENT_LIST_DIR until now. In fact, it was
introduced in cmake 2.8.3 while the LLVM CMake scripts require just
2.8. The solution may work indeed, but I'm always reluctant to increase
the minimum required version because there are users who can't easily
upgrade their CMake install. Let's see what Chandler says.

CMAKE_CURRENT_LIST_FILE can be used instead (just take the directory
part) but I don't know when it was introduced. In 

http://www.cmake.org/Wiki/CMake_Useful_Variables

CMAKE_CURRENT_LIST_DIR is labeled as 2.8.3 but there is no mention to
the version that introduced CMAKE_CURRENT_LIST_FILE.

> CMAKE_MODULE_PATH should be corrected for installed version,

No, it is the responsability of the user to adjust CMAKE_MODULE_PATH for
containing the directory where LLVMConfig.cmake is. See

http://llvm.org/docs/CMake.html#embedding

For an uninstalled build, the cmake scripts on the source directory are
necessary as well, so its directory is automatically added on
LLVMConfig.cmake.

> it's still
> points to the source tree location while not the install tree location, if
> you removed/moved the source tree after installation, the installed version
> will not work properly, surely this is not we wanted?

No, see again how that code block begins:

# If failed, we assume that this is an un-installed build:
if( NOT LLVMCONFIG_INCLUDED )

that means that CMAKE_MODULE_PATH is only modified for an uninstalled
build.

> as to uninstalled support, I think current script doesn'tsupport the cmake
> usage properly,

Why? Please describe a case.

> If this is needed, some further work should be made.




More information about the llvm-dev mailing list