CMake source groups added for cleaner VS solutions.

This commit is contained in:
Lukasz Fronc 2017-10-15 11:02:29 +02:00
parent a84c120eff
commit 67f964c2ad

View file

@ -23,7 +23,7 @@ if(MSVC)
else() else()
add_definitions(-Wno-error) add_definitions(-Wno-error)
endif() endif()
if(HAS_FCNTL) if(HAS_FCNTL)
add_definitions(-DHAS_FCNTL=1) add_definitions(-DHAS_FCNTL=1)
endif() endif()
@ -54,21 +54,41 @@ endif()
if(HAS_SOCKLEN_T) if(HAS_SOCKLEN_T)
add_definitions(-DHAS_SOCKLEN_T=1) add_definitions(-DHAS_SOCKLEN_T=1)
endif() endif()
include_directories(${PROJECT_SOURCE_DIR}/include) include_directories(${PROJECT_SOURCE_DIR}/include)
set(INCLUDE_FILES_PREFIX include/enet)
set(INCLUDE_FILES
${INCLUDE_FILES_PREFIX}/callbacks.h
${INCLUDE_FILES_PREFIX}/enet.h
${INCLUDE_FILES_PREFIX}/list.h
${INCLUDE_FILES_PREFIX}/protocol.h
${INCLUDE_FILES_PREFIX}/time.h
${INCLUDE_FILES_PREFIX}/types.h
${INCLUDE_FILES_PREFIX}/unix.h
${INCLUDE_FILES_PREFIX}/utility.h
${INCLUDE_FILES_PREFIX}/win32.h
)
set(SOURCE_FILES
callbacks.c
compress.c
host.c
list.c
packet.c
peer.c
protocol.c
unix.c
win32.c)
source_group(include FILES ${INCLUDE_FILES})
source_group(source FILES ${SOURCE_FILES})
add_library(enet STATIC add_library(enet STATIC
callbacks.c ${INCLUDE_FILES}
compress.c ${SOURCE_FILES}
host.c )
list.c
packet.c
peer.c
protocol.c
unix.c
win32.c
)
if (MINGW) if (MINGW)
target_link_libraries(enet winmm ws2_32) target_link_libraries(enet winmm ws2_32)
endif() endif()