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

GNUInstallDirs should be included before usage of CMAKE_INSTALL_INCLUDEDIR #424

Merged
merged 1 commit into from
Apr 5, 2024
Merged

GNUInstallDirs should be included before usage of CMAKE_INSTALL_INCLUDEDIR #424

merged 1 commit into from
Apr 5, 2024

Conversation

ruslo
Copy link
Contributor

@ruslo ruslo commented Apr 5, 2024

If it's included too late, the interface directory will not be populated.

Currently:

$ cmake -B _builds -D CMAKE_INSTALL_PREFIX=${HOME}/opt/sioclient
$ cmake --build _builds --target install

$ grep INTERFACE_INCLUDE_DIRECTORIES ${HOME}/opt/sioclient/lib/cmake/sioclient/sioclientTargets.cmake || echo FAIL
FAIL

As a workaround, CMAKE_INSTALL_INCLUDEDIR can be added explicitly:

$ cmake -B _builds -D CMAKE_INSTALL_PREFIX=${HOME}/opt/sioclient -D CMAKE_INSTALL_INCLUDEDIR=include
$ cmake --build _builds --target install

$ grep INTERFACE_INCLUDE_DIRECTORIES ${HOME}/opt/sioclient/lib/cmake/sioclient/sioclientTargets.cmake || echo FAIL
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"

With this patch:

$ cmake -B _builds -D CMAKE_INSTALL_PREFIX=${HOME}/opt/sioclient
$ cmake --build _builds --target install

$ grep INTERFACE_INCLUDE_DIRECTORIES ${HOME}/opt/sioclient/lib/cmake/sioclient/sioclientTargets.cmake || echo FAIL
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"

@jmigual
Copy link
Collaborator

jmigual commented Apr 5, 2024

Wow so, weird. Thank you for fixing this!

@jmigual
Copy link
Collaborator

jmigual commented Apr 5, 2024

As soon as the build succeeds I'll merge.

@jmigual jmigual merged commit c6be96b into socketio:master Apr 5, 2024
3 checks passed
@ruslo ruslo deleted the pr.gnuinstalldirs branch April 6, 2024 00:50
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.

2 participants