Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ if(HAS_SOCKLEN_T)
add_definitions(-DHAS_SOCKLEN_T=1)
endif()

include_directories(${PROJECT_SOURCE_DIR}/include)

set(INCLUDE_FILES_PREFIX include/enet)
set(INCLUDE_FILES
${INCLUDE_FILES_PREFIX}/callbacks.h
Expand Down Expand Up @@ -89,6 +87,11 @@ add_library(enet STATIC
${SOURCE_FILES}
)

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.


if (MINGW)
target_link_libraries(enet winmm ws2_32)
endif()
Expand Down