Skip to content

Visual Studio support suggestion #1

@reubengann

Description

@reubengann

Hi, this template was very helpful, thank you.

One suggestion: I wanted to use this with Visual Studio, and so I needed to change a few things in CMakeLists.txt. I'm wondering if you would consider adding them, possibly.

Once I had set up an x64-Debug Configuration, I changed line 69 to be
set(BUILD_DIR ${PROJECT_SOURCE_DIR}/out/build/${VS_CONFIGURATION_TYPE})

On line 82, it seems like msvc is cd-ing into the executable folder, so I needed to change it to say to remove the ${BUILD_DIR}/ and just be

COMMAND ${QT6_DIR}/bin/windeployqt.exe ${TARGET_NAME}.exe

Finally, MSVC requires you pass /Zc:__cplusplus /permissive-. I just did this via setting the CMake flags

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /permissive-")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions