Skip to content

Commit

Permalink
Output binaries to Bin/ directory and automatically execute TEVCProj …
Browse files Browse the repository at this point in the history
…if available.
  • Loading branch information
hogsy committed Oct 14, 2024
1 parent 9dc9699 commit 992c038
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 85 deletions.
175 changes: 93 additions & 82 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,89 +10,100 @@ set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True)

include_directories(
BungieFrameWork/BFW_Headers/
BungieFrameWork/BFW_Source/BFW_Akira/
BungieFrameWork/BFW_Source/BFW_Object/
BungieFrameWork/BFW_Source/BFW_Batou/
BungieFrameWork/BFW_Source/BFW_Bink/
BungieFrameWork/BFW_Source/BFW_Bink/BinkHeaders/
BungieFrameWork/BFW_Source/BFW_Console/
BungieFrameWork/BFW_Source/BFW_DialogManager/
BungieFrameWork/BFW_Source/BFW_DialogManager/DM_Cursor/
BungieFrameWork/BFW_Source/BFW_DialogManager/VM_Views/
BungieFrameWork/BFW_Source/BFW_FileManager/
BungieFrameWork/BFW_Source/BFW_FileFormat/
BungieFrameWork/BFW_Source/BFW_FileFormat/BMP/
BungieFrameWork/BFW_Source/BFW_FileFormat/PSD/
BungieFrameWork/BFW_Source/BFW_FileFormat/DDS/
BungieFrameWork/BFW_Source/BFW_Group/
BungieFrameWork/BFW_Source/BFW_Effect/
BungieFrameWork/BFW_Source/BFW_LocalInput/
BungieFrameWork/BFW_Source/BFW_MathLib/
BungieFrameWork/BFW_Source/BFW_Motoko/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/OGL_Common/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/DrawEngine/Direct3D/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/DrawEngine/Software/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/DrawEngine/3DFX_Glide/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/GeomEngine/Software/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/GeomEngine/GeomOpenGL/
BungieFrameWork/BFW_Source/BFW_Motoko/Manager/
BungieFrameWork/BFW_Source/BFW_Motoko/Manager/Win32/
BungieFrameWork/BFW_Source/BFW_NetworkManager/
BungieFrameWork/BFW_Source/BFW_NetworkManager/NM_Queues/
BungieFrameWork/BFW_Source/BFW_NetworkManager/NM_WinSock/
BungieFrameWork/BFW_Source/BFW_RedPig/
BungieFrameWork/BFW_Source/BFW_RemoteInput/
BungieFrameWork/BFW_Source/BFW_Shared/
BungieFrameWork/BFW_Source/BFW_SoundSystem/
BungieFrameWork/BFW_Source/BFW_SoundSystem2/
BungieFrameWork/BFW_Source/BFW_TemplateManager/
BungieFrameWork/BFW_Source/BFW_TextSystem/
BungieFrameWork/BFW_Source/BFW_Totoro/
BungieFrameWork/BFW_Source/BFW_Utility/
BungieFrameWork/BFW_Source/BFW_WindowManager/
BungieFrameWork/BFW_Source/BFW_WindowManager/WM_Cursor/
BungieFrameWork/BFW_Source/BFW_WindowManager/WM_Dialog/
BungieFrameWork/BFW_Source/BFW_WindowManager/WM_DrawContext/
BungieFrameWork/BFW_Source/BFW_WindowManager/WM_PartSpecification/
BungieFrameWork/BFW_Source/BFW_WindowManager/WM_Utilities/
BungieFrameWork/BFW_Source/BFW_WindowManager/WM_Windows/
BungieFrameWork/BFW_ToolSource/Common/LSSolutionFileIO/
BungieFrameWork/BFW_ToolSource/Common/LSSolutionFileIO/LSReader
BungieFrameWork/BFW_ToolSource/Common/TemplateExtractor
BungieFrameWork/BFW_ToolSource/Win32/ModelExporter
BungieFrameWork/BFW_Source/BFW_CommandLine/
OniProj/OniGameSource/
OniProj/OniGameSource/Oni_AI/
OniProj/OniGameSource/Oni_Networking/
OniProj/OniGameSource/Oni_Windows/
OniProj/OniGameSource/Oni_Object/
OniProj/OniGameSource/Oni_BinaryData/
OniProj/OniGameSource/Oni_OutGameUI/
BungieFrameWork/BFW_ToolSource/Common/Imp
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/DrawEngine/OpenGL/
BungieFrameWork/BFW_Headers/
BungieFrameWork/BFW_Source/BFW_Akira/
BungieFrameWork/BFW_Source/BFW_Object/
BungieFrameWork/BFW_Source/BFW_Batou/
BungieFrameWork/BFW_Source/BFW_Bink/
BungieFrameWork/BFW_Source/BFW_Bink/BinkHeaders/
BungieFrameWork/BFW_Source/BFW_Console/
BungieFrameWork/BFW_Source/BFW_DialogManager/
BungieFrameWork/BFW_Source/BFW_DialogManager/DM_Cursor/
BungieFrameWork/BFW_Source/BFW_DialogManager/VM_Views/
BungieFrameWork/BFW_Source/BFW_FileManager/
BungieFrameWork/BFW_Source/BFW_FileFormat/
BungieFrameWork/BFW_Source/BFW_FileFormat/BMP/
BungieFrameWork/BFW_Source/BFW_FileFormat/PSD/
BungieFrameWork/BFW_Source/BFW_FileFormat/DDS/
BungieFrameWork/BFW_Source/BFW_Group/
BungieFrameWork/BFW_Source/BFW_Effect/
BungieFrameWork/BFW_Source/BFW_LocalInput/
BungieFrameWork/BFW_Source/BFW_MathLib/
BungieFrameWork/BFW_Source/BFW_Motoko/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/OGL_Common/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/DrawEngine/Direct3D/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/DrawEngine/Software/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/DrawEngine/3DFX_Glide/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/GeomEngine/Software/
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/GeomEngine/GeomOpenGL/
BungieFrameWork/BFW_Source/BFW_Motoko/Manager/
BungieFrameWork/BFW_Source/BFW_Motoko/Manager/Win32/
BungieFrameWork/BFW_Source/BFW_NetworkManager/
BungieFrameWork/BFW_Source/BFW_NetworkManager/NM_Queues/
BungieFrameWork/BFW_Source/BFW_NetworkManager/NM_WinSock/
BungieFrameWork/BFW_Source/BFW_RedPig/
BungieFrameWork/BFW_Source/BFW_RemoteInput/
BungieFrameWork/BFW_Source/BFW_Shared/
BungieFrameWork/BFW_Source/BFW_SoundSystem/
BungieFrameWork/BFW_Source/BFW_SoundSystem2/
BungieFrameWork/BFW_Source/BFW_TemplateManager/
BungieFrameWork/BFW_Source/BFW_TextSystem/
BungieFrameWork/BFW_Source/BFW_Totoro/
BungieFrameWork/BFW_Source/BFW_Utility/
BungieFrameWork/BFW_Source/BFW_WindowManager/
BungieFrameWork/BFW_Source/BFW_WindowManager/WM_Cursor/
BungieFrameWork/BFW_Source/BFW_WindowManager/WM_Dialog/
BungieFrameWork/BFW_Source/BFW_WindowManager/WM_DrawContext/
BungieFrameWork/BFW_Source/BFW_WindowManager/WM_PartSpecification/
BungieFrameWork/BFW_Source/BFW_WindowManager/WM_Utilities/
BungieFrameWork/BFW_Source/BFW_WindowManager/WM_Windows/
BungieFrameWork/BFW_ToolSource/Common/LSSolutionFileIO/
BungieFrameWork/BFW_ToolSource/Common/LSSolutionFileIO/LSReader
BungieFrameWork/BFW_ToolSource/Common/TemplateExtractor
BungieFrameWork/BFW_ToolSource/Win32/ModelExporter
BungieFrameWork/BFW_Source/BFW_CommandLine/
OniProj/OniGameSource/
OniProj/OniGameSource/Oni_AI/
OniProj/OniGameSource/Oni_Networking/
OniProj/OniGameSource/Oni_Windows/
OniProj/OniGameSource/Oni_Object/
OniProj/OniGameSource/Oni_BinaryData/
OniProj/OniGameSource/Oni_OutGameUI/
BungieFrameWork/BFW_ToolSource/Common/Imp
BungieFrameWork/BFW_Source/BFW_Motoko/Engines/DrawEngine/OpenGL/
)
if(WIN32)
include_directories(
BungieFrameWork/BFW_Source/BFW_LocalInput/Platform_Win32/
BungieFrameWork/BFW_Source/BFW_SoundSystem/Platform_Win32/
BungieFrameWork/BFW_Source/BFW_SoundSystem2/Platform_Win32/
BungieFrameWork/BFW_Source/BFW_CommandLine/Platform_Win32/
OniProj/OniGameSource/Platform_Win32/
)
elseif(APPLE)
include_directories(
BungieFrameWork/BFW_Source/BFW_LocalInput/Platform_MacOS/
BungieFrameWork/BFW_Source/BFW_SoundSystem/Platform_MacOS/
BungieFrameWork/BFW_Source/BFW_SoundSystem2/Platform_MacOS/
BungieFrameWork/BFW_Source/BFW_CommandLine/Platform_MacOS/
OniProj/OniGameSource/Platform_MacOS/
)
endif()
if (WIN32)
include_directories(
BungieFrameWork/BFW_Source/BFW_LocalInput/Platform_Win32/
BungieFrameWork/BFW_Source/BFW_SoundSystem/Platform_Win32/
BungieFrameWork/BFW_Source/BFW_SoundSystem2/Platform_Win32/
BungieFrameWork/BFW_Source/BFW_CommandLine/Platform_Win32/
OniProj/OniGameSource/Platform_Win32/
)
elseif (APPLE)
include_directories(
BungieFrameWork/BFW_Source/BFW_LocalInput/Platform_MacOS/
BungieFrameWork/BFW_Source/BFW_SoundSystem/Platform_MacOS/
BungieFrameWork/BFW_Source/BFW_SoundSystem2/Platform_MacOS/
BungieFrameWork/BFW_Source/BFW_CommandLine/Platform_MacOS/
OniProj/OniGameSource/Platform_MacOS/
)
endif ()

if(ONI_BINK_VIDEO)
add_subdirectory(OniProj/OniCMakeProjs/BinkProj/)
endif()
set(ONI_OUTPUT_DIR "${CMAKE_SOURCE_DIR}/Bin/")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${ONI_OUTPUT_DIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${ONI_OUTPUT_DIR}")
set(CMAKE_SHARED_LIBRARY_PREFIX "")
foreach (OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${ONI_OUTPUT_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${ONI_OUTPUT_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${ONI_OUTPUT_DIR})
endforeach ()

if (ONI_BINK_VIDEO)
add_subdirectory(OniProj/OniCMakeProjs/BinkProj/)
endif ()
add_subdirectory(OniProj/OniCMakeProjs/TEVCProj/)
add_subdirectory(OniProj/OniCMakeProjs/OniProj/)
22 changes: 19 additions & 3 deletions OniProj/OniCMakeProjs/TEVCProj/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set(BFW_SOURCE_FILES
../../../BungieFrameWork/BFW_ToolSource/Common/TemplateExtractor/TE_Extract.c
../../../BungieFrameWork/BFW_ToolSource/Common/TemplateExtractor/TE_Parser.c
../../../BungieFrameWork/BFW_ToolSource/Common/TemplateExtractor/TE_Symbol.c
)
)

if (WIN32)
add_executable(TEVCProj
Expand All @@ -32,7 +32,7 @@ if (WIN32)

# shoved here for now
../../OniWin32Projs/ImpConsole/templatechecksum.c
)
)
endif ()

target_precompile_headers(TEVCProj PRIVATE ../../../BungieFrameWork/BFW_Headers/BFW_MasterHeader.h)
Expand All @@ -41,5 +41,21 @@ if (MSVC)
target_compile_options(TEVCProj
PRIVATE
/FI../../../BungieFrameWork/BFW_Headers/BFW_MasterHeader.h
)
)
endif ()

set(TEVCProjExecutable "")
if (WIN32)
set(TEVCProjExecutable "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TEVCProj.exe")
else ()
set(TEVCProjExecutable "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TEVCProj")
endif ()

if (EXISTS "${TEVCProjExecutable}")
message("Found TEVCProj under output directory, attempting to update templatechecksum.c")
execute_process(
COMMAND "${TEVCProjExecutable}"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/OniProj/OniCMakeProjs/TEVCProj/")
else ()
message("Failed to find TEVCProj under output directory (${CMAKE_RUNTIME_OUTPUT_DIRECTORY})!")
endif ()

0 comments on commit 992c038

Please sign in to comment.