mirror of
https://github.com/gwdevhub/gMod.git
synced 2026-07-21 01:49:31 +00:00
a7e36fc965
* remove GUI parts as those will not be updated * move to header/source * add cmakelist to create solution * Change Readme * Implement modlist.txt loading * Setup versioning and CD pipeline * Setup DirectX in pipeline * Make uMod load from uMod.dll directory * Fix file loading * Remove break * Fix CD pipeline (#1) * Test cd pipeline * See what's in Lib directory * See inside lib/x86 * Manually adjust the build environment * Disable CD pipeline in PRs Create CI pipeline * Fix slashes in path * Fix build call * Attempt to fix paths * Copy dx headers inside the /header folder * Use ps * Change cache location * Path changes * Improve CMake to look for lib and header files * Fix missing Lib folder * Move changes to CD pipeline * Disable CI on merge and fix CD (#2) * Fix CD tag (#4) * Hijack existing DirectX calls (#5) * Create a dll without listener (#6) * Fix asset creation in CD pipeline (#7) * Setup file loading * create necessary files * merge latest changes, set output dir * Change main to master in pipelines Add fallback for DX libs in CMakeLists * Setup new generator * formatting * remove listener * Change CD to pick the dll from bin Change release name to gMod * more formatting * add editorconfig * Setup versioning * Remove CODEOWNERS --------- Co-authored-by: Alex Macocian <amacocian@yahoo.com>
65 lines
1.8 KiB
CMake
65 lines
1.8 KiB
CMake
cmake_minimum_required(VERSION 3.16)
|
|
|
|
set(CMAKE_GENERATOR_PLATFORM win32)
|
|
|
|
project(gMod)
|
|
|
|
if(NOT(CMAKE_SIZEOF_VOID_P EQUAL 4))
|
|
message(FATAL_ERROR "You are configuring a non 32-bit build, this is not supported. Run cmake with `-A Win32`")
|
|
endif()
|
|
|
|
set(VERSION_MAJOR 1)
|
|
set(VERSION_MINOR 5)
|
|
set(VERSION_PATCH 3)
|
|
set(VERSION_TWEAK 0)
|
|
|
|
set(VERSION_RC "${CMAKE_CURRENT_BINARY_DIR}/version.rc")
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.rc.in" "${VERSION_RC}" @ONLY)
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin/")
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
|
|
|
|
add_compile_options(/MP /permissive-)
|
|
|
|
find_library(D3D9_LIB NAMES d3d9 PATHS $ENV{DXSDK_DIR}/lib/x86 NO_DEFAULT_PATH)
|
|
find_library(D3DX9_LIB NAMES d3dx9 PATHS $ENV{DXSDK_DIR}/lib/x86 NO_DEFAULT_PATH)
|
|
find_library(DXGUID_LIB NAMES dxguid PATHS $ENV{DXSDK_DIR}/lib/x86 NO_DEFAULT_PATH)
|
|
|
|
if(NOT D3D9_LIB)
|
|
find_library(D3D9_LIB NAMES d3d9 PATHS ${CMAKE_SOURCE_DIR}/Lib)
|
|
endif()
|
|
|
|
if(NOT D3DX9_LIB)
|
|
find_library(D3DX9_LIB NAMES d3dx9 PATHS ${CMAKE_SOURCE_DIR}/Lib)
|
|
endif()
|
|
|
|
if(NOT DXGUID_LIB)
|
|
find_library(DXGUID_LIB NAMES dxguid PATHS ${CMAKE_SOURCE_DIR}/Lib)
|
|
endif()
|
|
|
|
add_library(gMod SHARED)
|
|
|
|
file(GLOB SOURCES
|
|
"header/*.h"
|
|
"source/*.cpp"
|
|
${VERSION_RC}
|
|
)
|
|
|
|
target_link_libraries(gMod PRIVATE ${D3D9_LIB} ${D3DX9_LIB} ${DXGUID_LIB})
|
|
target_include_directories(gMod PRIVATE $ENV{DXSDK_DIR}/Include)
|
|
target_include_directories(gMod PUBLIC "header")
|
|
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${SOURCES})
|
|
target_sources(gMod PRIVATE ${SOURCES})
|
|
target_compile_definitions(gMod PRIVATE
|
|
"NOMINMAX"
|
|
"_WIN32_WINNT=_WIN32_WINNT_WIN7"
|
|
"WIN32_LEAN_AND_MEAN"
|
|
"VC_EXTRALEAN"
|
|
DIRECT_INJECTION
|
|
LOG_MESSAGE
|
|
)
|