Issues when packaging on Windows with subfolders
Opened this issue · 1 comments
Hello,
We are trying to package our framework on Windows and we are using subfolders. Our tree is :
bin/framework_name/binaries, dll
lib/ framework_name/lib
When dll are generated, they are found in lib and once they are installed, all files are found in lib. This represents an issue when we run tests because the executables cannot charge the dll, as well as during packaging since the generated tree does not match our expectations.
This issue seems connected to the following files:
install.cmake :
if(ARG_SUBFOLDER)
set(_dll_output ${QI_SDK_LIB}/${ARG_SUBFOLDER})
else()
set(_dll_output ${QI_SDK_BIN})
endif()
if(WIN32)
set(_runtime_output ${_dll_output})
else()
set(_runtime_output ${QI_SDK_BIN}/${ARG_SUBFOLDER})
endif()
target.cmake :
# Prevent having '//' in folder names, vs 2008 does not like it
if("${ARG_SUBFOLDER}" STREQUAL "")
set(_runtime_out "${QI_SDK_DIR}/${QI_SDK_BIN}")
set(_lib_out "${QI_SDK_DIR}/${QI_SDK_LIB}")
else()
set(_runtime_out "${QI_SDK_DIR}/${QI_SDK_LIB}/${ARG_SUBFOLDER}")
set(_lib_out "${QI_SDK_DIR}/${QI_SDK_LIB}/${ARG_SUBFOLDER}")
endif()
Why is it that the _runtime_out(put) variable uses QI_SDK_BIN with no SUBFOLDER positioned, and QI_SDK_LIB with a SUBFOLDER?
Shouldn't we always use QI_SDK_BIN or at least be able to configure the expected behavior?
We also encounter issues when generating -config.cmake files, but these issues seem to be solved in the next branch (commit 05479f6).
Are there any plans for a new version including this modification?
Why is it that the _runtime_out(put) variable uses QI_SDK_BIN with no SUBFOLDER positioned, and QI_SDK_LIB with a SUBFOLDER?
I think this is because using a subfolder is actually a specific use case, where it is not the system that will find the libraries automatically, but instead the library specifies special paths. In that case SUBFOLDER is used and qibuild should comply precisely, so that the library or its users can find the binary under ${QI_SDK_LIB}/${ARG_SUBFOLDER}
.
When not using a subfolder, it means you want to be able to rely on the system to find the library, that is to say that it has to be under ${QI_SDK_LIB}
on Linux, and ${QI_SDK_BIN}
on Winows.