-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed INTERFACE location to CMAKE_CURRENT_SOURCE_DIR for package ma… #298
Conversation
…nager compatibility. CMAKE_SOURCE_DIR points to the top-level CMakeLists.txt, not to the subdir CMakeLists.txt, so when cpp-peglib is included in a project, the INTERFACE/include directory points to the wrong location.
@sum01, @jimmy-park, could you review this pull request for me? Thanks! |
@@ -18,7 +18,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") | |||
endif() | |||
|
|||
add_library(peglib INTERFACE) | |||
target_include_directories(peglib INTERFACE ${CMAKE_SOURCE_DIR}) | |||
target_include_directories(peglib INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target_include_directories(peglib INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) | |
target_include_directories(peglib INTERFACE | |
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | |
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include> | |
) |
We should separate include directories for build/install.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it even matter if the lib isn't installed? Only the header itself is installed, there's no export for the lib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I didn't check the whole CMakeLists.txt
. This suggestion has no effect but I suggested it routinely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jimmy-park so can we merge the original change by @trcwm as it is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yhirose Yes, please ignore this suggestion.
@trcwm @sum01 @jimmy-park thanks for your help! |
Issue #297 can be closed. |
…nager compatibility.
CMAKE_SOURCE_DIR points to the top-level CMakeLists.txt, not to the subdir CMakeLists.txt, so when cpp-peglib is included in a project, the INTERFACE/include directory points to the wrong location.