Have you tried excluding the &quot;.exe&quot; thing? &nbsp;I thought cmake did the right thing for targets used in custom commands.<br><br>Clint<br><br>----- Reply message -----<br>From: &quot;Michael Jackson&quot; &lt;mike.jackson@bluequartz.net&gt;<br>Date: Wed, Jan 4, 2012 1:28 pm<br>Subject: [CMake] Add Custom COmmand and CMAKE_CFG_INTDIR<br>To: &quot;cmake@cmake.org List&quot; &lt;cmake@cmake.org&gt;<br><br>I am having trouble getting add_custom_Command and CMAKE_CFG_INTDIR to work correctly together. This is what I have so far.<br><br># ---------- Setup output Directories -------------------------<br>SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY<br> &nbsp;${PROJECT_BINARY_DIR}/Bin<br> &nbsp;CACHE PATH<br> &nbsp;&quot;Single Directory for all Libraries&quot;<br> &nbsp;)<br><br># Create our custom executable that will generate most of our QFilterWidget<br># classes from information stored in the Filters themselves. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>configure_file( ${FilterWidgets_SOURCE_DIR}/CodeGen.cpp.in<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;${FilterWidgets_BINARY_DIR}/FilterWidgetCodeGen.cpp)<br>add_executable(FilterWidgetCodeGen ${FilterWidgets_BINARY_DIR}/FilterWidgetCodeGen.cpp)<br>target_link_libraries(FilterWidgetCodeGen MXA EbsdLib DREAM3DLib)<br>set(EXE_EXTENSION &quot;&quot;)<br>if (WIN32)<br> &nbsp;set (EXE_EXTENSION &quot;.exe&quot;)<br>endif()<br># Now run the code to generate the header files which will over write the place<br># holder files that were generated from above &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>add_custom_command(TARGET FilterWidgetCodeGen POST_BUILD <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;COMMAND FilterWidgetCodeGen${EXE_EXTENSION} <br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WORKING_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})<br><br><br>I know this is going to fail on visual studio, which it did. The issue is, what combination of CMAKE_CFG_INTDIR and anything else do I use to get this to work?<br><br>Thanks<br>___________________________________________________________<br>Mike Jackson &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Principal Software Engineer<br>BlueQuartz Software &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Dayton, Ohio<br>mike.jackson@bluequartz.net &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;www.bluequartz.net<br><br>--<br><br>Powered by www.kitware.com<br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><br><br><br>