kSleighSpecInstallDir filled in with relative path
2over12 opened this issue · 1 comments
In remill builds on latest sleigh (74838a3) the value for the sleighspecinstalldir is static const char *kSleighSpecInstallDir = "share/sleigh/specfiles";
. This value causes searching for sla files to fail when the build directory has been deleted, which occurs in the Dockerfile for remill
The relative path is intentional. There's no way to know where the base install directory is located and hard-coding isn't correct due to the possibility of relocatable installations.
What we could do is add another constant kSleighBaseInstallDir
, which would be set to CMAKE_INSTALL_PREFIX
and then you could combine the two to get something that should work if the installation directory wasn't relocated. However, if you plan to use a package manager like vcpkg, then kSleighBaseInstallDir
won't be valid because vcpkg installations are relocatable.
Another option would be to use the PACKAGE_PREFIX_DIR
CMake variable after the call to find_package(sleigh REQUIRED COMPONENTS Support Specs)
. This variable's value should be saved to another variable like <project>_sleigh_install_prefix
(because PACKAGE_PREFIX_DIR
could change when calling find_package
again), and it will have the value of the base installation directory with which you can do something. NOTE: This only works if the package's installation config file sets this variable, which could happen if you see the @PACKAGE_INIT@
macro at the top of the config file in the source directory
sleigh/cmake/install-config.cmake.in
Line 16 in 1c2f67c