Custom build in generated project files for Visual Studio 2015
Hello, I generated VS2015 solution with multiple projects with cmake 3.7.2 . First I had problem to work on projects because in some of them is running unknown command line and when opened project properties then I did not see pre-build, post-build or custom build steps. After editing manually *.vcxproj files I found that it contains custom build step which is not defined properly.
CMake generates <CustomBuild>...command line...</CustomBuild>
on bad place even it is able to run, but very confusing is that in GUI it is invisible.
I removed CustomBuild from several project files but after another builds CustomBuild was inserted again. Then I appear that custom build commands generates on build some of projects again, so I had to remove them from all *.vcxproj .
Custom build step created by cmake is written on bad place and xml element has incorrect name:
<Project> <ItemGroup> <CustomBuild>..command...<CustomBuild> </ItemGroup> </Project>
It should be:
<Project> <ItemDefinitionGroup> <CustomBuildStep>... command... </CustomBuildStep> </ItemDefinitionGroup> </Project>
I appear also:
<CustomBuild Include=.....>
where Include
is not readable by VS.
For example here are properly created post-build and custom build steps from VS created by VS 2015 GUI:
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <PrecompiledHeader>Use</PrecompiledHeader> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <SDLCheck>true</SDLCheck> <AdditionalIncludeDirectories>F:\Projects\libraries\contrib\fc\include;d:\local\boost_1_60_0</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> </Link> <PostBuildEvent> <Command>post_build_step.exe /par1 /par2</Command> </PostBuildEvent> <CustomBuildStep> <Command>custom_build_step.exe /par1 /par2</Command> </CustomBuildStep> </ItemDefinitionGroup>
Peter