initial commit
This commit is contained in:
41
CMakeLists.txt
Normal file
41
CMakeLists.txt
Normal file
@@ -0,0 +1,41 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
project(DarkRP2D_DEDICATED_SERVER)
|
||||
set (CMAKE_CXX_STANDARD 11)
|
||||
include(ExternalProject)
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RELEASE)
|
||||
add_definitions(-DNDEBUG)
|
||||
endif(NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )
|
||||
MESSAGE( STATUS "DarkRP2D_DEDICATED_SERVER_SOURCE_DIR: " ${DarkRP2D_DEDICATED_SERVER_SOURCE_DIR} )
|
||||
|
||||
set(DarkRP2D_EXTERNAL_DIR ${DarkRP2D_DEDICATED_SERVER_SOURCE_DIR}/../external)
|
||||
set(SDL2_net_DIR ${DarkRP2D_EXTERNAL_DIR}/SDL2_net-2.0.1)
|
||||
set(SDL2_DIR ${DarkRP2D_EXTERNAL_DIR}/SDL2-2.0.8)
|
||||
|
||||
#Libs
|
||||
|
||||
find_package(SDL2 REQUIRED CONFIG)
|
||||
include_directories(${SDL2_INCLUDE_DIRS})
|
||||
|
||||
find_package(SDL2_net REQUIRED CONFIG)
|
||||
include_directories(${SDL2_NET_INCLUDE_DIRS})
|
||||
|
||||
MESSAGE( STATUS "SDL2 Lib: " ${SDL2_LIBRARIES} )
|
||||
MESSAGE( STATUS "SDL2_NET Lib: " ${SDL2_NET_LIBRARIES} )
|
||||
|
||||
file(GLOB_RECURSE DarkRP2D_DEDICATED_SERVER_SOURCE_FILES ${DarkRP2D_DEDICATED_SERVER_SOURCE_DIR}/src/*.cpp)
|
||||
|
||||
add_executable(DarkRP2DDServer ${DarkRP2D_DEDICATED_SERVER_SOURCE_FILES})
|
||||
|
||||
target_link_libraries(DarkRP2DDServer ${SDL2_LIBRARIES}
|
||||
${SDL2_NET_LIBRARIES} )
|
||||
|
||||
add_custom_target(CopyBinaries
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${SDL2_DLL} ${CMAKE_BINARY_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${SDL2_NET_DLL} ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
||||
add_dependencies(DarkRP2DDServer CopyBinaries)
|
||||
Reference in New Issue
Block a user