cmake_minimum_required(VERSION 2.6)

PROJECT(RakNetStaticLib)

SET(RAKNET_SOURCES 

Source/AsynchronousFileIO.cpp
Source/AutoRPC.cpp
Source/BigInt.cpp
Source/BitStream.cpp
Source/BitStream_NoTemplate.cpp
Source/CheckSum.cpp
Source/CommandParserInterface.cpp
Source/ConnectionGraph.cpp
Source/ConnectionGraph2.cpp
Source/ConsoleServer.cpp
Source/DataBlockEncryptor.cpp
Source/DataCompressor.cpp
Source/DirectoryDeltaTransfer.cpp
Source/DS_BytePool.cpp
Source/DS_ByteQueue.cpp
Source/DS_HuffmanEncodingTree.cpp
Source/DS_Table.cpp
Source/EmailSender.cpp
Source/EncodeClassName.cpp
Source/EpochTimeToString.cpp
Source/ExtendedOverlappedPool.cpp
Source/FileList.cpp
Source/FileListTransfer.cpp
Source/FileOperations.cpp
Source/FormatString.cpp
Source/FullyConnectedMesh.cpp
Source/FullyConnectedMesh2.cpp
Source/FunctionThread.cpp
Source/Gen_RPC8.cpp
Source/GetTime.cpp
Source/GridSectorizer.cpp
Source/HTTPConnection.cpp
Source/IncrementalReadInterface.cpp
Source/InlineFunctor.cpp
Source/Itoa.cpp
Source/LightweightDatabaseClient.cpp
Source/LightweightDatabaseCommon.cpp
Source/LightweightDatabaseServer.cpp
Source/LinuxStrings.cpp
Source/LogCommandParser.cpp
Source/MessageFilter.cpp
Source/NatPunchthroughClient.cpp
Source/NatPunchthroughServer.cpp
Source/NetworkIDManager.cpp
Source/NetworkIDObject.cpp
Source/PacketConsoleLogger.cpp
Source/PacketFileLogger.cpp
Source/PacketizedTCP.cpp
Source/PacketLogger.cpp
Source/PacketOutputWindowLogger.cpp
Source/PluginInterface.cpp
Source/PluginInterface2.cpp
Source/RakMemoryOverride.cpp
Source/RakNetCommandParser.cpp
Source/RakNetStatistics.cpp
Source/RakNetTransport.cpp
Source/RakNetTransport2.cpp
Source/RakNetTypes.cpp
Source/RakNetworkFactory.cpp
Source/RakPeer.cpp
Source/RakSleep.cpp
Source/RakString.cpp
Source/RakThread.cpp
Source/Rand.cpp
Source/ReadyEvent.cpp
Source/ReliabilityLayer.cpp
Source/ReplicaManager.cpp
Source/ReplicaManager2.cpp
Source/ReplicaManager3.cpp
Source/rijndael.cpp
Source/Router.cpp
Source/RPCMap.cpp
Source/RSACrypt.cpp
Source/SHA1.cpp
Source/SimpleMutex.cpp
Source/SocketLayer.cpp
Source/StringCompressor.cpp
Source/StringTable.cpp
Source/SuperFastHash.cpp
Source/SystemAddressList.cpp
Source/TableSerializer.cpp
Source/TCPInterface.cpp
Source/TelnetTransport.cpp
Source/ThreadsafePacketLogger.cpp
Source/UDPForwarder.cpp
Source/UDPProxyClient.cpp
Source/UDPProxyCoordinator.cpp
Source/UDPProxyServer.cpp
Source/WSAStartupSingleton.cpp
Source/_FindFirst.cpp
)

set(RAKNET_HEADERS

Source/AsynchronousFileIO.h
Source/AutopatcherPatchContext.h
Source/AutopatcherRepositoryInterface.h
Source/AutoRPC.h
Source/BigInt.h
Source/BitStream.h
Source/BitStream_NoTemplate.h
Source/CheckSum.h
Source/ClientContextStruct.h
Source/CommandParserInterface.h
Source/ConnectionGraph.h
Source/ConnectionGraph2.h
Source/ConsoleServer.h
Source/DataBlockEncryptor.h
Source/DataCompressor.h
Source/DirectoryDeltaTransfer.h
Source/DS_BinarySearchTree.h
Source/DS_BPlusTree.h
Source/DS_BytePool.h
Source/DS_ByteQueue.h
Source/DS_Heap.h
Source/DS_HuffmanEncodingTree.h
Source/DS_HuffmanEncodingTreeFactory.h
Source/DS_HuffmanEncodingTreeNode.h
Source/DS_LinkedList.h
Source/DS_List.h
Source/DS_Map.h
Source/DS_MemoryPool.h
Source/DS_Multilist.h
Source/DS_OrderedChannelHeap.h
Source/DS_OrderedList.h
Source/DS_Queue.h
Source/DS_QueueLinkedList.h
Source/DS_RangeList.h
Source/DS_Table.h
Source/DS_Tree.h
Source/DS_WeightedGraph.h
Source/EmailSender.h
Source/EpochTimeToString.h
Source/Export.h
Source/ExtendedOverlappedPool.h
Source/FileList.h
Source/FileListNodeContext.h
Source/FileListTransfer.h
Source/FileListTransferCBInterface.h
Source/FileOperations.h
Source/FormatString.h
Source/FullyConnectedMesh.h
Source/FullyConnectedMesh2.h
Source/FunctionThread.h
Source/Gen_RPC8.h
Source/GetTime.h
Source/GridSectorizer.h
Source/HTTPConnection.h
Source/IncrementalReadInterface.h
Source/InlineFunctor.h
Source/InternalPacket.h
Source/Itoa.h
Source/Kbhit.h
Source/LightweightDatabaseClient.h
Source/LightweightDatabaseCommon.h
Source/LightweightDatabaseServer.h
Source/LinuxStrings.h
Source/LogCommandParser.h
Source/MessageFilter.h
Source/MessageIdentifiers.h
Source/MTUSize.h
Source/NativeTypes.h
Source/NatPunchthroughClient.h
Source/NatPunchthroughServer.h
Source/NetworkIDManager.h
Source/NetworkIDObject.h
Source/PacketConsoleLogger.h
Source/PacketFileLogger.h
Source/PacketizedTCP.h
Source/PacketLogger.h
Source/PacketOutputWindowLogger.h
Source/PacketPool.h
Source/PacketPriority.h
Source/Platform.h
Source/PluginInterface.h
Source/PluginInterface2.h
Source/RakAlloca.h
Source/RakAssert.h
Source/RakMemoryOverride.h
Source/RakNetCommandParser.h
Source/RakNetDefines.h
Source/RakNetStatistics.h
Source/RakNetTime.h
Source/RakNetTransport.h
Source/RakNetTransport2.h
Source/RakNetTypes.h
Source/RakNetVersion.h
Source/RakNetworkFactory.h
Source/RakPeer.h
Source/RakPeerInterface.h
Source/RakSleep.h
Source/RakString.h
Source/RakThread.h
Source/Rand.h
Source/ReadyEvent.h
Source/RefCountedObj.h
Source/ReliabilityLayer.h
Source/Replica.h
Source/ReplicaEnums.h
Source/ReplicaManager.h
Source/ReplicaManager2.h
Source/ReplicaManager3.h
Source/Rijndael-Boxes.h
Source/Rijndael.h
Source/Router.h
Source/RouterInterface.h
Source/RPCMap.h
Source/RPCNode.h
Source/RSACrypt.h
Source/SHA1.h
Source/SimpleMutex.h
Source/SimpleTCPServer.h
Source/SingleProducerConsumer.h
Source/SocketIncludes.h
Source/SocketLayer.h
Source/StringCompressor.h
Source/StringTable.h
Source/SuperFastHash.h
Source/SystemAddressList.h
Source/TableSerializer.h
Source/TCPInterface.h
Source/TelnetTransport.h
Source/ThreadPool.h
Source/ThreadsafePacketLogger.h
Source/TransportInterface.h
Source/UDPForwarder.h
Source/UDPProxyClient.h
Source/UDPProxyCommon.h
Source/UDPProxyCoordinator.h
Source/UDPProxyServer.h
Source/WindowsIncludes.h
Source/WSAStartupSingleton.h
Source/_FindFirst.h
)


ADD_LIBRARY(RakNet STATIC ${RAKNET_SOURCES})


INSTALL(TARGETS RakNet
        DESTINATION lib)

INSTALL(FILES ${RAKNET_HEADERS}
        DESTINATION include/raknet)

find_package(Threads REQUIRED)
target_link_libraries(RakNet ${CMAKE_THREAD_LIBS_INIT})
