CMake 3.18; VS 2019;
I'm learning CMake and to check my results I'm trying to generate visual studio project. My current problem is precompiled header option. What I want to achieve is that VS project will have "/use" or "/create" precompiled headers option with correct file name.
In my project folder I already have ugpch.h & ugpch.cpp files, which stands for precompiled headers.
I've tryied to use target_precompile_headers(UGame PRIVATE Source/ugpch.h) instruction in my cmakelists, but that has no effect on my visual studio precompiled header option.
What is the correct way to do this?
Edit: I've updated my cmake to 3.18 version, but still no effect that I expected in my generated visual studio project.
Instead I found new folder "Precompile header files" with cmake_pch.cxx file.. It looks like target_precompile_headers did something totally different from what I expected
pch.hbut your CMake command specifies the file asSource/ugpch.h... - squareskittlestarget_precompile_headers. See that CMake generates the PCH files for you. - squareskittles