Skip to content

Commit cf4045f

Browse files
committedFeb 21, 2015
Use proper CMakeLists.txt for network and client directories
1 parent 81930b1 commit cf4045f

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed
 

‎src/CMakeLists.txt

+9-7
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ add_custom_target(GenerateVersion
352352
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
353353

354354
add_subdirectory(jthread)
355+
add_subdirectory(network)
355356
add_subdirectory(script)
356357
add_subdirectory(util)
357358

@@ -431,10 +432,7 @@ set(common_SRCS
431432
version.cpp
432433
voxel.cpp
433434
voxelalgorithms.cpp
434-
network/connection.cpp
435-
network/networkpacket.cpp
436-
network/packethandlers/server.cpp
437-
network/serveropcodes.cpp
435+
${common_network_SRCS}
438436
${JTHREAD_SRCS}
439437
${common_SCRIPT_SRCS}
440438
${UTIL_SRCS}
@@ -461,9 +459,16 @@ if(WIN32)
461459
endif()
462460

463461
# Client sources
462+
463+
if (BUILD_CLIENT)
464+
add_subdirectory(client)
465+
endif(BUILD_CLIENT)
466+
464467
set(minetest_SRCS
465468
${common_SRCS}
466469
${sound_SRCS}
470+
${client_SRCS}
471+
${client_network_SRCS}
467472
camera.cpp
468473
chat.cpp
469474
client.cpp
@@ -498,9 +503,6 @@ set(minetest_SRCS
498503
sky.cpp
499504
tile.cpp
500505
wieldmesh.cpp
501-
client/clientlauncher.cpp
502-
network/clientopcodes.cpp
503-
network/packethandlers/client.cpp
504506
${minetest_SCRIPT_SRCS}
505507
)
506508
list(SORT minetest_SRCS)

‎src/client/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set(client_SRCS
2+
${CMAKE_CURRENT_SOURCE_DIR}/clientlauncher.cpp
3+
PARENT_SCOPE
4+
)

‎src/network/CMakeLists.txt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
set(common_network_SRCS
2+
${CMAKE_CURRENT_SOURCE_DIR}/connection.cpp
3+
${CMAKE_CURRENT_SOURCE_DIR}/networkpacket.cpp
4+
${CMAKE_CURRENT_SOURCE_DIR}/packethandlers/server.cpp
5+
${CMAKE_CURRENT_SOURCE_DIR}/serveropcodes.cpp
6+
PARENT_SCOPE
7+
)
8+
9+
if (BUILD_CLIENT)
10+
set(client_network_SRCS
11+
${CMAKE_CURRENT_SOURCE_DIR}/clientopcodes.cpp
12+
${CMAKE_CURRENT_SOURCE_DIR}/packethandlers/client.cpp
13+
PARENT_SCOPE
14+
)
15+
endif(BUILD_CLIENT)

0 commit comments

Comments
 (0)
Please sign in to comment.