CMake: Build framework independently from OTClient then link OTC against

it.

Now framework is built as a static library which should hopefully speed up
the build (in terms of compiling and linking).
This commit is contained in:
Ahmed Samy 2014-02-12 21:01:34 +02:00
parent 57a330e589
commit c07d448aac
1 changed files with 7 additions and 2 deletions

View File

@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6)
project(otclient)
set(VERSION "0.6.5")
set(LIB_NAME "otc_framework")
option(FRAMEWORK_SOUND "Use SOUND " ON)
option(FRAMEWORK_GRAPHICS "Use GRAPHICS " ON)
@ -35,11 +36,15 @@ endif()
add_definitions(-D"VERSION=\\"${VERSION}\\"")
# we want framework to be a static library for faster compilation/linking
add_library(${LIB_NAME} ${framework_SOURCES})
target_link_libraries(${LIB_NAME} ${framework_LIBRARIES})
# add client executable
add_executable(${PROJECT_NAME} ${framework_SOURCES} ${client_SOURCES} ${executable_SOURCES})
add_executable(${PROJECT_NAME} ${client_SOURCES} ${executable_SOURCES})
# target link libraries
target_link_libraries(${PROJECT_NAME} ${framework_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${LIB_NAME})
if(USE_PCH)
include(cotire)