fallout2-ce/CMakeLists.txt

338 lines
8.0 KiB
CMake
Raw Normal View History

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