Why is my project not being added to a folder within a Visual Studio 2022 solution with cmake?


I am trying to make a Visaul Studio 2022 solution, where “someexe” will be added to the folder “exefolder”. However, someexe is not being added to exefolder. I have attempted to set the folder property in both the solution (I am running cmake on the “scripts\x64\CMakeLists.txt” example below), and in the project “someexe”

My folder structure is

root
    |--someexe
       |--CMakeLists.txt
    |--scripts
       |--x64
          |--CMakeLists

someexe\CMakeLists.txt

cmake_minimum_required(VERSION 3.28)
project(someexe)
add_executable(${PROJECT_NAME} ../main.cpp)

set_target_properties(someexe PROPERTIES FOLDER "exefolder")

scripts\x64\CMakeLists.txt

cmake_minimum_required(VERSION 3.10)
project(x64-Platform)
set(CMAKE_GENERATOR_PLATFORM x64)
add_subdirectory(../../someexe x64_someexe)

set_target_properties(someexe PROPERTIES FOLDER "exefolder")

Leave a Reply

Your email address will not be published. Required fields are marked *