buildat/CMakeLists.txt

87 lines
2.1 KiB
CMake
Raw Normal View History

2014-09-16 15:27:57 +03:00
cmake_minimum_required(VERSION 2.6)
project(buildat)
2014-09-16 18:02:01 +03:00
#
# Libraries
#
add_subdirectory("3rdparty/cereal")
add_subdirectory("3rdparty/c55lib")
2014-09-16 18:02:01 +03:00
2014-09-16 15:27:57 +03:00
#
# Polycode
#
SET(POLYCODE_ROOT_DIR "${buildat_SOURCE_DIR}/../polycode")
SET(POLYCODE_RELEASE_DIR ${POLYCODE_ROOT_DIR}/Release/${CMAKE_SYSTEM_NAME})
SET(POLYCODE_CMAKE_DIR ${POLYCODE_ROOT_DIR}/CMake)
SET(CMAKE_INSTALL_PREFIX ${POLYCODE_RELEASE_DIR}/Standalone/)
SET(CMAKE_PREFIX_PATH
${POLYCODE_RELEASE_DIR}/Framework/Core/Dependencies
${POLYCODE_RELEASE_DIR}/Framework/Modules/Dependencies
${POLYCODE_RELEASE_DIR}/Framework/Tools/Dependencies
)
SET(CMAKE_DEBUG_POSTFIX "_d")
SET(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${POLYCODE_CMAKE_DIR}
)
INCLUDE(${POLYCODE_CMAKE_DIR}/PolycodeDependencies.cmake)
include_directories("../polycode/Bindings/Contents/LUA/Include")
#
# Buildat
#
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++0x -g -O0 -Wall")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# Always output in color (useful when using head for build output)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
# Security / crash protection
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all")
2014-09-17 01:25:55 +03:00
include_directories("src")
include_directories("3rdparty/c55lib")
include_directories("3rdparty/cereal/include")
2014-09-16 15:27:57 +03:00
2014-09-16 17:58:01 +03:00
# Client
2014-09-16 15:27:57 +03:00
set(CLIENT_EXE_NAME buildat_client)
set(CLIENT_SRCS
src/client/main.cpp
2014-09-17 13:37:34 +03:00
src/client/state.cpp
src/client/app.cpp
2014-09-18 00:22:37 +03:00
src/core/log.cpp
2014-09-17 13:37:34 +03:00
src/impl/tcpsocket.cpp
2014-09-16 15:27:57 +03:00
)
add_executable(${CLIENT_EXE_NAME} ${CLIENT_SRCS})
TARGET_LINK_LIBRARIES(${CLIENT_EXE_NAME}
${POLYCODE_DEPENDENCY_LIBS}
c55lib
2014-09-16 15:27:57 +03:00
)
2014-09-16 17:58:01 +03:00
# Server
set(SERVER_EXE_NAME buildat_server)
set(SERVER_SRCS
src/server/main.cpp
2014-09-16 20:39:57 +03:00
src/server/state.cpp
src/server/rccpp.cpp
src/core/log.cpp
src/impl/fs.cpp
2014-09-17 02:18:03 +03:00
src/impl/event.cpp
src/impl/tcpsocket.cpp
2014-09-17 23:00:31 +03:00
src/impl/module.cpp
2014-09-18 16:04:22 +03:00
src/impl/linux/file_watch.cpp
2014-09-16 17:58:01 +03:00
)
add_executable(${SERVER_EXE_NAME} ${SERVER_SRCS})
TARGET_LINK_LIBRARIES(${SERVER_EXE_NAME}
c55lib
2014-09-16 20:39:57 +03:00
dl
)
2014-09-16 23:14:04 +03:00
add_definitions()
2014-09-16 17:58:01 +03:00