fallout2-re icon indicating copy to clipboard operation
fallout2-re copied to clipboard

How to build a project on MSVC 2022?

Open JordanCpp opened this issue 2 years ago • 5 comments

Greetings.

Please write instructions for compiling the project.

FetchContent_Declare(zlib GIT_REPOSITORY "https://github.com/madler/zlib" GIT_TAG "v1.2.11" )

This does not work.

JordanCpp avatar May 13 '22 09:05 JordanCpp

I was able to build the project using cmake integrated into VS2022 by changing "generator" field in CMakeSettings.json to "Visual Studio 17 2022" for both configurations, everything else worked right away.

c6-dev avatar May 13 '22 12:05 c6-dev

As a side note, after every commit a new build is generated and can be downloaded here. So unless someone wants to actually write their own code, it's not necessary to compile the files manually.

Lexx2k avatar May 13 '22 12:05 Lexx2k

@JordanCpp do you have git installed and is it in your PATH system variable? If not you will get an error message like this.

1> [CMake] CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/ExternalProject.cmake:2666 (message):
1> [CMake]   error: could not find git for clone of fpattern-populate
1> [CMake] Call Stack (most recent call first):
1> [CMake]   C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/ExternalProject.cmake:3716 (_ep_add_download_command)
1> [CMake]   CMakeLists.txt:23 (ExternalProject_Add)
1> [CMake] -- Configuring incomplete, errors occurred!

If that's not the issue you should post the actual error message you get.

JanSimek avatar May 14 '22 20:05 JanSimek

@JanSimek

installed git.

Серьезность Код Описание Проект Файл Строка Состояние подавления Ошибка CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.21/Modules/FetchContent.cmake:1058 (__FetchContent_getSavedDetails): Unknown CMake command "__FetchContent_getSavedDetails". CrossCompileExample C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.21/Modules/FetchContent.cmake 1058

FetchContent.cmake __FetchContent_getSavedDetails(${contentName} contentDetails) if("${contentDetails}" STREQUAL "") message(FATAL_ERROR "No details have been set for content: ${contentName}") endif()

JordanCpp avatar May 15 '22 07:05 JordanCpp

Apparently you don't have git installed. Open up Visual Studio Installer, click Modify, on the Individual components tab find Git for Windows. Also you'll probably need to switch to Ninja in CMakeSettings.json.

alexbatalov avatar May 17 '22 21:05 alexbatalov