Maybe this is already planned but just in case:
Suppose I have this project structure:
MyProject/
├── CMakeLists.txt
└── HIPRT/
├── CMakeLists.txt
├── contrib
├── hiprt
├── scripts
├── test
├── tools
└── ...
If I want to use HIPRT in one of my project as a subdirectory, I would use add_subdirectory(HIPRT). However, the CMakeLists.txt of HIPRT currently uses ${CMAKE_SOURCE_DIR } to refer to the HIPRT/ directory:
|
include(${CMAKE_SOURCE_DIR}/contrib/Orochi/Orochi/enable_cuew.cmake) |
In the case where HIPRT's CMakeLists.txt is called from add_subdirectory(HIPRT), ${CMAKE_SOURCE_DIR } refers to the MyProject/ directory instead of HIPRT/ as expected.
A solution would be to use either ${CMAKE_CURRENT_SOURCE_DIR } or ${CMAKE_PROJECT_DIR}