2022-11-08 21:08:58 +00:00
cmake_minimum_required ( VERSION 3.20 )
project ( YimMenu CXX ASM_MASM )
set ( SRC_DIR "${PROJECT_SOURCE_DIR}/src" )
2022-11-28 18:19:03 +01:00
# Git commit embed
include ( scripts/git.cmake )
2022-11-08 21:08:58 +00:00
# Fetch modules
message ( "\nFetching modules" )
include ( scripts/minhook.cmake )
2023-02-08 23:36:55 +01:00
include ( scripts/async-logger.cmake )
2022-11-08 21:08:58 +00:00
include ( scripts/pugixml.cmake )
include ( scripts/json.cmake )
2022-12-17 17:24:45 +01:00
include ( scripts/cpr.cmake )
2023-02-08 23:36:55 +01:00
include ( scripts/zydis.cmake )
2023-06-06 07:40:40 +00:00
include ( scripts/lua.cmake )
2022-11-08 21:08:58 +00:00
include ( scripts/imgui.cmake )
2023-07-23 12:51:57 -04:00
message ( "\nFetching custom modules" )
2022-11-08 21:08:58 +00: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-27 20:13:05 +02:00
if ( MSVC )
add_compile_options ( /bigobj )
2023-09-12 20:20:29 +02:00
add_compile_options ( "$<$<C_COMPILER_ID:MSVC>:/utf-8>" )
add_compile_options ( "$<$<CXX_COMPILER_ID:MSVC>:/utf-8>" )
2023-06-27 20:13:05 +02:00
else ( )
add_compile_options ( -Wa,-mbig-obj )
endif ( )
2022-11-08 21:08:58 +00: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 07:15:18 -06:00
source_group ( TREE ${ SRC_DIR } PREFIX "src" FILES ${ SRC_MAIN } )
2022-11-08 21:08:58 +00: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 07:40:40 +00:00
target_link_libraries ( YimMenu PRIVATE pugixml minhook AsyncLogger dbghelp imgui cpr Zydis lua_static )
2022-11-08 21:08:58 +00: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-27 20:13:05 +02:00
)