mcserver/CMakeLists.txt

47 lines
1.4 KiB
CMake
Raw Normal View History

2013-12-10 10:41:43 -08:00
cmake_minimum_required (VERSION 2.6)
project (MCServer)
if(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
endif()
2013-12-10 13:39:20 -08:00
set(CMAKE_CXX_FLAGS_BAK ${CMAKE_CXX_FLAGS})
2013-12-18 16:52:52 -08:00
set(CMAKE_C_FLAGS_BAK ${CMAKE_C_FLAGS})
2013-12-19 07:29:23 -08:00
if (UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
else()
2013-12-19 15:42:47 -08:00
#remove /W3 from command line -- cannot just cancel it later with /w like in unix because of D9025
string(REPLACE "/W3" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "/W3" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
2013-12-19 07:29:23 -08:00
endif()
2013-12-10 14:43:21 -08:00
set(CMAKE_BUILD_TYPE_BAK ${CMAKE_BUILD_TYPE})
set(CMAKE_BUILD_TYPE "Release")
2013-12-10 13:39:20 -08:00
2013-12-10 10:41:43 -08:00
add_subdirectory(lib/inifile/)
2013-12-10 13:39:20 -08:00
add_subdirectory(lib/jsoncpp/)
add_subdirectory(lib/cryptopp/)
2013-12-10 15:26:55 -08:00
add_subdirectory(lib/zlib/)
2013-12-18 15:14:11 -08:00
add_subdirectory(lib/lua/)
2013-12-18 15:54:55 -08:00
add_subdirectory(lib/tolua++/)
2013-12-18 16:28:48 -08:00
add_subdirectory(lib/sqlite/)
2013-12-18 16:52:52 -08:00
add_subdirectory(lib/expat/)
add_subdirectory(lib/luaexpat/)
2013-12-18 16:55:01 -08:00
add_subdirectory(lib/md5/)
2013-12-10 13:39:20 -08:00
#TODo: set -Wall -Werror -Wextra
2013-12-19 07:29:23 -08:00
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_BAK} -Wall -Wextra")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BAK} -Wall -Wextra")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_BAK} /Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BAK} /Wall")
endif()
2013-12-10 14:43:21 -08:00
set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE_BAK}")
2013-12-18 16:52:52 -08:00
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic")
2013-12-10 13:39:20 -08:00
2013-12-10 10:41:43 -08:00
add_subdirectory (src)