Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llvmconfig.cmake.in make cmake installations not relocatable #12529

Closed
llvmbot opened this issue Mar 2, 2012 · 14 comments
Closed

llvmconfig.cmake.in make cmake installations not relocatable #12529

llvmbot opened this issue Mar 2, 2012 · 14 comments
Labels
bugzilla Issues migrated from bugzilla cmake Build system in general and CMake in particular

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 2, 2012

Bugzilla Link 12157
Resolution FIXED
Resolved on Mar 03, 2015 16:52
Version trunk
OS All
Blocks llvm/llvm-bugzilla-archive#15732
Reporter LLVM Bugzilla Contributor
CC @llvm-beanz,@steveire

Extended Description

the installed llvm package is not relocatable and has reference to the source tree, this problem maybe fixed using dynamic relative path calculations as follows:

line21:
set(LLVM_TOOLS_BINARY_DIR @​LLVM_TOOLS_BINARY_DIR@)

should be replaced to
set(LLVM_TOOLS_BINARY_DIR ${CMAKE_CURRENT_LIST_DIR}/../../bin)

line 34
set(LLVM_INSTALL_PREFIX @​LLVM_INSTALL_PREFIX@)

to:

set(LLVM_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/../..)

line 136:

"@LLVM_SOURCE_DIR@/cmake/modules")

to
${LLVM_INSTALL_PREFIX}/share/llvm/cmake)

@llvmbot
Copy link
Collaborator Author

llvmbot commented Mar 2, 2012

two typing mistakes, they should be instead as above
set(LLVM_TOOLS_BINARY_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../bin)

set(LLVM_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/../../..)

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 9, 2012

diff -Nur modules_orig/LLVMConfig.cmake.in modules/LLVMConfig.cmake.in
--- modules_orig/LLVMConfig.cmake.in 2011-07-30 07:52:01 +0800
+++ modules/LLVMConfig.cmake.in 2012-03-12 14:59:11 +0800
@@ -16,7 +16,7 @@

set(TARGET_TRIPLE "@TARGET_TRIPLE@")

-set(LLVM_TOOLS_BINARY_DIR @​LLVM_TOOLS_BINARY_DIR@)
+set(LLVM_TOOLS_BINARY_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../bin)

set(LLVM_ENABLE_THREADS @​LLVM_ENABLE_THREADS@)

@@ -29,7 +29,7 @@
set(LLVM_ON_UNIX @​LLVM_ON_UNIX@)
set(LLVM_ON_WIN32 @​LLVM_ON_WIN32@)

-set(LLVM_INSTALL_PREFIX @​LLVM_INSTALL_PREFIX@)
+set(LLVM_INSTALL_PREFIX ${CMAKE_CURRENT_LIST_DIR}/../../..)
set(LLVM_INCLUDE_DIRS ${LLVM_INSTALL_PREFIX}/include)
set(LLVM_LIBRARY_DIRS ${LLVM_INSTALL_PREFIX}/lib)
set(LLVM_DEFINITIONS "-D__STDC_LIMIT_MACROS" "-D__STDC_CONSTANT_MACROS")
@@ -43,7 +43,7 @@
if( NOT LLVMCONFIG_INCLUDED )
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}

  • "@LLVM_SOURCE_DIR@/cmake/modules")
  • "${LLVM_INSTALL_PREFIX}/share/llvm/cmake")
    include( LLVM-Config )
    endif()

@llvmbot
Copy link
Collaborator Author

llvmbot commented Apr 9, 2012

the above patch should fix the problem, hope to see it merged in the codebase

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jun 29, 2012

the patch
this patch resolved the relocatable problem more reasonabaly, and make the uninstall build really worked for clients.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jun 29, 2012

LLVM_TOOLS_BINARY_DIR is correct for installations and should be correct for make build systems but will not work under MSVC builds or xcode Build because they are in a per configuration dir, it's not so easy to solve this.

the patch is tested under windows and msvc.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jun 29, 2012

CMAKE_CURRENT_LIST_FILE variable is provide at least in cmake 2.6.4 version, so this should be enough?

@steveire
Copy link
Collaborator

steveire commented Feb 4, 2014

This can be closed when Brads patches are merged.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jun 6, 2014

This can be closed when Brads patches are merged.

Where are Brad's patches? There's no reference to Brad or his patches in this thread.

@steveire
Copy link
Collaborator

steveire commented Jun 6, 2014

r201048
r201049
r201050
r201053

I didn't test them though.

@llvm-beanz
Copy link
Collaborator

I think these patches were all landed. Is there anything else to be done here?

@steveire
Copy link
Collaborator

steveire commented Feb 4, 2015

Nope, this is done.

I didn't test it, but we can assume Brad is making use of them.

@steveire
Copy link
Collaborator

Any reason to keep this bug report open?

@llvm-beanz
Copy link
Collaborator

This should be all completed.

@sylvestre
Copy link
Collaborator

mentioned in issue llvm/llvm-bugzilla-archive#15732

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla cmake Build system in general and CMake in particular
Projects
None yet
Development

No branches or pull requests

4 participants