Skip to content

next-release. Use CMAKE_PROJECT_DIR or CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR to be able to use HIPRT as a submodule? #13

Description

@TomClabault

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}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions