Skip to content

Conversation

@chayleaf
Copy link

@chayleaf chayleaf commented Aug 12, 2023

CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR are allowed to be absolute as per CMake docs, so they shouldn't be concatenated to absolute paths. Instead, use CMAKE_INSTALL_FULL_LIBDIR and CMAKE_INSTALL_FULL_INCLUDEDIR, which are known to be absolute.

Absolute CMAKE_INSTALL_*DIR paths are used at least on NixOS. This is because NixOS packages are allowed to have multiple outputs (e.g. put docs in one dir, headers and other files for development to another, the binaries to a third one), and NixOS isn't FHS-compliant (There's no /usr, each package output has its own directory instead).

GNU Guix is a similar distro, but I'm not sure how CMake packages are built there. Either way, it's good to fully conform to the spec.

CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR are allowed to be
absolute, so they shouldn't be concatenated to absolute paths. Instead,
use CMAKE_INSTALL_FULL_LIBDIR and CMAKE_INSTALL_FULL_INCLUDEDIR, which
are known to be absolute.
@chayleaf chayleaf changed the title respect GNU install dirs allow absolute GNU install dirs Aug 13, 2023
@davidgyu
Copy link
Member

Filed as internal issue #OSD-430

@davidgyu
Copy link
Member

Hi, @chayleaf would you submit a CLA Thanks!

@chayleaf
Copy link
Author

chayleaf commented Aug 17, 2023

Just did that

robertkirkman added a commit to robertkirkman/termux-packages that referenced this pull request Jun 5, 2025
- Context: similar to termux#24956. This might be helpful for a future nested dependency of Blender.

- Fixes this error when some projects import `opensubdiv` through CMake, by preventing the generation of a malformed path `/data/data/com.termux/files/usr//data/data/com.termux/files/usr/lib` in `OpenSubdivConfig.cmake`:

```
CMake Error at /data/data/com.termux/files/usr/lib/cmake/OpenSubdiv/OpenSubdivConfig.cmake:11 (message):
  File or directory
  /data/data/com.termux/files/usr//data/data/com.termux/files/usr/lib
  referenced by variable OpenSubdiv_LIB_DIR does not exist !
Call Stack (most recent call first):
  /data/data/com.termux/files/usr/lib/cmake/OpenSubdiv/OpenSubdivConfig.cmake:28 (set_and_check)
  cmake/defaults/Packages.cmake:225 (find_package)
  CMakeLists.txt:23 (include)

-- Configuring incomplete, errors occurred!
```

- Copied and pasted from PixarAnimationStudios/OpenSubdiv#1315
robertkirkman added a commit to termux/termux-packages that referenced this pull request Jun 6, 2025
- Context: similar to #24956. This might be helpful for a future nested dependency of Blender.

- Fixes this error when some projects import `opensubdiv` through CMake, by preventing the generation of a malformed path `/data/data/com.termux/files/usr//data/data/com.termux/files/usr/lib` in `OpenSubdivConfig.cmake`:

```
CMake Error at /data/data/com.termux/files/usr/lib/cmake/OpenSubdiv/OpenSubdivConfig.cmake:11 (message):
  File or directory
  /data/data/com.termux/files/usr//data/data/com.termux/files/usr/lib
  referenced by variable OpenSubdiv_LIB_DIR does not exist !
Call Stack (most recent call first):
  /data/data/com.termux/files/usr/lib/cmake/OpenSubdiv/OpenSubdivConfig.cmake:28 (set_and_check)
  cmake/defaults/Packages.cmake:225 (find_package)
  CMakeLists.txt:23 (include)

-- Configuring incomplete, errors occurred!
```

- Copied and pasted from PixarAnimationStudios/OpenSubdiv#1315
termux-pacman-bot added a commit to termux-pacman/termux-packages that referenced this pull request Jun 6, 2025
- Context: similar to termux/termux-packages#24956. This might be helpful for a future nested dependency of Blender.

- Fixes this error when some projects import `opensubdiv` through CMake, by preventing the generation of a malformed path `/data/data/com.termux/files/usr//data/data/com.termux/files/usr/lib` in `OpenSubdivConfig.cmake`:

```
CMake Error at /data/data/com.termux/files/usr/lib/cmake/OpenSubdiv/OpenSubdivConfig.cmake:11 (message):
  File or directory
  /data/data/com.termux/files/usr//data/data/com.termux/files/usr/lib
  referenced by variable OpenSubdiv_LIB_DIR does not exist !
Call Stack (most recent call first):
  /data/data/com.termux/files/usr/lib/cmake/OpenSubdiv/OpenSubdivConfig.cmake:28 (set_and_check)
  cmake/defaults/Packages.cmake:225 (find_package)
  CMakeLists.txt:23 (include)

-- Configuring incomplete, errors occurred!
```

- Copied and pasted from PixarAnimationStudios/OpenSubdiv#1315
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants