# SPDX-License-Identifier: GPL-3.0-only add_library(bmh_obw STATIC obw.cpp classic.cpp assets.cpp save.cpp ../audio/container.cpp) target_include_directories(bmh_obw PUBLIC ..) target_link_libraries(bmh_obw PUBLIC bmhlaunch PRIVATE bmh_miniz) add_executable(openbmh_import main.cpp) target_link_libraries(openbmh_import PRIVATE bmh_content) set_target_properties(openbmh_import PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") add_executable(obw_import_tests ../../tests/obw_import_tests.cpp) target_link_libraries(obw_import_tests PRIVATE bmh_content bmh_miniz) if(MSVC) target_compile_options(bmh_obw PRIVATE /W4 /utf-8) target_compile_options(openbmh_import PRIVATE /W4 /utf-8) target_compile_options(obw_import_tests PRIVATE /W4 /utf-8) else() target_compile_options(bmh_obw PRIVATE -Wall -Wextra) endif() add_test(NAME obw_import_tests COMMAND obw_import_tests) add_executable(obw_classic_installation_tests ../../tests/obw_classic_installation_tests.cpp) target_link_libraries(obw_classic_installation_tests PRIVATE bmh_obw) if(MSVC) target_compile_options(obw_classic_installation_tests PRIVATE /W4 /utf-8) endif() bmh_add_data_test(NAME obw_classic_installation_tests COMMAND obw_classic_installation_tests "${BMH_DATA}") install(TARGETS openbmh_import RUNTIME DESTINATION . COMPONENT Runtime) add_library(bmh_content STATIC ../content/digest.cpp ../content/package.cpp ../content/save.cpp) target_include_directories(bmh_content PUBLIC ..) target_link_libraries(bmh_content PUBLIC bmh_obw PRIVATE bmh_miniz) add_library(bmh_launcher STATIC ../launch/mods.cpp ../launch/process.cpp ../launch/launcher.cpp) target_include_directories(bmh_launcher PUBLIC ..) target_link_libraries(bmh_launcher PUBLIC bmh_content) if(WIN32) target_sources(bmh_launcher PRIVATE ../launch/launcher_win32.cpp) target_link_libraries(bmh_launcher PRIVATE comctl32 ole32 shell32 uuid) elseif(APPLE) set_property(TARGET bmh_launcher PROPERTY OBJCXX_STANDARD 20) target_sources(bmh_launcher PRIVATE ../launch/launcher_cocoa.mm) set_source_files_properties(../launch/launcher_cocoa.mm PROPERTIES COMPILE_OPTIONS "-fobjc-arc") target_link_libraries(bmh_launcher PRIVATE "-framework AppKit") else() find_package(PkgConfig REQUIRED) pkg_check_modules(BMH_GTK REQUIRED IMPORTED_TARGET gtk+-3.0) target_sources(bmh_launcher PRIVATE ../launch/launcher_gtk.cpp) target_link_libraries(bmh_launcher PRIVATE PkgConfig::BMH_GTK) endif() add_executable(native_content_tests ../../tests/native_content_tests.cpp) target_link_libraries(native_content_tests PRIVATE bmh_launcher) add_test(NAME native_content_tests COMMAND native_content_tests) add_executable(native_runtime_tests ../../tests/native_runtime_tests.cpp ${BMH_APP_SESSION_SDL_SOURCE} ${BMH_APP_CONTROLLER_SOURCE}) target_link_libraries(native_runtime_tests PRIVATE bmhui bmh_launcher openbmh_audio) bmh_add_data_test(NAME native_runtime_tests COMMAND native_runtime_tests "${BMH_DATA}") if(MSVC) target_compile_options(bmh_content PRIVATE /W4 /utf-8) target_compile_options(bmh_launcher PRIVATE /W4 /utf-8) target_compile_options(native_content_tests PRIVATE /utf-8) target_compile_options(native_runtime_tests PRIVATE /utf-8) endif()