Use proper CMakeLists.txt for network and client directories

This commit is contained in:
Loic Blot 2015-02-21 11:51:12 +01:00
parent 81930b1729
commit cf4045ff0f
3 changed files with 28 additions and 7 deletions

@ -352,6 +352,7 @@ add_custom_target(GenerateVersion
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
add_subdirectory(jthread) add_subdirectory(jthread)
add_subdirectory(network)
add_subdirectory(script) add_subdirectory(script)
add_subdirectory(util) add_subdirectory(util)
@ -431,10 +432,7 @@ set(common_SRCS
version.cpp version.cpp
voxel.cpp voxel.cpp
voxelalgorithms.cpp voxelalgorithms.cpp
network/connection.cpp ${common_network_SRCS}
network/networkpacket.cpp
network/packethandlers/server.cpp
network/serveropcodes.cpp
${JTHREAD_SRCS} ${JTHREAD_SRCS}
${common_SCRIPT_SRCS} ${common_SCRIPT_SRCS}
${UTIL_SRCS} ${UTIL_SRCS}
@ -461,9 +459,16 @@ if(WIN32)
endif() endif()
# Client sources # Client sources
if (BUILD_CLIENT)
add_subdirectory(client)
endif(BUILD_CLIENT)
set(minetest_SRCS set(minetest_SRCS
${common_SRCS} ${common_SRCS}
${sound_SRCS} ${sound_SRCS}
${client_SRCS}
${client_network_SRCS}
camera.cpp camera.cpp
chat.cpp chat.cpp
client.cpp client.cpp
@ -498,9 +503,6 @@ set(minetest_SRCS
sky.cpp sky.cpp
tile.cpp tile.cpp
wieldmesh.cpp wieldmesh.cpp
client/clientlauncher.cpp
network/clientopcodes.cpp
network/packethandlers/client.cpp
${minetest_SCRIPT_SRCS} ${minetest_SCRIPT_SRCS}
) )
list(SORT minetest_SRCS) list(SORT minetest_SRCS)

@ -0,0 +1,4 @@
set(client_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/clientlauncher.cpp
PARENT_SCOPE
)

@ -0,0 +1,15 @@
set(common_network_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/connection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/networkpacket.cpp
${CMAKE_CURRENT_SOURCE_DIR}/packethandlers/server.cpp
${CMAKE_CURRENT_SOURCE_DIR}/serveropcodes.cpp
PARENT_SCOPE
)
if (BUILD_CLIENT)
set(client_network_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/clientopcodes.cpp
${CMAKE_CURRENT_SOURCE_DIR}/packethandlers/client.cpp
PARENT_SCOPE
)
endif(BUILD_CLIENT)