project('game', default_options : ['default_library=static'])
cmake_cxx_standard = '17'
cmake_cxx_standard_required = 'on'
#set(CMAKE_TOOLCHAIN_FILE mingw-w64-x86_64.cmake) 
game_src = [cmake_current_source_dir, '/bots/bot_debug.cpp', cmake_current_source_dir, '/bots/bot_exports.cpp', cmake_current_source_dir, '/bots/bot_think.cpp', cmake_current_source_dir, '/bots/bot_utils.cpp', cmake_current_source_dir, '/cg_main.cpp', cmake_current_source_dir, '/cg_screen.cpp', cmake_current_source_dir, '/ctf/g_ctf.cpp', cmake_current_source_dir, '/ctf/p_ctf_menu.cpp', cmake_current_source_dir, '/g_ai.cpp', cmake_current_source_dir, '/g_chase.cpp', cmake_current_source_dir, '/g_cmds.cpp', cmake_current_source_dir, '/g_combat.cpp', cmake_current_source_dir, '/g_func.cpp', cmake_current_source_dir, '/g_items.cpp', cmake_current_source_dir, '/g_main.cpp', cmake_current_source_dir, '/g_misc.cpp', cmake_current_source_dir, '/g_monster.cpp', cmake_current_source_dir, '/g_phys.cpp', cmake_current_source_dir, '/g_save.cpp', cmake_current_source_dir, '/g_spawn.cpp', cmake_current_source_dir, '/g_svcmds.cpp', cmake_current_source_dir, '/g_target.cpp', cmake_current_source_dir, '/g_trigger.cpp', cmake_current_source_dir, '/g_turret.cpp', cmake_current_source_dir, '/g_utils.cpp', cmake_current_source_dir, '/g_weapon.cpp', cmake_current_source_dir, '/m_actor.cpp', cmake_current_source_dir, '/m_arachnid.cpp', cmake_current_source_dir, '/m_berserk.cpp', cmake_current_source_dir, '/m_boss2.cpp', cmake_current_source_dir, '/m_boss3.cpp', cmake_current_source_dir, '/m_boss31.cpp', cmake_current_source_dir, '/m_boss32.cpp', cmake_current_source_dir, '/m_brain.cpp', cmake_current_source_dir, '/m_chick.cpp', cmake_current_source_dir, '/m_flipper.cpp', cmake_current_source_dir, '/m_float.cpp', cmake_current_source_dir, '/m_flyer.cpp', cmake_current_source_dir, '/m_gladiator.cpp', cmake_current_source_dir, '/m_guardian.cpp', cmake_current_source_dir, '/m_guncmdr.cpp', cmake_current_source_dir, '/m_gunner.cpp', cmake_current_source_dir, '/m_hover.cpp', cmake_current_source_dir, '/m_infantry.cpp', cmake_current_source_dir, '/m_insane.cpp', cmake_current_source_dir, '/m_medic.cpp', cmake_current_source_dir, '/m_move.cpp', cmake_current_source_dir, '/m_mutant.cpp', cmake_current_source_dir, '/m_parasite.cpp', cmake_current_source_dir, '/m_shambler.cpp', cmake_current_source_dir, '/m_soldier.cpp', cmake_current_source_dir, '/m_supertank.cpp', cmake_current_source_dir, '/m_tank.cpp', cmake_current_source_dir, '/p_client.cpp', cmake_current_source_dir, '/p_hud.cpp', cmake_current_source_dir, '/p_move.cpp', cmake_current_source_dir, '/p_trail.cpp', cmake_current_source_dir, '/p_view.cpp', cmake_current_source_dir, '/p_weapon.cpp', cmake_current_source_dir, '/q_std.cpp', cmake_current_source_dir, '/rogue/g_rogue_combat.cpp', cmake_current_source_dir, '/rogue/g_rogue_func.cpp', cmake_current_source_dir, '/rogue/g_rogue_items.cpp', cmake_current_source_dir, '/rogue/g_rogue_misc.cpp', cmake_current_source_dir, '/rogue/g_rogue_monster.cpp', cmake_current_source_dir, '/rogue/g_rogue_newai.cpp', cmake_current_source_dir, '/rogue/g_rogue_newdm.cpp', cmake_current_source_dir, '/rogue/g_rogue_newfnc.cpp', cmake_current_source_dir, '/rogue/g_rogue_newtarg.cpp', cmake_current_source_dir, '/rogue/g_rogue_newtrig.cpp', cmake_current_source_dir, '/rogue/g_rogue_newweap.cpp', cmake_current_source_dir, '/rogue/g_rogue_phys.cpp', cmake_current_source_dir, '/rogue/g_rogue_spawn.cpp', cmake_current_source_dir, '/rogue/g_rogue_sphere.cpp', cmake_current_source_dir, '/rogue/g_rogue_utils.cpp', cmake_current_source_dir, '/rogue/m_rogue_carrier.cpp', cmake_current_source_dir, '/rogue/m_rogue_stalker.cpp', cmake_current_source_dir, '/rogue/m_rogue_turret.cpp', cmake_current_source_dir, '/rogue/m_rogue_widow.cpp', cmake_current_source_dir, '/rogue/m_rogue_widow2.cpp', cmake_current_source_dir, '/rogue/p_rogue_weapon.cpp', cmake_current_source_dir, '/rogue/rogue_dm_ball.cpp', cmake_current_source_dir, '/rogue/rogue_dm_tag.cpp', cmake_current_source_dir, '/xatrix/g_xatrix_func.cpp', cmake_current_source_dir, '/xatrix/g_xatrix_items.cpp', cmake_current_source_dir, '/xatrix/g_xatrix_misc.cpp', cmake_current_source_dir, '/xatrix/g_xatrix_monster.cpp', cmake_current_source_dir, '/xatrix/g_xatrix_target.cpp', cmake_current_source_dir, '/xatrix/g_xatrix_weapon.cpp', cmake_current_source_dir, '/xatrix/m_xatrix_fixbot.cpp', cmake_current_source_dir, '/xatrix/m_xatrix_gekk.cpp', cmake_current_source_dir, '/xatrix/p_xatrix_weapon.cpp']
cmake_cxx_flags = ['-lm -ldl -fPIE -pie -lfmt', 'CACHE', 'STRING', 'compile flags', 'FORCE']
# add_compile_options(['-DKEX_Q2_GAME', '-DKEX_Q2GAME_EXPORTS', '-DNO_FMT_SOURCE', '-DKEX_Q2GAME_DYNAMIC'])
game_lib = shared_library('game', game_src)
# target_include_directories(['game', 'PUBLIC', '/usr/include/jsoncpp'])
# set_target_properties(['game', 'PROPERTIES', 'POSITION_INDEPENDENT_CODE', 'ON'])
# set_target_properties(['game', 'PROPERTIES', 'PREFIX', ''])
# set_target_properties(['game', 'PROPERTIES', 'OUTPUT_NAME', 'gamex86'])
## Packages
PkgConfig_dep = dependency('PkgConfig')
# Fetch fmt locally
# pkg_check_modules(['fmt', 'fmt'])
fmt_dep = dependency('fmt')
# Fetch jsoncpp locally
# pkg_check_modules(['JSONCPP', 'jsoncpp'])
jsoncpp = find_library('JSONCPP')
# Link
# target_link_libraries(['game', 'fmt::fmt', jsoncpp])
