From 6180c9308199f1fbf8f318a68836d293be5a983d Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sun, 3 Dec 2023 12:44:46 +0100 Subject: [PATCH] Consistently enable INSTALL project in Visual Studio solution --- CMakeLists.txt | 4 ++++ tools/build/win_scripts/vs_create_solution.bat | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b32611bc..e83a3d4c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,6 +140,10 @@ endif() # Custom default install location. if(BUILD_DLL) get_filename_component(DLL_INSTALL_PREFIX "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Electronic Arts\\EA Games\\Command and Conquer Generals Zero Hour;InstallPath]" ABSOLUTE CACHE) + if(MSVC) + # Include INSTALL to build by default. This copies dll's and pdb's to game directory. + set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) + endif() endif() if(WIN32 OR "${CMAKE_SYSTEM}" MATCHES "Windows") diff --git a/tools/build/win_scripts/vs_create_solution.bat b/tools/build/win_scripts/vs_create_solution.bat index c27520655..02ede41ad 100644 --- a/tools/build/win_scripts/vs_create_solution.bat +++ b/tools/build/win_scripts/vs_create_solution.bat @@ -14,8 +14,7 @@ cd /d "%SolutionDir%" "%CMakeDir%\bin\cmake.exe" ^ -G "%GeneratorName%" ^ -A Win32 ^ - -S "%ProjectDir%" ^ - -DCMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD=1 + -S "%ProjectDir%" cd /d "%cd%" :: Open cmake gui for user customizations