2022-11-09 05:08:58 +08:00
cmake_minimum_required ( VERSION 3.20 )
project ( YimMenu CXX ASM_MASM )
set ( SRC_DIR "${PROJECT_SOURCE_DIR}/src" )
2022-11-29 01:19:03 +08:00
# Git commit embed
include ( scripts/git.cmake )
2022-11-09 05:08:58 +08:00
# Fetch modules
message ( "\nFetching modules" )
include ( scripts/minhook.cmake )
2023-02-09 06:36:55 +08:00
include ( scripts/async-logger.cmake )
2022-11-09 05:08:58 +08:00
include ( scripts/pugixml.cmake )
include ( scripts/json.cmake )
2022-12-18 00:24:45 +08:00
include ( scripts/cpr.cmake )
2023-02-09 06:36:55 +08:00
include ( scripts/zydis.cmake )
2023-06-06 15:40:40 +08:00
include ( scripts/lua.cmake )
2022-11-09 05:08:58 +08:00
include ( scripts/imgui.cmake )
2023-07-24 00:51:57 +08:00
message ( "\nFetching custom modules" )
2022-11-09 05:08:58 +08:00
include ( scripts/gtav-classes.cmake )
# YimMenu
message ( STATUS "YimMenu" )
file ( GLOB_RECURSE SRC_MAIN
" $ { S R C _ D I R } / * * . h p p "
" $ { S R C _ D I R } / * * . h "
" $ { S R C _ D I R } / * * . c p p "
" $ { S R C _ D I R } / * * . c c "
" $ { S R C _ D I R } / * * . c x x "
" $ { S R C _ D I R } / * * . a s m "
)
2023-06-28 02:13:05 +08:00
if ( MSVC )
add_compile_options ( /bigobj )
else ( )
add_compile_options ( -Wa,-mbig-obj )
endif ( )
2022-11-09 05:08:58 +08:00
add_library ( YimMenu MODULE "${SRC_MAIN}" )
set_property ( GLOBAL PROPERTY USE_FOLDERS ON )
set_property ( TARGET YimMenu PROPERTY CXX_STANDARD 23 ) # 23 Because std::format is not avalible in std:c++20 for some reason. Maybe it's because i use v142 toolset.
2022-11-16 21:15:18 +08:00
source_group ( TREE ${ SRC_DIR } PREFIX "src" FILES ${ SRC_MAIN } )
2022-11-09 05:08:58 +08:00
target_include_directories ( YimMenu PRIVATE
" $ { S R C _ D I R } "
" $ { j s o n _ S O U R C E _ D I R } / s i n g l e _ i n c l u d e "
" $ { g t a v _ c l a s s e s _ S O U R C E _ D I R } "
" $ { i m g u i _ S O U R C E _ D I R } "
)
target_precompile_headers ( YimMenu PRIVATE "${SRC_DIR}/common.hpp" )
2023-06-06 15:40:40 +08:00
target_link_libraries ( YimMenu PRIVATE pugixml minhook AsyncLogger dbghelp imgui cpr Zydis lua_static )
2022-11-09 05:08:58 +08:00
# Warnings as errors
set_property ( TARGET YimMenu PROPERTY COMPILE_WARNING_AS_ERROR ON )
add_compile_definitions ( YimMenu
" _ C R T _ S E C U R E _ N O _ W A R N I N G S "
" N O M I N M A X "
" W I N 3 2 _ L E A N _ A N D _ M E A N "
2023-06-28 02:13:05 +08:00
)