view libcommon/CMakeLists.txt @ 139:b80d37e71b87

Client: rework dispatching between client and window, closes #711 The window backend is able to produce user events but they need to be dispatched into the client, the state and the window. This change makes client owner of window and dispatches events from client to the window and the future state mechanism. Remove the client network code temporarily to rework in the dispatcher later.
author David Demelier <markand@malikania.fr>
date Wed, 27 Sep 2017 20:34:59 +0200
parents 37df5aa9ba82
children f67c187bfceb
line wrap: on
line source

#
# CMakeLists.txt -- CMake build system for malikania
#
# Copyright (c) 2013-2017 David Demelier <markand@malikania.fr>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

project(libmlk-common)

set(
    HEADERS
    ${libmlk-common_SOURCE_DIR}/malikania/game.hpp
    ${libmlk-common_SOURCE_DIR}/malikania/id.hpp
    ${libmlk-common_SOURCE_DIR}/malikania/loader.hpp
    ${libmlk-common_SOURCE_DIR}/malikania/locator.hpp
    ${libmlk-common_SOURCE_DIR}/malikania/size.hpp
    ${libmlk-common_SOURCE_DIR}/malikania/tileset.hpp
    ${libmlk-common_SOURCE_DIR}/malikania/unicode.hpp
    ${libmlk-common_SOURCE_DIR}/malikania/util.hpp
    ${libmlk-common_SOURCE_DIR}/malikania/weak_array.hpp
)

set(
    SOURCES
    ${libmlk-common_SOURCE_DIR}/malikania/loader.cpp
    ${libmlk-common_SOURCE_DIR}/malikania/locator.cpp
    ${libmlk-common_SOURCE_DIR}/malikania/unicode.cpp
    ${libmlk-common_SOURCE_DIR}/malikania/util.cpp
)

if (WITH_BACKEND MATCHES "SDL")
    find_package(SDL2 REQUIRED)

    list(APPEND HEADERS ${libmlk-common_SOURCE_DIR}/malikania/${WITH_BACKEND_DIR}/sdl_util.hpp)
    list(APPEND SOURCES ${libmlk-common_SOURCE_DIR}/malikania/${WITH_BACKEND_DIR}/sdl_util.cpp)
    list(APPEND INCLUDES ${SDL2_INCLUDE_DIRS})
    list(APPEND LIBRARIES ${SDL2_LIBRARIES})
endif ()

if (WIN32)
    list(APPEND LIBRARIES ws2_32)
endif ()

malikania_define_library(
    PROJECT libmlk-common
    TARGET libmlk-common
    SOURCES ${HEADERS} ${SOURCES}
    FLAGS "MALIKANIA_COMMON_BUILD"
    PUBLIC_INCLUDES
        ${Boost_INCLUDE_DIRS}
        ${INCLUDES}
        $<BUILD_INTERFACE:${libmlk-common_SOURCE_DIR}/malikania>
        $<BUILD_INTERFACE:${libmlk-common_SOURCE_DIR}>
    LIBRARIES
        json
        ${Boost_LIBRARIES}
        ${LIBRARIES}
)