You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building with vcpkg, CMake can locate the imported tools (usResourceCompiler3, jsonschemavalidator, usShell3) in the /vcpkg/installed/x64-linux/tools/cppmicroservices/ directory
Actual Behavior
When building with vcpkg, CMake is attempting to locate the tools in the /vcpkg/installed/x64-linux/share/tools/cppmicroservices/ directory. It is not able to find them and throws configuration errors.
Description
OS: Fedora Linux 38 (Workstation Edition) x86_64
Kernel: 6.2.14-200.fc37.x86_64
CPU: 11th Gen Intel i5-11320H (8) @ 4.500GHz
Compiler: gcc version 13.1.1 20230426 (Red Hat 13.1.1-1) (GCC)
Building a project with CMake under Debug configuration, pulling in CppMicroServices with vcpkg:
CMake Error at /home/myUser/Programs/test-project/vcpkg/installed/x64-linux/share/cppmicroservices/cmake/CppMicroServicesTargets.cmake:81 (message):
The imported target "usResourceCompiler" references the file
"/home/myUser/Programs/test-project/vcpkg/installed/x64-linux/share/tools/cppmicroservices/usResourceCompiler3"
but this file does not exist.
The file actually exists in -> /home/myUser/Programs/test-project/vcpkg/installed/x64-linux/tools/cppmicroservices/usResourceCompiler3. (which is the vcpkg convention)
Somehow the _IMPORT_PREFIX is pointing to the wrong directory in the generated CppMicroServicesTargets-*.cmake files.
It must be getting set as /home/myUser/Programs/test-project/vcpkg/installed/x64-linux/share/. Because TOOLS_INSTALL_DIR is fine as TOOLS_INSTALL_DIR:STRING=tools/cppmicroservices
I believe the problem is in the generated CppMicroServicesTargets.cmake
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
As CMAKE_CURRENT_LIST_FILE is /home/myUser/Programs/test-project/vcpkg/installed/x64-linux/share/cppmicroservices/cmake/CppMicroServicesTargets.cmake, the _IMPORT_PREFIX is set from there and then the two get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) commands shave off the two topmost directories. Leaving us with /home/myUser/Programs/test-project/vcpkg/installed/x64-linux/share/.
If I change it to:
# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) # ADDED THIS LINE!!
if(_IMPORT_PREFIX STREQUAL "/")
set(_IMPORT_PREFIX "")
endif()
The usResourceCompiler target can actually be found, but expectedly it causes problems locating other resources. I'm assuming the problem is in the tools/*/CMakeLists.txt specifically this part:
if(NOT US_NO_INSTALL)
install(TARGETS ${US_RCC_EXECUTABLE_TARGET}
EXPORT ${PROJECT_NAME}Targets
FRAMEWORK DESTINATION . ${US_SDK_INSTALL_COMPONENT}
RUNTIME DESTINATION ${TOOLS_INSTALL_DIR} ${US_SDK_INSTALL_COMPONENT})
endif()
if(CMAKE_CROSSCOMPILING)
# When cross-compiling, import the host machine executable from a file
# See https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/CrossCompiling
include(${IMPORT_EXECUTABLES})
else()
# Export the host usResourceCompiler target to a file so it can be imported when cross-compiling.
# Use the NAMESPACE option of EXPORT() to get a different target name for ${US_RCC_EXECUTABLE_TARGET}
# when exporting.
# Doing this allows the host built usResourceCompiler to be used when cross-compiling and allows
# the usResourceCompiler to be built and installed for the target machine.
export( TARGETS ${US_RCC_EXECUTABLE_TARGET} FILE ${IMPORT_EXECUTABLES} NAMESPACE native-)
endif()
I've been experimenting around here but haven't been able to find any fix.
The text was updated successfully, but these errors were encountered:
Expected Behavior
When building with vcpkg, CMake can locate the imported tools (usResourceCompiler3, jsonschemavalidator, usShell3) in the
/vcpkg/installed/x64-linux/tools/cppmicroservices/
directoryActual Behavior
When building with vcpkg, CMake is attempting to locate the tools in the
/vcpkg/installed/x64-linux/share/tools/cppmicroservices/
directory. It is not able to find them and throws configuration errors.Description
OS: Fedora Linux 38 (Workstation Edition) x86_64
Kernel: 6.2.14-200.fc37.x86_64
CPU: 11th Gen Intel i5-11320H (8) @ 4.500GHz
Compiler: gcc version 13.1.1 20230426 (Red Hat 13.1.1-1) (GCC)
Building a project with CMake under Debug configuration, pulling in CppMicroServices with vcpkg:
The file actually exists in ->
/home/myUser/Programs/test-project/vcpkg/installed/x64-linux/tools/cppmicroservices/usResourceCompiler3
. (which is the vcpkg convention)Somehow the _IMPORT_PREFIX is pointing to the wrong directory in the generated CppMicroServicesTargets-*.cmake files.
It must be getting set as /home/myUser/Programs/test-project/vcpkg/installed/x64-linux/share/. Because TOOLS_INSTALL_DIR is fine as
TOOLS_INSTALL_DIR:STRING=tools/cppmicroservices
CppMicroServicesTargets-debug.cmake
CppMicroservicesTargets-release.cmake
I believe the problem is in the generated CppMicroServicesTargets.cmake
As CMAKE_CURRENT_LIST_FILE is
/home/myUser/Programs/test-project/vcpkg/installed/x64-linux/share/cppmicroservices/cmake/CppMicroServicesTargets.cmake
, the _IMPORT_PREFIX is set from there and then the two get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) commands shave off the two topmost directories. Leaving us with/home/myUser/Programs/test-project/vcpkg/installed/x64-linux/share/
.If I change it to:
The usResourceCompiler target can actually be found, but expectedly it causes problems locating other resources. I'm assuming the problem is in the tools/*/CMakeLists.txt specifically this part:
I've been experimenting around here but haven't been able to find any fix.
The text was updated successfully, but these errors were encountered: