Skip to content
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

Merged
merged 1 commit into from
May 2, 2024

Conversation

trcwm
Copy link
Contributor

@trcwm trcwm commented Apr 30, 2024

…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.

…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.
@yhirose
Copy link
Owner

yhirose commented Apr 30, 2024

@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})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Copy link

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.

Copy link

@jimmy-park jimmy-park May 1, 2024

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.

Copy link
Owner

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?

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.

@yhirose yhirose merged commit 50ea4b0 into yhirose:master May 2, 2024
4 checks passed
@yhirose
Copy link
Owner

yhirose commented May 2, 2024

@trcwm @sum01 @jimmy-park thanks for your help!

@trcwm
Copy link
Contributor Author

trcwm commented May 2, 2024

Issue #297 can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants