mirror of https://github.com/fallahn/tmxlite.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.3 KiB
CMake
54 lines
1.3 KiB
CMake
cmake_minimum_required(VERSION 2.8.12)
|
|
|
|
project(SFML_example)
|
|
SET(PROJECT_NAME SDL2_example)
|
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
|
|
endif()
|
|
|
|
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
|
SET(PROJECT_STATIC_RUNTIME FALSE CACHE BOOL "Use statically linked standard/runtime libraries?")
|
|
#SET(PROJECT_STATIC_TMX FALSE CACHE BOOL "Use statically linked tmxlite library?")
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX OR APPLE)
|
|
if(PROJECT_STATIC_RUNTIME)
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++14 -static")
|
|
else()
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++14")
|
|
endif()
|
|
endif()
|
|
|
|
SET (CMAKE_CXX_FLAGS_DEBUG "-g -D_DEBUG_")
|
|
SET (CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG")
|
|
|
|
find_package(TMXLITE REQUIRED)
|
|
find_package(SDL2 REQUIRED)
|
|
|
|
include_directories(
|
|
${TMXLITE_INCLUDE_DIR}
|
|
${SDL2_INCLUDE_DIR})
|
|
|
|
set(PROJECT_SRC
|
|
src/main.cpp
|
|
src/MapLayer.cpp
|
|
src/Texture.cpp)
|
|
|
|
if(WIN32)
|
|
add_executable(${PROJECT_NAME} WIN32 ${PROJECT_SRC})
|
|
else()
|
|
add_executable(${PROJECT_NAME} ${PROJECT_SRC})
|
|
endif()
|
|
|
|
target_link_libraries(${PROJECT_NAME}
|
|
${TMXLITE_LIBRARIES}
|
|
${SDL2_LIBRARY})
|
|
|
|
#install executable
|
|
install(TARGETS ${PROJECT_NAME}
|
|
RUNTIME DESTINATION .)
|
|
|
|
#install game data
|
|
install(DIRECTORY assets
|
|
DESTINATION .)
|