Skip to content

Commit

Permalink
- port SLikeNet 0.1.0 changes from SVN to Git - part 47
Browse files Browse the repository at this point in the history
   - updated root directory to SLikeNet 0.1.0
  • Loading branch information
Luke1410 committed Aug 6, 2017
1 parent a2e4583 commit f3e0375
Show file tree
Hide file tree
Showing 5 changed files with 3,566 additions and 420 deletions.
54 changes: 50 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
#
# 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) 2016, 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)

# CMake policy settings
if( POLICY CMP0037 )
cmake_policy(SET CMP0037 NEW) # CMake 3.0 warning: Target names should not be reserved and should match a validity pattern (aka: add_*-command target names)
endif()
if( POLICY CMP0042 )
cmake_policy(SET CMP0042 NEW) # CMake 3.0 warning: Use @rpath in a target's install name.
endif()

# explicitly enable @rpath in the install name for any shared library being built (for cmake >=2.8.12 and <3.0 - it's enabled by default for >= 3.0)
# note that for cmake < 2.8.12 we do not use rpath but rather keep the RakNet 4.082 behavior
if( CMAKE_VERSION VERSION_LESS 3.0 )
if(NOT (CMAKE_VERSION VERSION_LESS 2.8.12))
# MACOSX_RPATH support was added in cmake 2.8.12
set(CMAKE_MACOSX_RPATH 1)
endif()
endif()


if( NOT APPLE )
# check 64 bit
if( CMAKE_SIZEOF_VOID_P MATCHES "4" )
Expand All @@ -13,7 +43,7 @@ endif( NOT APPLE )

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

IF (WIN32 AND NOT UNIX)
Expand All @@ -22,9 +52,25 @@ ELSE(WIN32 AND NOT UNIX)
set(RAKNET_LIBRARY_LIBS pthread)
ENDIF(WIN32 AND NOT UNIX)

# enable C++11 language support for GCC
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()

# Options
option( RAKNET_ENABLE_SAMPLES "Generate RakNet sample projects if true." TRUE )
IF (WIN32 AND NOT UNIX)
option( RAKNET_ENABLE_SAMPLES "Generate RakNet 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 )
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 )
Expand All @@ -41,7 +87,7 @@ if( RAKNET_GENERATE_INCLUDE_ONLY_DIR )
message( STATUS "DONE: Setting up the ${RAKNET_NAMED_INCLUDE_ONLY_DIR} directory." )
endif()

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

include(./CmakeIncludes/CmakeMacros.txt)
FIXLINKOPTIONS()
Expand All @@ -55,4 +101,4 @@ set(RAKNET_COMMON_LIBS RakNetLibStatic)

if( RAKNET_ENABLE_SAMPLES )
add_subdirectory(Samples)
endif()
endif()
Loading

0 comments on commit f3e0375

Please sign in to comment.