tibia-client/CMakeLists.txt

61 lines
1.9 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 2.6)
project(otclient)
2014-11-03 00:57:19 +01:00
set(VERSION "0.6.6")
2012-08-30 00:00:08 +02:00
option(FRAMEWORK_SOUND "Use SOUND " ON)
option(FRAMEWORK_GRAPHICS "Use GRAPHICS " ON)
option(FRAMEWORK_XML "Use XML " ON)
option(FRAMEWORK_NET "Use NET " ON)
2013-03-06 16:59:59 +01:00
option(FRAMEWORK_SQL "Use SQL" OFF)
include(src/framework/CMakeLists.txt)
include(src/client/CMakeLists.txt)
# functions map for reading backtraces
2013-02-05 22:03:18 +01:00
if(NOT APPLE)
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,-Map=${PROJECT_NAME}.map")
endif()
option(USE_PCH "Use precompiled header (speed up compile)" OFF)
2011-08-14 04:09:11 +02:00
set(executable_SOURCES
src/main.cpp
)
# add executable icon for win32 platforms
if(WIN32)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/otcicon.o
2011-11-17 03:53:17 +01:00
COMMAND ${CMAKE_RC_COMPILER}
-I${CMAKE_CURRENT_SOURCE_DIR}/src
-i${CMAKE_CURRENT_SOURCE_DIR}/src/otcicon.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/otcicon.o)
2012-08-20 23:53:06 +02:00
set(executable_SOURCES ${executable_SOURCES} otcicon.o)
2012-08-03 12:13:46 +02:00
endif()
2012-08-30 00:00:08 +02:00
add_definitions(-D"VERSION=\\"${VERSION}\\"")
# add client executable
2014-11-05 14:25:11 +01:00
add_executable(${PROJECT_NAME} ${framework_SOURCES} ${client_SOURCES} ${executable_SOURCES})
target_link_libraries(${PROJECT_NAME} ${framework_LIBRARIES})
2011-08-14 04:09:11 +02:00
if(USE_PCH)
include(cotire)
cotire(${PROJECT_NAME})
message(STATUS "Use precompiled header: ON")
else()
message(STATUS "Use precompiled header: OFF")
endif()
2011-05-16 22:59:34 +02:00
# installation
set(DATA_INSTALL_DIR share/${PROJECT_NAME})
2014-11-05 14:25:11 +01:00
install(TARGETS ${PROJECT_NAME}
2014-02-16 15:02:46 +01:00
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(FILES README.md BUGS LICENSE AUTHORS init.lua ${PROJECT_NAME}rc.lua DESTINATION ${DATA_INSTALL_DIR})
2013-01-23 16:43:39 +01:00
install(DIRECTORY data modules DESTINATION ${DATA_INSTALL_DIR} PATTERN ".git" EXCLUDE)
2012-08-14 21:41:48 +02:00
# add "make run"
add_custom_target(run COMMAND ${PROJECT_NAME} DEPENDS ${PROJECT_NAME} WORKING_DIRECTORY ${CMAKE_PROJECT_DIR})