add multi config suppor
This commit is contained in:
@@ -3,11 +3,6 @@ project(DarkRP2D_DEDICATED_SERVER)
|
|||||||
set (CMAKE_CXX_STANDARD 11)
|
set (CMAKE_CXX_STANDARD 11)
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
|
||||||
set(CMAKE_BUILD_TYPE Release)
|
|
||||||
add_definitions(-DNDEBUG)
|
|
||||||
endif(NOT CMAKE_BUILD_TYPE)
|
|
||||||
|
|
||||||
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
||||||
MESSAGE( "64-Bit Compiler erkannt" )
|
MESSAGE( "64-Bit Compiler erkannt" )
|
||||||
SET( EX_PLATFORM 64 )
|
SET( EX_PLATFORM 64 )
|
||||||
@@ -18,11 +13,10 @@ else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
|||||||
SET( EX_PLATFORM_NAME "x86" )
|
SET( EX_PLATFORM_NAME "x86" )
|
||||||
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
|
||||||
|
|
||||||
|
|
||||||
# Download automatically, you can also just copy the conan.cmake file
|
# Download automatically, you can also just copy the conan.cmake file
|
||||||
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
|
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
|
||||||
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
|
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
|
||||||
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.13/conan.cmake"
|
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.15/conan.cmake"
|
||||||
"${CMAKE_BINARY_DIR}/conan.cmake")
|
"${CMAKE_BINARY_DIR}/conan.cmake")
|
||||||
endif()
|
endif()
|
||||||
include(${CMAKE_BINARY_DIR}/conan.cmake)
|
include(${CMAKE_BINARY_DIR}/conan.cmake)
|
||||||
@@ -30,13 +24,14 @@ include(${CMAKE_BINARY_DIR}/conan.cmake)
|
|||||||
# Launch Conan Install
|
# Launch Conan Install
|
||||||
conan_cmake_run(CONANFILE conanfile.txt
|
conan_cmake_run(CONANFILE conanfile.txt
|
||||||
BASIC_SETUP CMAKE_TARGETS
|
BASIC_SETUP CMAKE_TARGETS
|
||||||
BUILD missing)
|
BUILD missing
|
||||||
|
CONFIGURATION_TYPES "Release;Debug")
|
||||||
|
|
||||||
MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )
|
MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )
|
||||||
MESSAGE( STATUS "DarkRP2D_DEDICATED_SERVER_SOURCE_DIR: " ${DarkRP2D_DEDICATED_SERVER_SOURCE_DIR} )
|
MESSAGE( STATUS "DarkRP2D_DEDICATED_SERVER_SOURCE_DIR: " ${DarkRP2D_DEDICATED_SERVER_SOURCE_DIR} )
|
||||||
|
|
||||||
#Libs
|
#Libs
|
||||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
include(${CMAKE_BINARY_DIR}/conanbuildinfo_multi.cmake)
|
||||||
conan_basic_setup()
|
conan_basic_setup()
|
||||||
|
|
||||||
file(GLOB_RECURSE DarkRP2D_DEDICATED_SERVER_SOURCE_FILES ${DarkRP2D_DEDICATED_SERVER_SOURCE_DIR}/src/*.cpp)
|
file(GLOB_RECURSE DarkRP2D_DEDICATED_SERVER_SOURCE_FILES ${DarkRP2D_DEDICATED_SERVER_SOURCE_DIR}/src/*.cpp)
|
||||||
@@ -47,7 +42,12 @@ MESSAGE( STATUS "Conan search Dirs: " "${CONAN_LIB_DIRS}")
|
|||||||
MESSAGE( STATUS "Conan Libs: " "${CONAN_LIBS}")
|
MESSAGE( STATUS "Conan Libs: " "${CONAN_LIBS}")
|
||||||
MESSAGE( STATUS "Conan Includes: " "${CONAN_INCLUDE_DIRS}")
|
MESSAGE( STATUS "Conan Includes: " "${CONAN_INCLUDE_DIRS}")
|
||||||
|
|
||||||
target_link_libraries(DarkRP2DDServer ${CONAN_LIBS})
|
foreach(_LIB ${CONAN_LIBS_RELEASE})
|
||||||
|
target_link_libraries(DarkRP2DDServer optimized ${_LIB})
|
||||||
|
endforeach()
|
||||||
|
foreach(_LIB ${CONAN_LIBS_DEBUG})
|
||||||
|
target_link_libraries(DarkRP2DDServer debug ${_LIB})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
#add_custom_target(CopyBinaries
|
#add_custom_target(CopyBinaries
|
||||||
#COMMAND ${CMAKE_COMMAND} -E copy ${SDL2_DLL} ${CMAKE_BINARY_DIR}
|
#COMMAND ${CMAKE_COMMAND} -E copy ${SDL2_DLL} ${CMAKE_BINARY_DIR}
|
||||||
|
|||||||
Reference in New Issue
Block a user