Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem2/src/network/CMakeLists.txt @ 2565

Last change on this file since 2565 was 2518, checked in by rgrieder, 16 years ago

Adjusted source file macros to cmake 2.6 because it offers PARENT_SCOPE variable setting which removes my little hack with the CMake cache.
Also notice that the syntax has changed:

ADD_SOURCE_FILES(

Blubb.cc
Asdf.cc

)
ADD_SOURCE_DIRECTORY(ford_prefect)

These two commands can be written in an arbitrary order.
To actually use the created list of souce files, there is a third macro:
WRITE_SOURCE_FILES(myVariableName)

A demonstration can be found by looking at src/orxonox/CMakeLists.txt and src/orxonox/objects/CMakeLists.txt

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1ADD_SOURCE_FILES(
2  ChatListener.cc
3  Client.cc
4  ClientConnection.cc
5  ClientInformation.cc
6  ClientConnectionListener.cc
7  ConnectionManager.cc
8  GamestateManager.cc
9  GamestateClient.cc
10  GamestateHandler.cc
11  PacketBuffer.cc
12  Server.cc
13  Synchronisable.cc
14  Host.cc
15)
16
17ADD_SOURCE_DIRECTORY(packet)
18
19WRITE_SOURCE_FILES(NETWORK_SRC_FILES)
20IF(WIN32)
21  ADD_LIBRARY( network ${NETWORK_SRC_FILES} )
22ELSE(WIN32)
23  ADD_LIBRARY( network SHARED ${NETWORK_SRC_FILES} )
24ENDIF(WIN32)
25
26TARGET_LINK_LIBRARIES( network
27  ${ZLIB_LIBRARY}
28  ${ENet_LIBRARIES}
29  ${Boost_THREAD_LIBRARY}
30  core
31)
32
33INSTALL(TARGETS network LIBRARY DESTINATION lib)
34
35# build those parts only on request.
36IF(NETWORK_TESTING_ENABLED)
37  ##### test for gamestate stuff #####
38  SET( TEST_SRC_FILES
39    ${NETWORK_SRC_FILES}
40  )
41  ADD_EXECUTABLE(networktest ${TEST_SRC_FILES})
42  TARGET_LINK_LIBRARIES( networktest
43    ${OGRE_LIBRARY}
44    network
45    ${ENet_LIBRARIES}
46    ${ZLIB_LIBRARY}
47  )
48  ##### end test for gamestate stuff #####
49ENDIF(NETWORK_TESTING_ENABLED)
Note: See TracBrowser for help on using the repository browser.