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" )
# Fetch modules
message ( "\nFetching modules" )
include ( scripts/minhook.cmake )
include ( scripts/g3log.cmake )
include ( scripts/pugixml.cmake )
include ( scripts/json.cmake )
message ( "\nFetching custom modules" )
include ( scripts/imgui.cmake )
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 "
)
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 } "
" $ { m i n h o o k _ S O U R C E _ D I R } / i n c l u d e "
" $ { i m g u i _ S O U R C E _ D I R } "
)
target_precompile_headers ( YimMenu PRIVATE "${SRC_DIR}/common.hpp" )
target_link_libraries ( YimMenu PRIVATE pugixml minhook g3log imgui d3dcompiler )
# 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 "
)