1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Tweaks for cmake build system: data dir definitions, flags for clang (not tested), missing CQuestLog.cpp file for the client, naming convention of few binaries same for autotools and cmake

This commit is contained in:
ddaroo 2012-07-15 16:05:41 +00:00
parent edccbd4809
commit 69de38bf1d
9 changed files with 46 additions and 22 deletions

View File

@ -9,4 +9,4 @@ set(emptyAI_SRCS
)
add_library(emptyAI SHARED ${emptyAI_SRCS})
target_link_libraries(emptyAI vcmi_lib)
target_link_libraries(emptyAI vcmi)

View File

@ -47,5 +47,5 @@ set(FuzzyLite_lib_SRCS
add_library(FuzzyLite_lib STATIC ${FuzzyLite_lib_SRCS})
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
SET_TARGET_PROPERTIES(FuzzyLite_lib PROPERTIES COMPILE_FLAGS "-fPIC")
SET_TARGET_PROPERTIES(FuzzyLite_lib PROPERTIES COMPILE_FLAGS "-fPIC")
ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")

View File

@ -8,5 +8,5 @@ set(stupidAI_SRCS
main.cpp
)
add_library(stupidAI SHARED ${stupidAI_SRCS})
target_link_libraries(stupidAI vcmi_lib)
add_library(StupidAI SHARED ${stupidAI_SRCS})
target_link_libraries(StupidAI vcmi)

View File

@ -10,4 +10,4 @@ set(VCAI_SRCS
)
add_library(VCAI SHARED ${VCAI_SRCS})
target_link_libraries(VCAI FuzzyLite_lib vcmi_lib)
target_link_libraries(VCAI FuzzyLite_lib vcmi)

View File

@ -1,6 +1,9 @@
project(vcmi)
cmake_minimum_required(VERSION 2.6)
#needed?
INCLUDE(CheckLibraryExists)
# where to look for cmake modules
set(CMAKE_MODULE_PATH ${CMAKE_HOME_DIRECTORY}/cmake_modules)
@ -14,10 +17,30 @@ find_package(SDL_ttf REQUIRED)
find_package(ZLIB REQUIRED)
find_package(FFMPEG_swscale REQUIRED)
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-std=c++0x -Wall -Wclobbered -Wempty-body -Wignored-qualifiers -Wmissing-field-initializers -Wsign-compare -Wtype-limits -Wuninitialized")
#check if some platform-specific libraries are needed for linking client and server
CHECK_LIBRARY_EXISTS(rt shm_open "" HAVE_RT_LIB)
if(HAVE_RT_LIB)
set(RT_LIB -lrt)
endif()
CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_DL_LIB)
if(HAVE_DL_LIB)
set(DL_LIB -ldl)
endif()
if(CMAKE_CXX_COMPILER MATCHES ".*clang")
set(CMAKE_COMPILER_IS_CLANGXX 1)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
set(CMAKE_CXX_FLAGS "-std=c++0x -Wall -Wextra -Wpointer-arith -Wno-switch -Wno-sign-compare -Wno-unused-parameter -Wno-overloaded-virtual")
endif()
#define required constants
add_definitions(-DM_DATA_DIR="${CMAKE_INSTALL_PREFIX}/share")
add_definitions(-DM_BIN_DIR="${CMAKE_INSTALL_PREFIX}/lib/vcmi")
add_definitions(-DM_LIB_DIR="${CMAKE_INSTALL_PREFIX}/bin")
add_subdirectory(lib)
add_subdirectory(client)
add_subdirectory(server)

View File

@ -1,13 +1,13 @@
project(vcmi_ERM)
project(vcmiERM)
cmake_minimum_required(VERSION 2.6)
include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIRECTORY})
set(lib_SRCS
ERMInterpreter.cpp
ERMInterpreter.cpp
ERMParser.cpp
ERMScriptModule.cpp
)
add_library(vcmi_ERM_lib SHARED ${lib_SRCS})
target_link_libraries(vcmi_ERM_lib ${Boost_LIBRARIES})
add_library(vcmiERM SHARED ${lib_SRCS})
target_link_libraries(vcmiERM ${Boost_LIBRARIES})

View File

@ -1,4 +1,4 @@
project(vcmi_client)
project(vcmiclient)
cmake_minimum_required(VERSION 2.6)
include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/lib)
@ -39,6 +39,7 @@ set(client_SRCS
CSndHandler.cpp
CSpellWindow.cpp
CVideoHandler.cpp
CQuestLog.cpp
Graphics.cpp
GUIClasses.cpp
mapHandler.cpp
@ -47,9 +48,9 @@ set(client_SRCS
)
IF(UNIX)
add_executable(vcmi_client ${client_SRCS})
add_executable(vcmiclient ${client_SRCS})
ELSEIF(WIN32)
add_executable(vcmi_client WIN32 ${client_SRCS})
add_executable(vcmiclient WIN32 ${client_SRCS})
ENDIF()
target_link_libraries(vcmi_client vcmi_lib ${Boost_LIBRARIES} ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${SDLMIXER_LIBRARY} ${SDLTTF_LIBRARY} ${ZLIB_LIBRARIES} ${FFMPEG_LIBRARIES})
target_link_libraries(vcmiclient vcmi ${Boost_LIBRARIES} ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${SDLMIXER_LIBRARY} ${SDLTTF_LIBRARY} ${ZLIB_LIBRARIES} ${FFMPEG_LIBRARIES})

View File

@ -1,4 +1,4 @@
project(vcmi_lib)
project(libvcmi)
cmake_minimum_required(VERSION 2.6)
include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIRECTORY})
@ -38,5 +38,5 @@ set(lib_SRCS
VCMI_Lib.cpp
)
add_library(vcmi_lib SHARED ${lib_SRCS})
target_link_libraries(vcmi_lib ${Boost_LIBRARIES} ${SDL_LIBRARY} ${ZLIB_LIBRARIES})
add_library(vcmi SHARED ${lib_SRCS})
target_link_libraries(vcmi ${Boost_LIBRARIES} ${SDL_LIBRARY} ${ZLIB_LIBRARIES})

View File

@ -1,4 +1,4 @@
project(vcmi_server)
project(vcmiserver)
cmake_minimum_required(VERSION 2.6)
include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/lib)
@ -11,9 +11,9 @@ set(server_SRCS
)
IF(UNIX)
add_executable(vcmi_server ${server_SRCS})
add_executable(vcmiserver ${server_SRCS})
ELSEIF(WIN32)
add_executable(vcmi_server WIN32 ${server_SRCS})
add_executable(vcmiserver WIN32 ${server_SRCS})
ENDIF()
target_link_libraries(vcmi_server vcmi_lib ${Boost_LIBRARIES})
target_link_libraries(vcmiserver vcmi ${Boost_LIBRARIES})