1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

[conan] add MSVC support

also removes all mentions of vcpkg and cross-building from Linux
This commit is contained in:
Andrey Filipenkov
2025-03-07 11:36:08 +03:00
parent 951be24f5e
commit a3f08c2217
11 changed files with 53 additions and 123 deletions

View File

@@ -118,16 +118,6 @@ function(vcmi_print_git_commit_hash)
endfunction()
#install imported target on windows
function(install_vcpkg_imported_tgt tgt)
get_target_property(TGT_LIB_LOCATION ${tgt} LOCATION)
get_filename_component(TGT_LIB_FOLDER ${TGT_LIB_LOCATION} PATH)
get_filename_component(tgt_name ${TGT_LIB_LOCATION} NAME_WE)
get_filename_component(TGT_DLL ${TGT_LIB_FOLDER}/../bin/${tgt_name}.dll ABSOLUTE)
message("${tgt_name}: ${TGT_DLL}")
install(FILES ${TGT_DLL} DESTINATION ${BIN_DIR})
endfunction(install_vcpkg_imported_tgt)
# install dependencies from Conan, CONAN_RUNTIME_LIBS_FILE is set in conanfile.py
function(vcmi_install_conan_deps)
if(NOT USING_CONAN)
@@ -149,3 +139,14 @@ function(vcmi_deploy_qt deployQtToolName deployQtOptions)
message(WARNING "${deployQtToolName} not found, running cpack would result in broken package")
endif()
endfunction()
# generate .bat for .exe with proper PATH
function(vcmi_create_exe_shim tgt)
if(NOT CONAN_RUNENV_SCRIPT)
return()
endif()
file(GENERATE OUTPUT "$<TARGET_FILE_DIR:${tgt}>/$<TARGET_FILE_BASE_NAME:${tgt}>.bat" CONTENT
"call ${CONAN_RUNENV_SCRIPT}
@start $<TARGET_FILE_NAME:${tgt}>"
)
endfunction()