tschw / AntTweakBar

Lightweight property editor GUI for with 3D graphics and APIs
Other
31 stars 17 forks source link

Vsual Studio 2019 CMake with fxc created .h files in wrong folder #2

Closed lucifer602288 closed 3 years ago

lucifer602288 commented 4 years ago

"2>compilation header save succeeded; see C:\Users\lucifer\Downloads\AntTweakBar-master\build\Renderer\TwDirect3D11_LineRectVS.h 2>Building Custom Rule C:/Users/lucifer/Downloads/AntTweakBar-master/Renderer/CMakeLists.txt 2>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(231,5): warning MSB8065: Custom build for item "C:\Users\lucifer\Downloads\AntTweakBar-master\Renderer\compile\TwDirect3D11.hlsl" succeeded, but specified output "c:\users\lucifer\downloads\anttweakbar-master\renderer\twdirect3d11_linerectvs.h" has not been created. This may cause incremental build to work incorrectly."

.h files, see below, from TwDirect3D11.hlsl with fxc are created in the path AntTweakBar-master\build\Renderer and not in AntTweakBar-master\Renderer\compile, manual copying the files to AntTweakBar-master\Renderer\compile works for compiling. TwDirect3D11_LineRectCstColorVS.h TwDirect3D11_LineRectPS.h TwDirect3D11_LineRectVS.h TwDirect3D11_TextCstColorVS.h TwDirect3D11_TextPS.h TwDirect3D11_TextVS.h

Please fix. I am no CMake expert.

tschw commented 4 years ago

Copied from the review of #3 :

This is not an error but intentional, alhough apparently bugged (missing an include directory?) and maybe we should generate those files into a subdirectory:

In my world, the source tree should always be read-only and generated code should go to somewhere in the build tree and then be added to the target. Since we're talking headers, adding them to the target is only for the IDE and the containing directory needs to be added to the list of include directories for that target too.

tschw commented 3 years ago

In other words, it's better to make the compiler find the files where they are generated by setting an appropriate include directory, rather than trying to generate in or copy into the source tree.

tschw commented 3 years ago

Looks like the include path is already set up correctly here, so the C++ compiler should find those headers.

Can you provide complete diagnostics of the build failing OOTB?

lucifer602288 commented 3 years ago

CMAKE updated to from version 3.17 to version 3.19. Issue disappeared.