fallout2-ce/CMakeLists.txt

402 lines
9.9 KiB
CMake
Raw Normal View History

2022-05-19 08:51:26 +00:00
cmake_minimum_required(VERSION 3.13)
2022-05-19 09:41:33 +00:00
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
2022-05-28 06:28:11 +00:00
set(EXECUTABLE_NAME fallout2-ce)
2022-05-19 08:51:26 +00:00
if(APPLE)
2022-10-14 08:40:11 +00:00
if(IOS)
set(CMAKE_OSX_DEPLOYMENT_TARGET "11" CACHE STRING "")
set(CMAKE_OSX_ARCHITECTURES "arm64" CACHE STRING "")
else()
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "")
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "")
endif()
2022-07-24 12:52:29 +00:00
endif()
2022-05-28 06:28:11 +00:00
project(${EXECUTABLE_NAME})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)
if(ANDROID)
2022-07-26 01:30:17 +00:00
add_library(${EXECUTABLE_NAME} SHARED)
else()
add_executable(${EXECUTABLE_NAME} WIN32 MACOSX_BUNDLE)
endif()
target_sources(${EXECUTABLE_NAME} PUBLIC
2022-05-21 15:22:03 +00:00
"src/actions.cc"
2022-05-19 08:51:26 +00:00
"src/actions.h"
2022-05-21 15:22:03 +00:00
"src/animation.cc"
2022-05-19 08:51:26 +00:00
"src/animation.h"
2022-05-21 15:22:03 +00:00
"src/art.cc"
2022-05-19 08:51:26 +00:00
"src/art.h"
2022-05-21 15:22:03 +00:00
"src/audio_file.cc"
2022-05-19 08:51:26 +00:00
"src/audio_file.h"
2022-05-21 15:22:03 +00:00
"src/audio.cc"
2022-05-19 08:51:26 +00:00
"src/audio.h"
2022-05-21 15:22:03 +00:00
"src/automap.cc"
2022-05-19 08:51:26 +00:00
"src/automap.h"
2022-05-21 15:22:03 +00:00
"src/autorun.cc"
2022-05-19 08:51:26 +00:00
"src/autorun.h"
2022-05-21 15:22:03 +00:00
"src/cache.cc"
2022-05-19 08:51:26 +00:00
"src/cache.h"
2022-05-21 15:22:03 +00:00
"src/character_editor.cc"
2022-05-19 08:51:26 +00:00
"src/character_editor.h"
2022-05-21 15:22:03 +00:00
"src/character_selector.cc"
2022-05-19 08:51:26 +00:00
"src/character_selector.h"
2022-05-21 15:22:03 +00:00
"src/color.cc"
2022-05-19 08:51:26 +00:00
"src/color.h"
"src/combat_ai_defs.h"
2022-05-21 15:22:03 +00:00
"src/combat_ai.cc"
2022-05-19 08:51:26 +00:00
"src/combat_ai.h"
"src/combat_defs.h"
2022-05-21 15:22:03 +00:00
"src/combat.cc"
2022-05-19 08:51:26 +00:00
"src/combat.h"
2022-05-21 15:22:03 +00:00
"src/config.cc"
2022-05-19 08:51:26 +00:00
"src/config.h"
2022-05-21 15:22:03 +00:00
"src/credits.cc"
2022-05-19 08:51:26 +00:00
"src/credits.h"
2022-05-21 15:22:03 +00:00
"src/critter.cc"
2022-05-19 08:51:26 +00:00
"src/critter.h"
2022-05-21 15:22:03 +00:00
"src/cycle.cc"
2022-05-19 08:51:26 +00:00
"src/cycle.h"
2022-05-21 15:22:03 +00:00
"src/datafile.cc"
2022-05-19 08:51:26 +00:00
"src/datafile.h"
2022-05-21 15:22:03 +00:00
"src/db.cc"
2022-05-19 08:51:26 +00:00
"src/db.h"
2022-05-21 15:22:03 +00:00
"src/dbox.cc"
2022-05-19 08:51:26 +00:00
"src/dbox.h"
2022-05-21 15:22:03 +00:00
"src/debug.cc"
2022-05-19 08:51:26 +00:00
"src/debug.h"
2022-05-21 15:22:03 +00:00
"src/dfile.cc"
2022-05-19 08:51:26 +00:00
"src/dfile.h"
2022-05-21 15:22:03 +00:00
"src/dialog.cc"
2022-05-19 08:51:26 +00:00
"src/dialog.h"
2022-05-21 15:22:03 +00:00
"src/dictionary.cc"
2022-05-19 08:51:26 +00:00
"src/dictionary.h"
2022-05-21 15:22:03 +00:00
"src/dinput.cc"
2022-05-19 08:51:26 +00:00
"src/dinput.h"
2022-05-21 15:22:03 +00:00
"src/display_monitor.cc"
2022-05-19 08:51:26 +00:00
"src/display_monitor.h"
2022-05-21 15:22:03 +00:00
"src/draw.cc"
2022-05-19 08:51:26 +00:00
"src/draw.h"
2022-05-21 15:22:03 +00:00
"src/elevator.cc"
2022-05-19 08:51:26 +00:00
"src/elevator.h"
2022-05-21 15:22:03 +00:00
"src/endgame.cc"
2022-05-19 08:51:26 +00:00
"src/endgame.h"
2022-05-21 15:22:03 +00:00
"src/export.cc"
2022-05-19 08:51:26 +00:00
"src/export.h"
2022-05-21 15:22:03 +00:00
"src/file_find.cc"
2022-05-19 08:51:26 +00:00
"src/file_find.h"
2022-05-21 15:22:03 +00:00
"src/file_utils.cc"
2022-05-19 08:51:26 +00:00
"src/file_utils.h"
2022-05-21 15:22:03 +00:00
"src/font_manager.cc"
2022-05-19 08:51:26 +00:00
"src/font_manager.h"
2022-05-21 15:22:03 +00:00
"src/game_config.cc"
2022-05-19 08:51:26 +00:00
"src/game_config.h"
2022-05-21 15:22:03 +00:00
"src/game_dialog.cc"
2022-05-19 08:51:26 +00:00
"src/game_dialog.h"
2022-05-21 15:22:03 +00:00
"src/game_memory.cc"
2022-05-19 08:51:26 +00:00
"src/game_memory.h"
2022-05-21 15:22:03 +00:00
"src/game_mouse.cc"
2022-05-19 08:51:26 +00:00
"src/game_mouse.h"
2022-05-21 15:22:03 +00:00
"src/game_movie.cc"
2022-05-19 08:51:26 +00:00
"src/game_movie.h"
2022-05-21 15:22:03 +00:00
"src/game_sound.cc"
2022-05-19 08:51:26 +00:00
"src/game_sound.h"
"src/game_vars.h"
2022-05-21 15:22:03 +00:00
"src/game.cc"
2022-05-19 08:51:26 +00:00
"src/game.h"
2022-05-21 15:22:03 +00:00
"src/geometry.cc"
2022-05-19 08:51:26 +00:00
"src/geometry.h"
2022-05-21 15:22:03 +00:00
"src/graph_lib.cc"
2022-05-19 08:51:26 +00:00
"src/graph_lib.h"
2022-05-21 15:22:03 +00:00
"src/heap.cc"
2022-05-19 08:51:26 +00:00
"src/heap.h"
2022-10-05 06:23:27 +00:00
"src/input.cc"
"src/input.h"
2022-05-21 15:22:03 +00:00
"src/interface.cc"
2022-05-19 08:51:26 +00:00
"src/interface.h"
2022-05-21 15:22:03 +00:00
"src/interpreter_extra.cc"
2022-05-19 08:51:26 +00:00
"src/interpreter_extra.h"
2022-05-21 15:22:03 +00:00
"src/interpreter_lib.cc"
2022-05-19 08:51:26 +00:00
"src/interpreter_lib.h"
2022-05-21 15:22:03 +00:00
"src/interpreter.cc"
2022-05-19 08:51:26 +00:00
"src/interpreter.h"
2022-05-21 15:22:03 +00:00
"src/inventory.cc"
2022-05-19 08:51:26 +00:00
"src/inventory.h"
2022-05-21 15:22:03 +00:00
"src/item.cc"
2022-05-19 08:51:26 +00:00
"src/item.h"
2022-10-03 13:42:34 +00:00
"src/kb.cc"
"src/kb.h"
2022-05-21 15:22:03 +00:00
"src/light.cc"
2022-05-19 08:51:26 +00:00
"src/light.h"
2022-05-21 15:22:03 +00:00
"src/lips.cc"
2022-05-19 08:51:26 +00:00
"src/lips.h"
2022-05-21 15:22:03 +00:00
"src/loadsave.cc"
2022-05-19 08:51:26 +00:00
"src/loadsave.h"
2022-05-21 15:22:03 +00:00
"src/main.cc"
2022-05-19 08:51:26 +00:00
"src/main.h"
2023-02-17 12:55:14 +00:00
"src/mainmenu.cc"
"src/mainmenu.h"
2022-05-19 08:51:26 +00:00
"src/map_defs.h"
2022-05-21 15:22:03 +00:00
"src/map.cc"
2022-05-19 08:51:26 +00:00
"src/map.h"
"src/memory_defs.h"
2022-05-21 15:22:03 +00:00
"src/memory_manager.cc"
2022-05-19 08:51:26 +00:00
"src/memory_manager.h"
2022-05-21 15:22:03 +00:00
"src/memory.cc"
2022-05-19 08:51:26 +00:00
"src/memory.h"
2022-05-21 15:22:03 +00:00
"src/message.cc"
2022-05-19 08:51:26 +00:00
"src/message.h"
2022-05-21 15:22:03 +00:00
"src/mouse_manager.cc"
2022-05-19 08:51:26 +00:00
"src/mouse_manager.h"
2022-10-03 09:41:33 +00:00
"src/mouse.cc"
"src/mouse.h"
2022-05-21 15:22:03 +00:00
"src/movie_effect.cc"
2022-05-19 08:51:26 +00:00
"src/movie_effect.h"
2022-05-21 15:22:03 +00:00
"src/movie_lib.cc"
2022-05-19 08:51:26 +00:00
"src/movie_lib.h"
2022-05-21 15:22:03 +00:00
"src/movie.cc"
2022-05-19 08:51:26 +00:00
"src/movie.h"
2022-05-21 15:22:03 +00:00
"src/nevs.cc"
2022-05-19 08:51:26 +00:00
"src/nevs.h"
"src/obj_types.h"
2022-05-21 15:22:03 +00:00
"src/object.cc"
2022-05-19 08:51:26 +00:00
"src/object.h"
2022-05-21 15:22:03 +00:00
"src/options.cc"
2022-05-19 08:51:26 +00:00
"src/options.h"
2022-05-21 15:22:03 +00:00
"src/palette.cc"
2022-05-19 08:51:26 +00:00
"src/palette.h"
2022-05-21 15:22:03 +00:00
"src/party_member.cc"
2022-05-19 08:51:26 +00:00
"src/party_member.h"
"src/pcx.cc"
"src/pcx.h"
2022-05-19 08:51:26 +00:00
"src/perk_defs.h"
2022-05-21 15:22:03 +00:00
"src/perk.cc"
2022-05-19 08:51:26 +00:00
"src/perk.h"
2022-05-21 15:22:03 +00:00
"src/pipboy.cc"
2022-05-19 08:51:26 +00:00
"src/pipboy.h"
2022-05-21 15:22:03 +00:00
"src/proto_instance.cc"
2022-05-19 08:51:26 +00:00
"src/proto_instance.h"
"src/proto_types.h"
2022-05-21 15:22:03 +00:00
"src/proto.cc"
2022-05-19 08:51:26 +00:00
"src/proto.h"
2022-05-21 15:22:03 +00:00
"src/queue.cc"
2022-05-19 08:51:26 +00:00
"src/queue.h"
2022-05-21 15:22:03 +00:00
"src/random.cc"
2022-05-19 08:51:26 +00:00
"src/random.h"
2022-05-21 15:22:03 +00:00
"src/reaction.cc"
2022-05-19 08:51:26 +00:00
"src/reaction.h"
2022-05-21 15:22:03 +00:00
"src/region.cc"
2022-05-19 08:51:26 +00:00
"src/region.h"
2022-05-21 15:22:03 +00:00
"src/scripts.cc"
2022-05-19 08:51:26 +00:00
"src/scripts.h"
2022-05-21 15:22:03 +00:00
"src/select_file_list.cc"
2022-05-19 08:51:26 +00:00
"src/select_file_list.h"
2022-05-21 15:22:03 +00:00
"src/selfrun.cc"
2022-05-19 08:51:26 +00:00
"src/selfrun.h"
"src/skill_defs.h"
2022-05-21 15:22:03 +00:00
"src/skill.cc"
2022-05-19 08:51:26 +00:00
"src/skill.h"
2022-05-21 15:22:03 +00:00
"src/skilldex.cc"
2022-05-19 08:51:26 +00:00
"src/skilldex.h"
2022-05-21 15:22:03 +00:00
"src/sound_decoder.cc"
2022-05-19 08:51:26 +00:00
"src/sound_decoder.h"
2022-05-21 15:22:03 +00:00
"src/sound_effects_cache.cc"
2022-05-19 08:51:26 +00:00
"src/sound_effects_cache.h"
2022-05-21 15:22:03 +00:00
"src/sound_effects_list.cc"
2022-05-19 08:51:26 +00:00
"src/sound_effects_list.h"
2022-05-21 15:22:03 +00:00
"src/sound.cc"
2022-05-19 08:51:26 +00:00
"src/sound.h"
"src/stat_defs.h"
2022-05-21 15:22:03 +00:00
"src/stat.cc"
2022-05-19 08:51:26 +00:00
"src/stat.h"
2022-05-21 15:22:03 +00:00
"src/string_parsers.cc"
2022-05-19 08:51:26 +00:00
"src/string_parsers.h"
2022-10-05 07:35:05 +00:00
"src/svga.cc"
"src/svga.h"
2022-05-21 15:22:03 +00:00
"src/text_font.cc"
2022-05-19 08:51:26 +00:00
"src/text_font.h"
2022-05-21 15:22:03 +00:00
"src/text_object.cc"
2022-05-19 08:51:26 +00:00
"src/text_object.h"
2022-05-21 15:22:03 +00:00
"src/tile.cc"
2022-05-19 08:51:26 +00:00
"src/tile.h"
"src/trait_defs.h"
2022-05-21 15:22:03 +00:00
"src/trait.cc"
2022-05-19 08:51:26 +00:00
"src/trait.h"
2022-10-03 06:37:05 +00:00
"src/vcr.cc"
"src/vcr.h"
2022-05-21 15:22:03 +00:00
"src/version.cc"
2022-05-19 08:51:26 +00:00
"src/version.h"
2022-05-21 15:22:03 +00:00
"src/widget.cc"
2022-05-19 08:51:26 +00:00
"src/widget.h"
2022-05-21 15:22:03 +00:00
"src/win32.cc"
2022-05-19 08:51:26 +00:00
"src/win32.h"
2022-05-21 15:22:03 +00:00
"src/window_manager_private.cc"
2022-05-19 08:51:26 +00:00
"src/window_manager_private.h"
2022-05-21 15:22:03 +00:00
"src/window_manager.cc"
2022-05-19 08:51:26 +00:00
"src/window_manager.h"
2022-05-21 15:22:03 +00:00
"src/window.cc"
2022-05-19 08:51:26 +00:00
"src/window.h"
2022-05-21 15:22:03 +00:00
"src/word_wrap.cc"
2022-05-19 08:51:26 +00:00
"src/word_wrap.h"
2022-09-15 06:00:11 +00:00
"src/worldmap.cc"
"src/worldmap.h"
2022-05-21 15:22:03 +00:00
"src/xfile.cc"
2022-05-19 08:51:26 +00:00
"src/xfile.h"
)
2022-05-28 06:28:11 +00:00
target_sources(${EXECUTABLE_NAME} PUBLIC
2022-07-12 09:09:53 +00:00
"src/audio_engine.cc"
"src/audio_engine.h"
2022-05-23 08:13:28 +00:00
"src/fps_limiter.cc"
"src/fps_limiter.h"
"src/platform_compat.cc"
"src/platform_compat.h"
2022-07-05 08:00:55 +00:00
"src/pointer_registry.cc"
"src/pointer_registry.h"
2023-02-17 09:33:26 +00:00
"src/preferences.cc"
"src/preferences.h"
"src/settings.cc"
"src/settings.h"
2022-05-25 21:16:20 +00:00
"src/sfall_config.cc"
"src/sfall_config.h"
"src/sfall_global_vars.cc"
"src/sfall_global_vars.h"
2023-05-31 18:48:44 +00:00
"src/sfall_global_scripts.cc"
"src/sfall_global_scripts.h"
2023-05-30 09:52:55 +00:00
"src/sfall_ini.cc"
"src/sfall_ini.h"
2023-06-01 16:01:03 +00:00
"src/sfall_kb_helpers.cc"
"src/sfall_kb_helpers.h"
2022-11-08 19:55:25 +00:00
"src/sfall_lists.cc"
"src/sfall_lists.h"
2022-11-07 17:03:04 +00:00
"src/sfall_opcodes.cc"
"src/sfall_opcodes.h"
"src/sfall_arrays.cc"
"src/sfall_arrays.h"
2023-05-09 15:36:20 +00:00
"src/touch.cc"
"src/touch.h"
2022-05-23 08:13:28 +00:00
)
2022-10-14 08:40:11 +00:00
if(IOS)
target_sources(${EXECUTABLE_NAME} PUBLIC
"src/platform/ios/paths.h"
"src/platform/ios/paths.mm"
)
endif()
2022-05-29 15:05:31 +00:00
if(WIN32)
target_compile_definitions(${EXECUTABLE_NAME} PUBLIC
_CRT_SECURE_NO_WARNINGS
_CRT_NONSTDC_NO_WARNINGS
2023-02-18 16:06:20 +00:00
NOMINMAX
WIN32_LEAN_AND_MEAN
2022-06-12 08:44:22 +00:00
)
2022-05-29 15:05:31 +00:00
endif()
2022-05-19 08:51:26 +00:00
2022-05-29 15:05:31 +00:00
if(WIN32)
target_link_libraries(${EXECUTABLE_NAME}
winmm
)
endif()
2022-05-19 08:51:26 +00:00
if(WIN32)
2022-09-22 07:13:28 +00:00
target_sources(${EXECUTABLE_NAME} PUBLIC
"os/windows/fallout2-ce.ico"
"os/windows/fallout2-ce.rc"
)
endif()
2022-07-05 12:45:36 +00:00
if(APPLE)
2022-10-14 08:40:11 +00:00
if(IOS)
2023-04-26 12:11:24 +00:00
set(RESOURCES
"os/ios/AppIcon.xcassets"
"os/ios/LaunchScreen.storyboard"
)
target_sources(${EXECUTABLE_NAME} PUBLIC ${RESOURCES})
set_source_files_properties(${RESOURCES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
set_target_properties(${EXECUTABLE_NAME} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/os/ios/Info.plist"
XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.alexbatalov.fallout2-ce"
XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2"
)
2023-05-01 04:10:04 +00:00
set(MACOSX_BUNDLE_BUNDLE_NAME "${EXECUTABLE_NAME}")
set(MACOSX_BUNDLE_DISPLAY_NAME "Fallout 2")
2022-10-14 08:40:11 +00:00
else()
2023-05-01 04:10:04 +00:00
set(RESOURCES
"os/macos/fallout2-ce.icns"
)
target_sources(${EXECUTABLE_NAME} PUBLIC ${RESOURCES})
set_source_files_properties(${RESOURCES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
set_target_properties(${EXECUTABLE_NAME} PROPERTIES
OUTPUT_NAME "Fallout II Community Edition"
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/os/macos/Info.plist"
XCODE_ATTRIBUTE_EXECUTABLE_NAME "${EXECUTABLE_NAME}"
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "com.alexbatalov.fallout2-ce"
)
2023-04-26 12:11:24 +00:00
set(MACOSX_BUNDLE_ICON_FILE "fallout2-ce.icns")
2023-05-01 04:10:04 +00:00
set(MACOSX_BUNDLE_BUNDLE_NAME "Fallout II: Community Edition")
set(MACOSX_BUNDLE_DISPLAY_NAME "Fallout II")
2022-10-14 08:40:11 +00:00
endif()
2022-07-05 12:45:36 +00:00
set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.alexbatalov.fallout2-ce")
2023-01-20 07:02:02 +00:00
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "1.2.0")
set(MACOSX_BUNDLE_BUNDLE_VERSION "1.2.0")
2022-07-05 12:45:36 +00:00
endif()
2022-05-19 08:51:26 +00:00
add_subdirectory("third_party/fpattern")
2022-05-28 06:28:11 +00:00
target_link_libraries(${EXECUTABLE_NAME} ${FPATTERN_LIBRARY})
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${FPATTERN_INCLUDE_DIR})
2022-05-28 04:59:41 +00:00
2022-07-24 12:52:29 +00:00
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
2022-05-29 15:05:31 +00:00
add_subdirectory("third_party/zlib")
add_subdirectory("third_party/sdl2")
else()
find_package(ZLIB)
find_package(SDL2)
endif()
2022-05-28 06:28:11 +00:00
target_link_libraries(${EXECUTABLE_NAME} ${ZLIB_LIBRARIES})
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${ZLIB_INCLUDE_DIRS})
2022-05-28 05:17:23 +00:00
2022-05-28 06:28:11 +00:00
target_link_libraries(${EXECUTABLE_NAME} ${SDL2_LIBRARIES})
target_include_directories(${EXECUTABLE_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})
2022-07-05 12:45:36 +00:00
if(APPLE)
2022-10-14 08:40:11 +00:00
if(IOS)
install(TARGETS ${EXECUTABLE_NAME} DESTINATION "Payload")
2022-07-05 12:45:36 +00:00
2022-10-14 08:40:11 +00:00
set(CPACK_GENERATOR "ZIP")
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
set(CPACK_PACKAGE_FILE_NAME "fallout2-ce")
2023-04-26 10:48:01 +00:00
set(CPACK_ARCHIVE_FILE_EXTENSION "ipa")
2022-10-14 08:40:11 +00:00
else()
install(TARGETS ${EXECUTABLE_NAME} DESTINATION .)
2022-07-12 18:18:19 +00:00
if(CPACK_BUNDLE_APPLE_CERT_APP)
2022-10-14 08:40:11 +00:00
install(CODE "
2023-05-01 04:10:04 +00:00
execute_process(COMMAND codesign --deep --force --options runtime --sign \"${CPACK_BUNDLE_APPLE_CERT_APP}\" ${CMAKE_BINARY_DIR}/Fallout II Community Edition.app)
2022-10-14 08:40:11 +00:00
"
COMPONENT Runtime)
endif()
set(CPACK_GENERATOR "DragNDrop")
set(CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK ON)
2023-05-01 04:10:04 +00:00
set(CPACK_PACKAGE_FILE_NAME "Fallout II Community Edition")
2022-10-14 08:40:11 +00:00
endif()
2022-07-05 12:45:36 +00:00
include(CPack)
endif()