Also you could employ SOURCES property of target to get list of files to eliminate the need of passing them to macro explicitly.<br><br><div class="gmail_quote">On Fri, Feb 25, 2011 at 8:58 PM, Michael Jackson <span dir="ltr">&lt;<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I have the following macro that I use:<br>
<br>
<br>
MACRO (cmp_IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES)<br>
    STRING(REPLACE &quot;/&quot; &quot;\\\\&quot; source_group_path ${SOURCE_PATH}  )<br>
    source_group(${source_group_path} FILES ${HEADERS} ${SOURCES})<br>
ENDMACRO (cmp_IDE_SOURCE_PROPERTIES NAME HEADERS SOURCES INSTALL_FILES)<br>
<br>
#Example Usage<br>
set(SRCS Foo.cpp bar.cpp)<br>
set(HDRS Foo.h   bar.h)<br>
cmp_IDE_SOURCE_PROPERTIES( &quot;Source/Lib&quot; &quot;${HDRS}&quot; &quot;${SRCS}&quot;)<br>
add_library( foolib  ${SRCS} ${HDRS})<br>
<br>
and in Visual Studio I get Foo.cpp bar.cpp foo.h bar.h all in the same &quot;filter&quot;/Folder thingie. Is that what you are looking for?<br>
<br>
___________________________________________________________<br>
Mike Jackson                      <a href="http://www.bluequartz.net" target="_blank">www.bluequartz.net</a><br>
Principal Software Engineer       <a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a><br>
BlueQuartz Software               Dayton, Ohio<br>
<div><div></div><div class="h5"><br>
On Feb 25, 2011, at 12:42 PM, <a href="mailto:Aaron_Wright@selinc.com">Aaron_Wright@selinc.com</a> wrote:<br>
<br>
&gt; I was curious about an answer to this question. I don&#39;t think source and<br>
&gt; header files should be separated either. It&#39;s just a nag, but if there was<br>
&gt; an easy fix, I&#39;d jump on it.<br>
&gt;<br>
&gt; ---<br>
&gt; Aaron Wright<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; From:   Orcun Gokbulut &lt;<a href="mailto:madorcun@gmail.com">madorcun@gmail.com</a>&gt;<br>
&gt; To:     <a href="mailto:cmake@cmake.org">cmake@cmake.org</a><br>
&gt; Date:   02/23/2011 07:48 AM<br>
&gt; Subject:        [CMake] Default visual studio filters<br>
&gt; Sent by:        <a href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Hello cmake users,<br>
&gt;<br>
&gt; We are porting our visual studio based build system to cmake and its<br>
&gt; allmost done with some minor problems.<br>
&gt;<br>
&gt; One of the minor problem is default visual c++ filters (source groups)<br>
&gt; I don&#39;t like (actually hate) visual c++&#39;s default *.cpp *.h filters. (Not<br>
&gt; the filter feature but the default filters) They make navigation hard at<br>
&gt; solution explorer and I want source and header file to be listed next to<br>
&gt; each other.<br>
&gt; Therefore I want all of my source files to be not included in a filter and<br>
&gt; remove &quot;Source Files&quot; and &quot;Header Files&quot; filters.  I have read the<br>
&gt; documentation and exprimented with SOURCE_GROUP command but I can not<br>
&gt; figure out how to remove default *.cpp and *.h source groups.<br>
&gt;<br>
&gt; Also I&#39;m going to add a special regex filter that combines auto generated<br>
&gt; source codes in to a filter. Something like<br>
&gt; source_group (ZPP REGULAR_EXPRESSION &quot;.*\\.zpp&quot;)<br>
&gt;<br>
&gt;<br>
&gt; How can I do that ?<br>
&gt;<br>
&gt; Thanks every one,<br>
&gt; Orçun_______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">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" target="_blank">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" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br>