Skip to content

Overwriting CMAKE_INSTALL_RPATH in CMakeLists.txt #1001

@ahnaf-tahmid-chowdhury

Description

@ahnaf-tahmid-chowdhury

Description
I'm encountering an issue where the CMAKE_INSTALL_RPATH variable is being overwritten in my CMake project. I have configured it to use $ORIGIN, but it seems that it's being reset to ${CMAKE_INSTALL_FULL_LIBDIR} at line 127 of the CMakeLists.txt file.

ExternalProject_Add(lapack
  PREFIX ${LAPACK_ROOT}
  URL https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.12.0.tar.gz
  CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> 
            -DBUILD_SHARED_LIBS=ON 
            -DUSE_OPTIMIZED_BLAS=ON
            -DCMAKE_INSTALL_RPATH="\$ORIGIN"
            -DBUILD_RPATH_USE_ORIGIN=ON
  DOWNLOAD_EXTRACT_TIMESTAMP true
  BUILD_BYPRODUCTS "${LAPACK_ROOT}/lib/liblapack${CMAKE_SHARED_LIBRARY_SUFFIX}"
  )

Proposed Solution
It's suggested that we allow users to set CMAKE_INSTALL_RPATH during the configuration phase, rather than hard-coding it in the CMakeLists.txt file. This would provide users with more flexibility and control over their installation paths.

Checklist

  • I've included a minimal example to reproduce the issue
  • I'd be willing to make a PR to solve this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions