Skip to content

Updated Cmakelists.txt - #212

Open
ty-n-42 wants to merge 1 commit into
lsalzman:masterfrom
ty-n-42:improve_cmake_config
Open

Updated Cmakelists.txt#212
ty-n-42 wants to merge 1 commit into
lsalzman:masterfrom
ty-n-42:improve_cmake_config

Conversation

@ty-n-42

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

Copy link
Copy Markdown

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.
Comment thread CMakeLists.txt
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
Copy Markdown

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

Croydon commented Apr 18, 2024

Copy link
Copy Markdown
Contributor

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