diff --git a/AI/CMakeLists.txt b/AI/CMakeLists.txt new file mode 100644 index 000000000..a53f4ce98 --- /dev/null +++ b/AI/CMakeLists.txt @@ -0,0 +1,7 @@ +project(AI) +cmake_minimum_required(VERSION 2.6) + +add_subdirectory(FuzzyLite) +add_subdirectory(StupidAI) +add_subdirectory(EmptyAI) +add_subdirectory(VCAI) diff --git a/AI/EmptyAI/CMakeLists.txt b/AI/EmptyAI/CMakeLists.txt new file mode 100644 index 000000000..45369c2c9 --- /dev/null +++ b/AI/EmptyAI/CMakeLists.txt @@ -0,0 +1,12 @@ +project(emptyAI) +cmake_minimum_required(VERSION 2.6) + +include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/lib) + +set(emptyAI_SRCS + CEmptyAI.cpp + exp_funcs.cpp +) + +add_library(emptyAI SHARED ${emptyAI_SRCS}) +target_link_libraries(emptyAI vcmi_lib) diff --git a/AI/FuzzyLite/CMakeLists.txt b/AI/FuzzyLite/CMakeLists.txt new file mode 100644 index 000000000..9c2fd1afa --- /dev/null +++ b/AI/FuzzyLite/CMakeLists.txt @@ -0,0 +1,51 @@ +project(FuzzyLite_lib) +cmake_minimum_required(VERSION 2.6) + +include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR}) + +set(FuzzyLite_lib_SRCS + AreaCentroidAlgorithm.cpp + FuzzyOperation.cpp + OutputLVar.cpp + CompoundTerm.cpp + FuzzyOperator.cpp + RectangularTerm.cpp + DescriptiveAntecedent.cpp + FuzzyOr.cpp + RuleBlock.cpp + DiscreteTerm.cpp + FuzzyRule.cpp + ShoulderTerm.cpp + FunctionTerm.cpp + Hedge.cpp + SingletonTerm.cpp + FuzzyAnd.cpp + HedgeSet.cpp + StrOp.cpp + FuzzyAntecedent.cpp + InfixToPostfix.cpp + TakagiSugenoConsequent.cpp + FuzzyConsequent.cpp + InputLVar.cpp + TakagiSugenoRule.cpp + FuzzyDefuzzifier.cpp + LinguisticTerm.cpp + TakagiSugenoTerm.cpp + FuzzyEngine.cpp + LinguisticVariable.cpp + test.cpp + FuzzyException.cpp + main.cpp + TrapezoidalTerm.cpp + FuzzyExceptions.cpp + MamdaniConsequent.cpp + TriangularTerm.cpp + FuzzyModulation.cpp + MamdaniRule.cpp +) + +add_library(FuzzyLite_lib STATIC ${FuzzyLite_lib_SRCS}) + +IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + SET_TARGET_PROPERTIES(FuzzyLite_lib PROPERTIES COMPILE_FLAGS "-fPIC") +ENDIF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") \ No newline at end of file diff --git a/AI/StupidAI/CMakeLists.txt b/AI/StupidAI/CMakeLists.txt new file mode 100644 index 000000000..d8d323687 --- /dev/null +++ b/AI/StupidAI/CMakeLists.txt @@ -0,0 +1,12 @@ +project(stupidAI) +cmake_minimum_required(VERSION 2.6) + +include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/lib) + +set(stupidAI_SRCS + StupidAI.cpp + main.cpp +) + +add_library(stupidAI SHARED ${stupidAI_SRCS}) +target_link_libraries(stupidAI vcmi_lib) diff --git a/AI/VCAI/CMakeLists.txt b/AI/VCAI/CMakeLists.txt new file mode 100644 index 000000000..d937d488f --- /dev/null +++ b/AI/VCAI/CMakeLists.txt @@ -0,0 +1,13 @@ +project(VCAI) +cmake_minimum_required(VERSION 2.6) + +include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/lib ${CMAKE_HOME_DIRECTORY}/AI/FuzzyLite) + +set(VCAI_SRCS + main.cpp + VCAI.cpp + Fuzzy.cpp +) + +add_library(VCAI SHARED ${VCAI_SRCS}) +target_link_libraries(VCAI FuzzyLite_lib vcmi_lib) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..8eff2644a --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,25 @@ +project(vcmi) +cmake_minimum_required(VERSION 2.6) + +# where to look for cmake modules +set(CMAKE_MODULE_PATH ${CMAKE_HOME_DIRECTORY}/cmake_modules) + +set(CMAKE_BUILD_TYPE Debug) + +find_package(Boost COMPONENTS program_options filesystem system thread iostreams REQUIRED) +find_package(SDL REQUIRED) +find_package(SDL_image REQUIRED) +find_package(SDL_mixer REQUIRED) +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") +endif() + +add_subdirectory(lib) +add_subdirectory(client) +add_subdirectory(server) +add_subdirectory(AI) +add_subdirectory(Scripting/ERM) \ No newline at end of file diff --git a/Scripting/ERM/CMakeLists.txt b/Scripting/ERM/CMakeLists.txt new file mode 100644 index 000000000..30bfcac2d --- /dev/null +++ b/Scripting/ERM/CMakeLists.txt @@ -0,0 +1,13 @@ +project(vcmi_ERM) +cmake_minimum_required(VERSION 2.6) + +include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIRECTORY}) + +set(lib_SRCS + ERMInterpreter.cpp + ERMParser.cpp + ERMScriptModule.cpp +) + +add_library(vcmi_ERM_lib SHARED ${lib_SRCS}) +target_link_libraries(vcmi_ERM_lib ${Boost_LIBRARIES}) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt new file mode 100644 index 000000000..edc24b3e8 --- /dev/null +++ b/client/CMakeLists.txt @@ -0,0 +1,55 @@ +project(vcmi_client) +cmake_minimum_required(VERSION 2.6) + +include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/lib) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/BattleInterface ${CMAKE_CURRENT_SOURCE_DIR}/UIFramework) +include_directories(${SDL_INCLUDE_DIR} ${SDLIMAGE_INCLUDE_DIR} ${SDLMIXER_INCLUDE_DIR} ${SDLTTF_INCLUDE_DIR}) +include_directories(${Boost_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR} ${FFMPEG_INCLUDE_DIR}) + + +set(client_SRCS + ../CCallback.cpp + BattleInterface/CBattleAnimations.cpp + BattleInterface/CBattleInterface.cpp + BattleInterface/CBattleInterfaceClasses.cpp + BattleInterface/CCreatureAnimation.cpp + UIFramework/CGuiHandler.cpp + UIFramework/CIntObject.cpp + UIFramework/CIntObjectClasses.cpp + UIFramework/Geometries.cpp + UIFramework/CCursorHandler.cpp + UIFramework/SDL_Extensions.cpp + AdventureMapClasses.cpp + CAdvmapInterface.cpp + CAnimation.cpp + CBitmapHandler.cpp + CCastleInterface.cpp + CConfigHandler.cpp + CCreatureWindow.cpp + CDefHandler.cpp + CGameInfo.cpp + CHeroWindow.cpp + CKingdomInterface.cpp + Client.cpp + CMessage.cpp + CMT.cpp + CMusicHandler.cpp + CPlayerInterface.cpp + CPreGame.cpp + CSndHandler.cpp + CSpellWindow.cpp + CVideoHandler.cpp + Graphics.cpp + GUIClasses.cpp + mapHandler.cpp + NetPacksClient.cpp + SDL_framerate.cpp +) + +IF(UNIX) + add_executable(vcmi_client ${client_SRCS}) +ELSEIF(WIN32) + add_executable(vcmi_client 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}) diff --git a/cmake_modules/FindFFMPEG_swscale.cmake b/cmake_modules/FindFFMPEG_swscale.cmake new file mode 100644 index 000000000..0f8cb2839 --- /dev/null +++ b/cmake_modules/FindFFMPEG_swscale.cmake @@ -0,0 +1,73 @@ +# Find the FFmpeg library +# +# Sets +# FFMPEG_INCLUDE_DIR +# FFMPEG_LIBRARIES + +FIND_PATH( FFMPEG_INCLUDE_DIR NAMES ffmpeg/avcodec.h libavcodec/avcodec.h + /usr/include + /usr/local/include +) + +IF( FFMPEG_INCLUDE_DIR ) + +FIND_PROGRAM( FFMPEG_CONFIG ffmpeg-config + /usr/bin + /usr/local/bin + ${HOME}/bin +) + +IF( FFMPEG_CONFIG ) + EXEC_PROGRAM( ${FFMPEG_CONFIG} ARGS "--libs avformat" OUTPUT_VARIABLE FFMPEG_LIBS ) + SET( FFMPEG_LIBRARIES "${FFMPEG_LIBS}" ) + +ELSE( FFMPEG_CONFIG ) + + FIND_LIBRARY( FFMPEG_avcodec_LIBRARY avcodec + /usr/lib + /usr/local/lib + /usr/lib64 + /usr/local/lib64 + ) + + FIND_LIBRARY( FFMPEG_avformat_LIBRARY avformat + /usr/lib + /usr/local/lib + /usr/lib64 + /usr/local/lib64 + ) + + FIND_LIBRARY( FFMPEG_avutil_LIBRARY avutil + /usr/lib + /usr/local/lib + /usr/lib64 + /usr/local/lib64 + ) + + FIND_LIBRARY( FFMPEG_swscale_LIBRARY swscale + /usr/lib + /usr/local/lib + /usr/lib64 + /usr/local/lib64 + ) + + IF( FFMPEG_avcodec_LIBRARY ) + IF( FFMPEG_avformat_LIBRARY ) + + SET( FFMPEG_LIBRARIES ${FFMPEG_avformat_LIBRARY} ${FFMPEG_avcodec_LIBRARY} ) + IF( FFMPEG_avutil_LIBRARY ) + SET( FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${FFMPEG_avutil_LIBRARY} ) + ENDIF( FFMPEG_avutil_LIBRARY ) + IF( FFMPEG_swscale_LIBRARY ) + SET( FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${FFMPEG_swscale_LIBRARY} ) + ENDIF( FFMPEG_swscale_LIBRARY ) + + ENDIF( FFMPEG_avformat_LIBRARY ) + ENDIF( FFMPEG_avcodec_LIBRARY ) + +ENDIF( FFMPEG_CONFIG ) + +ENDIF( FFMPEG_INCLUDE_DIR ) + +INCLUDE (FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFMPEG DEFAULT_MESSAGE FFMPEG_INCLUDE_DIR FFMPEG_LIBRARIES) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt new file mode 100644 index 000000000..75665a216 --- /dev/null +++ b/lib/CMakeLists.txt @@ -0,0 +1,42 @@ +project(vcmi_lib) +cmake_minimum_required(VERSION 2.6) + +include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIRECTORY}) +include_directories(${SDL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}) + +set(lib_SRCS + BattleAction.cpp + BattleHex.cpp + BattleState.cpp + CArtHandler.cpp + CBuildingHandler.cpp + CCampaignHandler.cpp + CConsoleHandler.cpp + CCreatureHandler.cpp + CCreatureSet.cpp + CDefObjInfoHandler.cpp + CFileUtility.cpp + CGameInterface.cpp + CGameState.cpp + CGeneralTextHandler.cpp + CHeroHandler.cpp + CLodHandler.cpp + CLogger.cpp + CMapInfo.cpp + CObjectHandler.cpp + CObstacleInstance.cpp + Connection.cpp + CSpellHandler.cpp + CThreadHelper.cpp + CTownHandler.cpp + HeroBonus.cpp + IGameCallback.cpp + JsonNode.cpp + map.cpp + NetPacksLib.cpp + ResourceSet.cpp + VCMI_Lib.cpp +) + +add_library(vcmi_lib SHARED ${lib_SRCS}) +target_link_libraries(vcmi_lib ${Boost_LIBRARIES} ${SDL_LIBRARY} ${ZLIB_LIBRARIES}) diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt new file mode 100644 index 000000000..972d152ec --- /dev/null +++ b/server/CMakeLists.txt @@ -0,0 +1,19 @@ +project(vcmi_server) +cmake_minimum_required(VERSION 2.6) + +include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/lib) +include_directories(${Boost_INCLUDE_DIRS}) + +set(server_SRCS + CGameHandler.cpp + CVCMIServer.cpp + NetPacksServer.cpp +) + +IF(UNIX) + add_executable(vcmi_server ${server_SRCS}) +ELSEIF(WIN32) + add_executable(vcmi_server WIN32 ${server_SRCS}) +ENDIF() + +target_link_libraries(vcmi_server vcmi_lib ${Boost_LIBRARIES})