[libtorch] cannot open source file "torch/torch.h"

i am encountering a problem where in my uneducated opinion, the includes should already be included in the cmake file using

target_include_directories(testing PUBLIC "${TORCH_INCLUDE_DIRS}")

but cannot be opened in the .cpp file, that is in the same directory as the cmake file. here are what my files look like:

CMakelists.txt

cmake_minimum_required(VERSION 3.18)

project(testing)

list(APPEND CMAKE_PREFIX_PATH "Downloads/path/to/libtorch")
find_package(Torch REQUIRED)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")

add_executable(testing test.cpp)
target_link_libraries(testing ${TORCH_LIBRARIES})
target_include_directories(testing PUBLIC "${TORCH_INCLUDE_DIRS}") #does not build without scope keyword
set_property(TARGET testing PROPERTY CXX_STANDARD 17)


if (MSVC) # I am on Visual Studio
  file(GLOB TORCH_DLLS "${TORCH_INSTALL_PREFIX}/lib/*.dll")
  add_custom_command(TARGET testing
                     POST_BUILD
                     COMMAND ${CMAKE_COMMAND} -E copy_if_different
                     ${TORCH_DLLS}
                     $<TARGET_FILE_DIR:testing>)
endif (MSVC)

test.cpp

#include <torch/torch.h>
#include <iostream>

int main() {
	torch::Tensor tensor = torch::rand({ 2, 3 });
	std::cout << tensor << "\n";
}

in test.cpp it tells me " cannot open source file “torch/torch.h” "
CppProperties.json points to the right torch folder and torch.h is present inside. it was explicitly included there as a fix suggested by visual studio, and removing it does not change the outcome

my question is: why would it not be able to open the file? i have tried opening Visual Studio in Administrator mode, and it did not help.
i have searched the internet far and wide, including this forum, stackoverflow and reddit, but i have not found a solution to my problem so far.

${TORCH_INCLUDE_DIRS} definition

if(EXISTS "${TORCH_INSTALL_PREFIX}/include")
  set(TORCH_INCLUDE_DIRS
    ${TORCH_INSTALL_PREFIX}/include
    ${TORCH_INSTALL_PREFIX}/include/torch/csrc/api/include)
else()
  set(TORCH_INCLUDE_DIRS
    ${TORCH_INSTALL_PREFIX}/include
    ${TORCH_INSTALL_PREFIX}/include/torch/csrc/api/include)
endif()

i found out that it 100% finds the correct config when building and /include exists (doesnt matter, it would still try), why it does not add the dependencies is beyond me, because if it did it would probably work. it not finding torch/torch.h would indicate that it does not set.

what i found out is that it does not find my python installation during building caffe2 dependencies, but it didnt stop building for some reason. does that matter? if yes, how can i fix that?

i have found out that it was an issue with visual studio. my Project was not set up properly.
What i did: i opened up a folder in my explorer and used that as my project folder. While building, cmake was not able to set up dependencies properly (it never told me that tho) because there were some critical visual studio files missing that generate when you create a project with visual studio. i tested that by making a new project with visual studio and testing my code there, and it worked.