Skip to content

Commit

Permalink
- fixed compile warnings in 64-bit (#263, #265)
Browse files Browse the repository at this point in the history
- CMake
  - renamed project name from RakNet -> SLikeNet (#222)
  - by default build the retail version now (#222)
  - changed created include directory from raknet -> slikenet (#222)
  - changed target name for non-Windows platform to libslikenet using set_target_properties(OUTPUT_NAME) (#189)
  - added version number using set_target_properties() (VERSION and SOVERSION) (#222)
  - replaced usage of direct CMAKE_CXX_FLAGS variable by using add_definitions() (#222)
  - renamed variables RAKNET_XXX -> SLIKENET_XXX (#222)
  - correct the OpenSSL include directory (#254)
  - removed obsolete HAVE_64_BIT variable (facebookarchive#130)
  - removed obsolete RAKNET_INCLUDE_DIRS variable (facebookarchive#130)
  - multiple other tweaks (facebookarchive#130, #269)
  • Loading branch information
Luke1410 committed Sep 2, 2019
1 parent 1af4051 commit 7b24c06
Show file tree
Hide file tree
Showing 32 changed files with 310 additions and 200 deletions.
69 changes: 32 additions & 37 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
# Please see licenses/RakNet license.txt for the underlying license and related copyright.
#
#
#
# Modified work: Copyright (c) 2016, SLikeSoft UG (haftungsbeschränkt)
# Modified work: Copyright (c) 2016-2019, SLikeSoft UG (haftungsbeschränkt)
#
# This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
# license found in the license.txt file in the root directory of this source tree.
#

cmake_minimum_required(VERSION 2.6)

project(RakNet)
project(SLikeNet)

# specify the project version number
set(SLikeNet_VERSION "0.2.0")
set(SLikeNet_API_VERSION "0.2")

# CMake policy settings
if( POLICY CMP0037 )
Expand All @@ -31,25 +34,15 @@ if( CMAKE_VERSION VERSION_LESS 3.0 )
endif()
endif()


if( NOT APPLE )
# check 64 bit
if( CMAKE_SIZEOF_VOID_P MATCHES "4" )
set( HAVE_64_BIT 0 )
else( CMAKE_SIZEOF_VOID_P MATCHES "4")
set( HAVE_64_BIT 1 )
endif( CMAKE_SIZEOF_VOID_P MATCHES "4")
endif( NOT APPLE )

IF (WIN32 AND NOT UNIX)
set (PROGRAMFILESX86 $ENV{PROGRAMFILES})
string(REPLACE "\\" "/" PROGRAMFILESX86 "${PROGRAMFILESX86}")
ENDIF(WIN32 AND NOT UNIX)

IF (WIN32 AND NOT UNIX)
set(RAKNET_LIBRARY_LIBS ws2_32.lib)
set(SLIKENET_LIBRARY_LIBS ws2_32.lib)
ELSE(WIN32 AND NOT UNIX)
set(RAKNET_LIBRARY_LIBS pthread)
set(SLIKENET_LIBRARY_LIBS pthread)
ENDIF(WIN32 AND NOT UNIX)

# enable C++11 language support for GCC
Expand All @@ -66,39 +59,41 @@ endif()

# Options
IF (WIN32 AND NOT UNIX)
option( RAKNET_ENABLE_SAMPLES "Generate RakNet sample projects if true." TRUE )
option( SLIKENET_ENABLE_SAMPLES "Generate sample projects if true." TRUE )
ELSE (WIN32 AND NOT UNIX)
# building samples is disabled atm by default on Unix/Mac, since the sample projects won't compile correctly
option( RAKNET_ENABLE_SAMPLES "Generate RakNet sample projects if true." FALSE )
option( SLIKENET_ENABLE_SAMPLES "Generate sample projects if true." FALSE )
ENDIF(WIN32 AND NOT UNIX)
option( RAKNET_ENABLE_DLL "Generate the DLL project if true." TRUE )
option( RAKNET_ENABLE_STATIC "Generate the static library project if true." TRUE )
option( RAKNET_GENERATE_INCLUDE_ONLY_DIR "Setup a include/RakNet/ directory in which all the headers are copied." FALSE )

set( RAKNETHEADERFILES ${RakNet_SOURCE_DIR}/Source ) #This name doesn't follow CMake conventions but for retro compatibility I'll let it there.

if( RAKNET_GENERATE_INCLUDE_ONLY_DIR )
set( RAKNET_INCLUDE_ONLY_DIR ${RakNet_SOURCE_DIR}/include ) # this will be visible by client code
set( RAKNET_NAMED_INCLUDE_ONLY_DIR ${RAKNET_INCLUDE_ONLY_DIR}/RakNet )
message( STATUS "Setting up the ${RAKNET_NAMED_INCLUDE_ONLY_DIR} directory..." )
# Now setup the include/RakNet/*.h files.
file( MAKE_DIRECTORY ${RAKNET_NAMED_INCLUDE_ONLY_DIR} )
file( COPY ${RAKNETHEADERFILES}/ DESTINATION ${RAKNET_NAMED_INCLUDE_ONLY_DIR} FILES_MATCHING PATTERN "*.h" )
message( STATUS "DONE: Setting up the ${RAKNET_NAMED_INCLUDE_ONLY_DIR} directory." )
option( SLIKENET_ENABLE_DLL "Generate the DLL / shared object project if true." TRUE )
option( SLIKENET_ENABLE_STATIC "Generate the static library project if true." TRUE )
option( SLIKENET_GENERATE_INCLUDE_ONLY_DIR "Setup an include/slikenet/ directory in which all the headers are copied." FALSE )

set( SLIKENET_HEADER_FILES ${SLikeNet_SOURCE_DIR}/Source )

# note: while it's straight forward to get the SLikeNet include files directly from source (since they are cleanly organized under Source/include/slikenet/*), copying the headers in RakNet compatibility mode is not that clear
# since we are planning to add support for RakNet compatibility mode to CMake too, we keep this option
# also the planned addition for making experimental features optional/configurable would require additional logic here, so that there certainly is a purpose for this feature even with the cleaner header file structure in SLikeNet
if( SLIKENET_GENERATE_INCLUDE_ONLY_DIR )
set( SLIKENET_INCLUDE_ONLY_DIR ${SLikeNet_SOURCE_DIR}/include ) # this will be visible by client code
set( SLIKENET_NAMED_INCLUDE_ONLY_DIR ${SLIKENET_INCLUDE_ONLY_DIR}/slikenet )
message( STATUS "Setting up the ${SLIKENET_NAMED_INCLUDE_ONLY_DIR} directory..." )

# Now setup the include/slikenet directory.
file( MAKE_DIRECTORY ${SLIKENET_NAMED_INCLUDE_ONLY_DIR} )
file( MAKE_DIRECTORY ${SLIKENET_NAMED_INCLUDE_ONLY_DIR}/crypto )
file( COPY ${SLIKENET_HEADER_FILES}/include/slikenet DESTINATION ${SLIKENET_NAMED_INCLUDE_ONLY_DIR} )
file( COPY ${SLIKENET_HEADER_FILES}/include/slikenet/crypto DESTINATION ${SLIKENET_NAMED_INCLUDE_ONLY_DIR} )
message( STATUS "DONE: Setting up the ${SLIKENET_NAMED_INCLUDE_ONLY_DIR} directory." )
endif()

set( RAKNET_INCLUDE_DIRS ${RAKNETHEADERFILES} ${RAKNET_INCLUDE_ONLY_DIR} ) # Visible from outside

include(./CmakeIncludes/CmakeMacros.txt)
FIXLINKOPTIONS()
FIXCOMPILEOPTIONS()


add_subdirectory(Lib)

set(SLIKENET_COMMON_LIBS SLikeNetLibStatic)

set(RAKNET_COMMON_LIBS RakNetLibStatic)

if( RAKNET_ENABLE_SAMPLES )
if(SLIKENET_ENABLE_SAMPLES)
add_subdirectory(Samples)
endif()
20 changes: 10 additions & 10 deletions CmakeIncludes/CmakeMacros.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Please see licenses/RakNet license.txt for the underlying license and related copyright.
#
#
# Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
# Modified work: Copyright (c) 2017-2019, SLikeSoft UG (haftungsbeschränkt)
#
# This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
# license found in the license.txt file in the root directory of this source tree.
Expand All @@ -15,10 +15,10 @@ MACRO(STANDARDSUBPROJECT PROJECTNAME)#Many of the projects just need the cpp fil
project(${PROJECTNAME})
FILE(GLOB ALL_CPP_SRCS *.cpp)
FILE(GLOB ALL_HEADER_SRCS *.h)
include_directories(${RAKNETHEADERFILES} ./)
include_directories(${SLIKENET_HEADER_FILES} ./)
FIXCOMPILEOPTIONS()
add_executable(${PROJECTNAME} ${ALL_CPP_SRCS} ${ALL_HEADER_SRCS})
target_link_libraries(${PROJECTNAME} ${RAKNET_COMMON_LIBS})
target_link_libraries(${PROJECTNAME} ${SLIKENET_COMMON_LIBS})
set_target_properties(${PROJECTNAME} PROPERTIES PROJECT_GROUP Samples)
ENDMACRO(STANDARDSUBPROJECT)

Expand All @@ -27,9 +27,9 @@ MACRO(STANDARDSUBPROJECTWITHOPTIONS PROJECTNAME EXTRAINCLUDES EXTRASOURCES EXTRA
FILE(GLOB ALL_CPP_SRCS *.cpp)
FILE(GLOB ALL_HEADER_SRCS *.h)
FIXCOMPILEOPTIONS()
include_directories(${RAKNETHEADERFILES} ./ ${EXTRAINCLUDES})
include_directories(${SLIKENET_HEADER_FILES} ./ ${EXTRAINCLUDES})
add_executable(${PROJECTNAME} ${ALL_CPP_SRCS} ${ALL_HEADER_SRCS} ${EXTRASOURCES})
target_link_libraries(${PROJECTNAME} ${RAKNET_COMMON_LIBS} ${EXTRALIBS})
target_link_libraries(${PROJECTNAME} ${SLIKENET_COMMON_LIBS} ${EXTRALIBS})
set_target_properties(${PROJECTNAME} PROPERTIES PROJECT_GROUP Samples)
ENDMACRO(STANDARDSUBPROJECTWITHOPTIONS)

Expand All @@ -38,20 +38,20 @@ MACRO(STANDARDSUBPROJECTWITHOPTIONSSET PROJECTNAME)#Same as STANDARDSUBPROJECT b
FILE(GLOB ALL_CPP_SRCS *.cpp)
FILE(GLOB ALL_HEADER_SRCS *.h)
FIXCOMPILEOPTIONS()
include_directories(${RAKNETHEADERFILES} ./ ${EXTRAINCLUDES})
include_directories(${SLIKENET_HEADER_FILES} ./ ${EXTRAINCLUDES})
add_executable(${PROJECTNAME} ${ALL_CPP_SRCS} ${ALL_HEADER_SRCS} ${EXTRASOURCES})
target_link_libraries(${PROJECTNAME} ${RAKNET_COMMON_LIBS} ${EXTRALIBS})
target_link_libraries(${PROJECTNAME} ${SLIKENET_COMMON_LIBS} ${EXTRALIBS})
set_target_properties(${PROJECTNAME} PROPERTIES PROJECT_GROUP Samples)
ENDMACRO(STANDARDSUBPROJECTWITHOPTIONSSET)

MACRO(STANDARDCSUBPROJECT PROJECTNAME)#Same as STANDARDSUBPROJECT but for C files
project(${PROJECTNAME})
FILE(GLOB ALL_C_SRCS *.c)
FILE(GLOB ALL_HEADER_SRCS *.h)
include_directories(${RAKNETHEADERFILES} ./)
include_directories(${SLIKENET_HEADER_FILES} ./)
FIXCOMPILEOPTIONS()
add_executable(${PROJECTNAME} ${ALL_C_SRCS} ${ALL_HEADER_SRCS})
target_link_libraries(${PROJECTNAME} ${RAKNET_COMMON_LIBS})
target_link_libraries(${PROJECTNAME} ${SLIKENET_COMMON_LIBS})
set_target_properties(${PROJECTNAME} PROPERTIES PROJECT_GROUP Samples)
ENDMACRO(STANDARDCSUBPROJECT)

Expand Down Expand Up @@ -107,4 +107,4 @@ MACRO(FIXLINKOPTIONS)#Fix added link options that may cause problems
ENDIF(WIN32 AND NOT UNIX)
ENDMACRO(FIXLINKOPTIONS)

include(${RakNet_SOURCE_DIR}/CmakeIncludes/FindMacros.txt)#The macros for setting variables and performing finds
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/FindMacros.txt)#The macros for setting variables and performing finds
30 changes: 18 additions & 12 deletions CmakeIncludes/FindMacros.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
#
# This file was taken from RakNet 4.082 without any modifications.
# This file was taken from RakNet 4.082.
# Please see licenses/RakNet license.txt for the underlying license and related copyright.
#
#
# Modified work: Copyright (c) 2019, SLikeSoft UG (haftungsbeschr�nkt)
#
# This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
# license found in the license.txt file in the root directory of this source tree.
#

MACRO(FINDMYSQL)#A macro interface for finding a dependency
include(${RakNet_SOURCE_DIR}/CmakeIncludes/FindMySQL.cmake)
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/FindMySQL.cmake)
IF(NOT MYSQL_FOUND)
IF(WIN32)
set(MYSQL_LIBRARIES "${PROGRAMFILESX86}/MySQL/MySQL Server 5.1/lib/opt/libmysql.lib")
Expand All @@ -24,7 +30,7 @@ MACRO(FINDPOSTGRE)#A macro interface for finding a dependency
ELSE(WIN32)
set(CUSTOMPROGRAMFILES "")
ENDIF(WIN32)
include(${RakNet_SOURCE_DIR}/CmakeIncludes/FindPostgreSQL.cmake)
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/FindPostgreSQL.cmake)
IF(NOT POSTGRESQL_FOUND)
IF(WIN32)
set(POSTGRESQL_LIBRARIES "${PROGRAMFILESX86}/PostgreSQL/8.4/lib/libpq.lib")
Expand All @@ -44,7 +50,7 @@ MACRO(FINDPORTAUDIO)#A macro interface for finding a dependency
set(PORTAUDIO_LIBRARIES LibPortAudioV18_1)
set(PORTAUDIO_FOUND TRUE)
ELSE(WIN32)
include(${RakNet_SOURCE_DIR}/CmakeIncludes/FindPortAudio.cmake)
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/FindPortAudio.cmake)
ENDIF(WIN32)
IF(NOT PORTAUDIO_FOUND)
IF(NOT WIN32)
Expand All @@ -61,7 +67,7 @@ MACRO(FINDSPEEX)#A macro interface for finding a dependency
set(SPEEX_LIBRARIES LibSpeex)
set(SPEEX_FOUND TRUE)
ELSE(WIN32)
include(${RakNet_SOURCE_DIR}/CmakeIncludes/FindSpeex.cmake)
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/FindSpeex.cmake)
FINDSPEEXDSP()
ENDIF(WIN32)
IF(NOT SPEEX_FOUND)
Expand All @@ -77,7 +83,7 @@ MACRO(FINDSPEEX)#A macro interface for finding a dependency
ENDMACRO(FINDSPEEX)

MACRO(FINDBOOST)#A macro interface for finding a dependency
include(${RakNet_SOURCE_DIR}/CmakeIncludes/FindBoost.cmake)
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/FindBoost.cmake)
IF(NOT Boost_FOUND)
IF(WIN32)
set(Boost_INCLUDE_DIRS "${PROGRAMFILESX86}/boost/boost_1_35")
Expand All @@ -92,7 +98,7 @@ MACRO(FINDBOOST)#A macro interface for finding a dependency
ENDMACRO(FINDBOOST)

MACRO(FINDSPEEXDSP)#A macro interface for finding a dependency
include(${RakNet_SOURCE_DIR}/CmakeIncludes/FindSpeexDSP.cmake)
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/FindSpeexDSP.cmake)
IF(NOT SPEEXDSP_FOUND)
set(SPEEXDSP_INCLUDE_DIRS "/usr/include")
set(SPEEXDSP_LIBRARIES "/usr/lib/libspeexdsp.so")
Expand Down Expand Up @@ -140,7 +146,7 @@ MACRO(FINDSCALEGFX)
ENDMACRO(FINDSCALEGFX)

MACRO(FINDFMODEX)#A macro interface for finding a dependency
include(${RakNet_SOURCE_DIR}/CmakeIncludes/FindFMODEx.cmake)
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/FindFMODEx.cmake)
IF(NOT FMODEX_FOUND)
IF(WIN32)
set(FMODEX_LIBRARY "${PROGRAMFILESX86}/FMOD SoundSystem/FMOD Programmers API Win32/api/lib/${WINLIBNAME}.${WINLIBEXT}")
Expand All @@ -158,7 +164,7 @@ MACRO(FINDIRRLICHT)
message(STATUS "You are building with the Irrlicht option enabled,\n if irrlicht include location is not C:/irrlicht-1.6/include\n change IRRLICHT_INCLUDE_DIR with the GUI or -D command line option.\n NOTE: YOU MUST USE VERSION 1.6 for this demo.")
set(IRRLICHT_INCLUDE_DIR "C:/irrlicht-1.6/include" CACHE PATH "The Irrlicht unzip location")
ELSE(WIN32 AND NOT UNIX)
include(${RakNet_SOURCE_DIR}/CmakeIncludes/FindIrrlicht.cmake)
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/FindIrrlicht.cmake)
IF(NOT IRRLICHT_FOUND)
set(IRRLICHT_INCLUDE_DIR "/usr/include/irrlicht")
set(IRRLICHT_LIBRARIES "/usr/local/lib/libIrrlicht.so")
Expand All @@ -171,7 +177,7 @@ MACRO(FINDIRRKLANG)
IF(WIN32 AND NOT UNIX)
#currently not needed a space is here for future use
ELSE(WIN32 AND NOT UNIX)
include(${RakNet_SOURCE_DIR}/CmakeIncludes/FindIrrKlang.cmake)
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/FindIrrKlang.cmake)
IF(NOT IRRKLANG_FOUND)
set(IRRKLANG_INCLUDE_DIR "/usr/include/irrklang")
set(IRRKLANG_LIBRARIES "/usr/local/lib/libIrrKlang.so")
Expand All @@ -181,7 +187,7 @@ MACRO(FINDIRRKLANG)
ENDMACRO(FINDIRRKLANG)

MACRO(FINDOGRE3D)#A macro interface for finding a dependency
include(${RakNet_SOURCE_DIR}/CmakeIncludes/Ogre3D/FindOGRE.cmake)
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/Ogre3D/FindOGRE.cmake)
IF(NOT OGRE_FOUND)
IF(WIN32)
FILE(GLOB OGRE_LIBRARIES "C:/OgreSDK/lib/*.lib")
Expand All @@ -196,7 +202,7 @@ MACRO(FINDOGRE3D)#A macro interface for finding a dependency
ENDMACRO(FINDOGRE3D)

MACRO(FINDOIS)#A macro interface for finding a dependency
include(${RakNet_SOURCE_DIR}/CmakeIncludes/Ogre3D/FindOIS.cmake)
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/Ogre3D/FindOIS.cmake)
IF(NOT OIS_FOUND)
IF(WIN32)
set(OIS_LIBRARIES "")
Expand Down
16 changes: 13 additions & 3 deletions CmakeIncludes/Ogre3D/FindOGRE.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
#This has been modified fron the original
# This file was taken from RakNet 4.082.
# Please see licenses/RakNet license.txt for the underlying license and related copyright.
#
#
# Modified work: Copyright (c) 2019, SLikeSoft UG (haftungsbeschränkt)
#
# This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
# license found in the license.txt file in the root directory of this source tree.
#

#This has been modified fron the original

include(${RakNet_SOURCE_DIR}/CmakeIncludes/Ogre3D/PreprocessorUtils.cmake)
include(${RakNet_SOURCE_DIR}/CmakeIncludes/Ogre3D/FindPkgMacros.cmake)
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/Ogre3D/PreprocessorUtils.cmake)
include(${SLikeNet_SOURCE_DIR}/CmakeIncludes/Ogre3D/FindPkgMacros.cmake)

#-------------------------------------------------------------------
# This file is part of the CMake build system for OGRE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Please see licenses/RakNet license.txt for the underlying license and related copyright.
#
#
# Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
# Modified work: Copyright (c) 2017-2019, SLikeSoft UG (haftungsbeschränkt)
#
# This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
# license found in the license.txt file in the root directory of this source tree.
Expand All @@ -14,14 +14,14 @@ FINDMYSQL()
IF(WIN32 AND NOT UNIX)
FILE(GLOB ALL_HEADER_SRCS *.h ${MySQLInterface_SOURCE_DIR}/MySQLInterFace.h ${Autopatcher_SOURCE_DIR}/ApplyPatch.h)
FILE(GLOB ALL_CPP_SRCS *.cpp ${MySQLInterface_SOURCE_DIR}/MySQLInterFace.cpp ${Autopatcher_SOURCE_DIR}/ApplyPatch.cpp)
include_directories(${RAKNETHEADERFILES} ./ ${MySQLInterface_SOURCE_DIR} ${Autopatcher_SOURCE_DIR} ${MYSQL_INCLUDE_DIR} ${BZip2_SOURCE_DIR})
include_directories(${SLIKENET_HEADER_FILES} ./ ${MySQLInterface_SOURCE_DIR} ${Autopatcher_SOURCE_DIR} ${MYSQL_INCLUDE_DIR} ${BZip2_SOURCE_DIR})
add_library(AutoPatcherMySQLRepository STATIC ${ALL_CPP_SRCS} ${ALL_HEADER_SRCS})
target_link_libraries (AutoPatcherMySQLRepository ${RAKNET_COMMON_LIBS} ${MYSQL_LIBRARIES})
target_link_libraries (AutoPatcherMySQLRepository ${SLIKENET_COMMON_LIBS} ${MYSQL_LIBRARIES})
VSUBFOLDER(AutoPatcherMySQLRepository "Samples/AutoPatcher/Server/MySQL")
ELSE(WIN32 AND NOT UNIX)
FILE(GLOB ALL_HEADER_SRCS *.h)
FILE(GLOB ALL_CPP_SRCS *.cpp)
include_directories(${RAKNETHEADERFILES} ./ ${MySQLInterface_SOURCE_DIR} ${Autopatcher_SOURCE_DIR} ${MYSQL_INCLUDE_DIR})
include_directories(${SLIKENET_HEADER_FILES} ./ ${MySQLInterface_SOURCE_DIR} ${Autopatcher_SOURCE_DIR} ${MYSQL_INCLUDE_DIR})
add_library(AutoPatcherMySQLRepository STATIC ${ALL_CPP_SRCS} ${ALL_HEADER_SRCS})
target_link_libraries (AutoPatcherMySQLRepository ${RAKNET_COMMON_LIBS} LibAutopatcher LibMySQLInterface ${MYSQL_LIBRARIES})
target_link_libraries (AutoPatcherMySQLRepository ${SLIKENET_COMMON_LIBS} LibAutopatcher LibMySQLInterface ${MYSQL_LIBRARIES})
ENDIF(WIN32 AND NOT UNIX)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Please see licenses/RakNet license.txt for the underlying license and related copyright.
#
#
# Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
# Modified work: Copyright (c) 2017-2019, SLikeSoft UG (haftungsbeschränkt)
#
# This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
# license found in the license.txt file in the root directory of this source tree.
Expand All @@ -14,14 +14,14 @@ FINDPOSTGRE()
IF(WIN32 AND NOT UNIX)
FILE(GLOB ALL_HEADER_SRCS *.h ${PostgreSQLInterface_SOURCE_DIR}/PostgreSQLInterface.h ${Autopatcher_SOURCE_DIR}/ApplyPatch.h ${Autopatcher_SOURCE_DIR}/CreatePatch.h)
FILE(GLOB ALL_CPP_SRCS *.cpp ${PostgreSQLInterface_SOURCE_DIR}/PostgreSQLInterface.cpp ${Autopatcher_SOURCE_DIR}/ApplyPatch.cpp ${Autopatcher_SOURCE_DIR}/CreatePatch.cpp)
include_directories(${RAKNETHEADERFILES} ./ ${PostgreSQLInterface_SOURCE_DIR} ${Autopatcher_SOURCE_DIR} ${POSTGRESQL_INCLUDE_DIR} ${BZip2_SOURCE_DIR})
include_directories(${SLIKENET_HEADER_FILES} ./ ${PostgreSQLInterface_SOURCE_DIR} ${Autopatcher_SOURCE_DIR} ${POSTGRESQL_INCLUDE_DIR} ${BZip2_SOURCE_DIR})
add_library(AutopatcherPostgreRepository STATIC ${ALL_CPP_SRCS} ${ALL_HEADER_SRCS})
target_link_libraries (AutopatcherPostgreRepository ${RAKNET_COMMON_LIBS} ${POSTGRESQL_LIBRARIES})
target_link_libraries (AutopatcherPostgreRepository ${SLIKENET_COMMON_LIBS} ${POSTGRESQL_LIBRARIES})
VSUBFOLDER(AutopatcherPostgreRepository "Samples/AutoPatcher/Server/PostgreSQL")
ELSE(WIN32 AND NOT UNIX)
FILE(GLOB ALL_HEADER_SRCS *.h)
FILE(GLOB ALL_CPP_SRCS *.cpp)
include_directories(${RAKNETHEADERFILES} ./ ${PostgreSQLInterface_SOURCE_DIR} ${Autopatcher_SOURCE_DIR} ${POSTGRESQL_INCLUDE_DIR})
include_directories(${SLIKENET_HEADER_FILES} ./ ${PostgreSQLInterface_SOURCE_DIR} ${Autopatcher_SOURCE_DIR} ${POSTGRESQL_INCLUDE_DIR})
add_library(AutopatcherPostgreRepository STATIC ${ALL_CPP_SRCS} ${ALL_HEADER_SRCS})
target_link_libraries (AutopatcherPostgreRepository ${RAKNET_COMMON_LIBS} LibAutopatcher LibPostgreSQLInterface ${POSTGRESQL_LIBRARIES})
target_link_libraries (AutopatcherPostgreRepository ${SLIKENET_COMMON_LIBS} LibAutopatcher LibPostgreSQLInterface ${POSTGRESQL_LIBRARIES})
ENDIF(WIN32 AND NOT UNIX)
12 changes: 9 additions & 3 deletions DependentExtensions/Autopatcher/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
#
# This file was taken from RakNet 4.082 without any modifications.
# This file was taken from RakNet 4.082.
# Please see licenses/RakNet license.txt for the underlying license and related copyright.
#
#
# Modified work: Copyright (c) 2019, SLikeSoft UG (haftungsbeschränkt)
#
# This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
# license found in the license.txt file in the root directory of this source tree.
#

project(Autopatcher)
IF (UNIX AND NOT WIN32)
FILE(GLOB ALL_HEADER_SRCS *.h)
FILE(GLOB ALL_CPP_SRCS *.cpp)
include_directories(${RAKNETHEADERFILES} ./ ${bzip2-1.0.3_SOURCE_DIR})
include_directories(${SLIKENET_HEADER_FILES} ./ ${bzip2-1.0.3_SOURCE_DIR})
add_library(LibAutopatcher STATIC ${ALL_CPP_SRCS} ${ALL_HEADER_SRCS})
target_link_libraries (LibAutopatcher ${RAKNET_COMMON_LIBS} LibBZip2)
target_link_libraries (LibAutopatcher ${SLIKENET_COMMON_LIBS} LibBZip2)
ENDIF(UNIX AND NOT WIN32)
IF(USEMYSQL AND NOT DISABLEDEPENDENCIES)
add_subdirectory(AutopatcherMySQLRepository)
Expand Down
Loading

0 comments on commit 7b24c06

Please sign in to comment.