Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 2518 was 2518, checked in by rgrieder, 15 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
RevLine 
[2518]1ADD_SOURCE_FILES(
[2087]2  ChatListener.cc
[1505]3  Client.cc
4  ClientConnection.cc
5  ClientInformation.cc
[2087]6  ClientConnectionListener.cc
[1505]7  ConnectionManager.cc
[1735]8  GamestateManager.cc
9  GamestateClient.cc
10  GamestateHandler.cc
[1505]11  PacketBuffer.cc
12  Server.cc
13  Synchronisable.cc
[1735]14  Host.cc
[1505]15)
16
[2518]17ADD_SOURCE_DIRECTORY(packet)
[2131]18
[2518]19WRITE_SOURCE_FILES(NETWORK_SRC_FILES)
[1505]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}
[2509]28  ${ENet_LIBRARIES}
29  ${Boost_THREAD_LIBRARY}
[1505]30  core
31)
32
[2510]33INSTALL(TARGETS network LIBRARY DESTINATION lib)
[1505]34
35# build those parts only on request.
36IF(NETWORK_TESTING_ENABLED)
37  ##### test for gamestate stuff #####
38  SET( TEST_SRC_FILES
[1735]39    ${NETWORK_SRC_FILES}
[1505]40  )
41  ADD_EXECUTABLE(networktest ${TEST_SRC_FILES})
42  TARGET_LINK_LIBRARIES( networktest
[2509]43    ${OGRE_LIBRARY}
[1505]44    network
[2509]45    ${ENet_LIBRARIES}
[1505]46    ${ZLIB_LIBRARY}
47  )
48  ##### end test for gamestate stuff #####
49ENDIF(NETWORK_TESTING_ENABLED)
Note: See TracBrowser for help on using the repository browser.