I am using rkcommon as a submodule of my OSPRay -based project. In my main CMakeLists.txt file, I am adding the rkcommon directory like this
add_subdirectory(rkcommon)
After running the CMake configuration step, I am having an issue with the compilation caused by the following lines in the rkcommon CMakeLists.txt file (lines 25-30).
For my setup, ${CMAKE_SOURCE_DIR} and ${CMAKE_BINARY_DIR} are referring to the main project's source and binary directories. However, version.h.in is located in the submodule directory. I think a minor update to the CMakeLists.txt file, like below, might solve this issue without breaking any existing tools.
Also, updating line 46 of rkcommon/CMakeLists.txt file is needed:
target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/..>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/> # line 46 here
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE
${CMAKE_CURRENT_LIST_DIR}
)
I haven't tested the results thoroughly but I am guessing these changes should be okay to fix using rkcommon as a submodule.
Hello,
I am using
rkcommon
as a submodule of my OSPRay -based project. In my main CMakeLists.txt file, I am adding therkcommon
directory like thisAfter running the CMake configuration step, I am having an issue with the compilation caused by the following lines in the
rkcommon
CMakeLists.txt file (lines 25-30).For my setup,
${CMAKE_SOURCE_DIR}
and${CMAKE_BINARY_DIR}
are referring to the main project's source and binary directories. However,version.h.in
is located in the submodule directory. I think a minor update to the CMakeLists.txt file, like below, might solve this issue without breaking any existing tools.Also, updating line 46 of
rkcommon/CMakeLists.txt
file is needed:I haven't tested the results thoroughly but I am guessing these changes should be okay to fix using
rkcommon
as a submodule.Thanks.