Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 7b038e9129
Fetching contributors…

Cannot retrieve contributors at this time

176 lines (154 sloc) 5.257 kb
Project (Flare)
cmake_minimum_required (VERSION 2.6)
Set (PACKAGE "FLARE")
Set (VERSION "0.15")
# Default definitions
if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4099 /wd4244")
else (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused -Wshadow -Woverloaded-virtual")
endif (MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -g0")
elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
elseif(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -g0")
elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -pg")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-pg")
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "-pg")
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "-pg")
endif()
set(BINDIR "games" CACHE STRING "Directory from CMAKE_INSTALL_PREFIX where game executable will be installed.")
set(DATADIR "share/games/flare" CACHE STRING "Directory from CMAKE_INSTALL_PREFIX where game data files will be installed.")
add_definitions(-DDATA_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${DATADIR}")
# Detect missing dependencies
Find_Package (SDL REQUIRED)
If (NOT SDL_FOUND)
Message (FATAL_ERROR "Couldn't find SDL development files. On Debian-based systems (such as Ubuntu) you should install the 'libsdl1.2-dev' package.")
Else (NOT SDL_FOUND)
Include_Directories (${SDL_INCLUDE_DIR})
EndIf (NOT SDL_FOUND)
Find_Package (SDL_mixer REQUIRED)
If (NOT SDLMIXER_FOUND)
Message (FATAL_ERROR "Couldn't find SDL-mixer development files. On Debian-based systems (such as Ubuntu) you should install the 'libsdl-mixer1.2-dev' package.")
Else (NOT SDLMIXER_FOUND)
Include_Directories (${SDLMIXER_INCLUDE_DIR})
EndIf (NOT SDLMIXER_FOUND)
Find_Package (SDL_image REQUIRED)
If (NOT SDLIMAGE_FOUND)
Message (FATAL_ERROR "Couldn't find SDL-image development files. On Debian-based systems (such as Ubuntu) you should install the 'libsdl-image1.2-dev' package.")
Else (NOT SDLIMAGE_FOUND)
Include_Directories (${SDLIMAGE_INCLUDE_DIR})
EndIf (NOT SDLIMAGE_FOUND)
Find_Package (SDL_ttf REQUIRED)
If (NOT SDLTTF_FOUND)
Message (FATAL_ERROR "Couldn't find SDL-ttf development files. On Debian-based systems (such as Ubuntu) you should install the 'libsdl-ttf2.0-dev' package.")
Else (NOT SDLTTF_FOUND)
Include_Directories (${SDLTTF_INCLUDE_DIR})
EndIf (NOT SDLTTF_FOUND)
# Sources
Set (FLARE_SOURCES
./src/Entity.cpp
./src/Animation.cpp
./src/AStarNode.cpp
./src/Avatar.cpp
./src/BehaviorStandard.cpp
./src/CampaignManager.cpp
./src/CombatText.cpp
./src/Enemy.cpp
./src/EnemyBehavior.cpp
./src/EnemyGroupManager.cpp
./src/EnemyManager.cpp
./src/FileParser.cpp
./src/FontEngine.cpp
./src/GameState.cpp
./src/GameStateConfig.cpp
./src/GameStateTitle.cpp
./src/GameStateLoad.cpp
./src/GameStatePlay.cpp
./src/GameStateNew.cpp
./src/GameSwitcher.cpp
./src/GetText.cpp
./src/Hazard.cpp
./src/HazardManager.cpp
./src/InputState.cpp
./src/ItemManager.cpp
./src/ItemStorage.cpp
./src/LootManager.cpp
./src/MapCollision.cpp
./src/MapIso.cpp
./src/Menu.cpp
./src/MenuActionBar.cpp
./src/MenuCharacter.cpp
./src/MenuConfirm.cpp
./src/MenuEnemy.cpp
./src/MenuExit.cpp
./src/MenuExperience.cpp
./src/MenuHPMP.cpp
./src/MenuHUDLog.cpp
./src/MenuInventory.cpp
./src/MenuItemStorage.cpp
./src/MenuLog.cpp
./src/MenuManager.cpp
./src/MenuMiniMap.cpp
./src/MenuPowers.cpp
./src/MenuTalker.cpp
./src/MenuVendor.cpp
./src/MessageEngine.cpp
./src/ModManager.cpp
./src/NPC.cpp
./src/NPCManager.cpp
./src/PowerManager.cpp
./src/QuestLog.cpp
./src/SaveLoad.cpp
./src/Settings.cpp
./src/SharedResources.cpp
./src/StatBlock.cpp
./src/TileSet.cpp
./src/Utils.cpp
./src/UtilsDebug.cpp
./src/UtilsFileSystem.cpp
./src/UtilsParsing.cpp
./src/WidgetCheckBox.cpp
./src/WidgetComboBox.cpp
./src/WidgetButton.cpp
./src/WidgetInput.cpp
./src/WidgetLabel.cpp
./src/WidgetListBox.cpp
./src/WidgetScrollBar.cpp
./src/WidgetSlider.cpp
./src/WidgetTabControl.cpp
./src/WidgetTooltip.cpp
./src/main.cpp
)
# Add icon and file info to executable for Windows systems
IF (WIN32)
SET(FLARE_SOURCES
${FLARE_SOURCES}
./src/Flare.rc
)
ENDIF (WIN32)
Add_Executable (flare ${FLARE_SOURCES})
# libSDLMain comes with libSDL if needed on certain platforms
If (NOT SDLMAIN_LIBRARY)
Set (SDLMAIN_LIBRARY "")
EndIf (NOT SDLMAIN_LIBRARY)
Target_Link_Libraries (flare ${SDL_LIBRARY} ${SDLMIXER_LIBRARY} ${SDLIMAGE_LIBRARY} ${SDLTTF_LIBRARY} ${SDLMAIN_LIBRARY})
set(FLARE_EXECUTABLE_PATH ${CMAKE_INSTALL_PREFIX}/${BINDIR}/flare)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/distribution/flare.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/flare.desktop")
# installing to the proper places
install(PROGRAMS
${CMAKE_CURRENT_BINARY_DIR}/flare
DESTINATION ${CMAKE_INSTALL_PREFIX}/${BINDIR})
install(DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/mods"
DESTINATION ${CMAKE_INSTALL_PREFIX}/${DATADIR})
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/flare.desktop"
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/art_src/logo/flare_logo.svg"
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps
RENAME flare.svg)
Jump to Line
Something went wrong with that request. Please try again.