I want to generate myself package, and the generated package can be import by find_package()
.
Everyhing is OK except a cude relative library.
Let’s say I want to generate a Basic
package. In the geberated Basic.cmake
:
...
add_library(CudaFunction SHARD IMPORTED)
set_target_properties(CudaFunction PROPERTIES
INTERFACE_LINK_LIBRARIES “C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.3/lib/x64/cudart_static.lib;C:/Users/zhq/Desktop/Project/Basic/Thirdparty/x64/libtorch/lib/Debug/c10.lib”
)
...
The CudaFunction
library depends on cudart_static.lib
, c10.lib
. However, the absolute path is used, and it prevent other user import my Basic
package.
The CudaFunction
is built by:
...
set(Torch_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Thirdparty/x64/libtorch/share/cmake/Torch")
find_package(Torch REQUIREd)
target_link_libraries(CudaFunction ${CUDA_LIBRARIES})
...
Is it possible generate Basic.cmake
without the absolute path dependency.
Any suggestion is appreciated~~~