Skip to content

Conversation

@ty-n-42
Copy link

@ty-n-42 ty-n-42 commented Oct 25, 2022

Slightly modified the cake configuration to make it easier to use the library in downstream code: should be able to #include "enet/enet.h" without any special IDE configuration.
Also added a copy of enet.h to the build directory (within an include directory) as a small convenience.

Slightly modified the cake configuration to make it easier to use the library in downstream code: should be able to #include "enet/enet.h" without any special IDE configuration.
target_include_directories(enet PUBLIC ${PROJECT_SOURCE_DIR}/include) # define the public header files path
# consuming projects should be able to do #include "enet/enet.h" in their IDE (tested with CLion)

file(COPY ${INCLUDE_FILES_PREFIX}/enet.h DESTINATION "include") # Copy the public header file to the build include directory for convenience
Copy link

Choose a reason for hiding this comment

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

This copies the enet.h file to wherever ${CMAKE_CURRENT_BINARY_DIR}/include points to, but it does it during the configuration step, not when installing.

@Croydon
Copy link
Contributor

Croydon commented Apr 18, 2024

This looks like a wrong approach for me. enet is installing the headers already when doing a cmake install, doing this additionally during a configure steps looks very wrong to me.

install(DIRECTORY include/

This can probably 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.

3 participants