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"><<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>></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 "/" "\\\\" 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( "Source/Lib" "${HDRS}" "${SRCS}")<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 "filter"/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>
> I was curious about an answer to this question. I don't think source and<br>
> header files should be separated either. It's just a nag, but if there was<br>
> an easy fix, I'd jump on it.<br>
><br>
> ---<br>
> Aaron Wright<br>
><br>
><br>
><br>
><br>
> From: Orcun Gokbulut <<a href="mailto:madorcun@gmail.com">madorcun@gmail.com</a>><br>
> To: <a href="mailto:cmake@cmake.org">cmake@cmake.org</a><br>
> Date: 02/23/2011 07:48 AM<br>
> Subject: [CMake] Default visual studio filters<br>
> Sent by: <a href="mailto:cmake-bounces@cmake.org">cmake-bounces@cmake.org</a><br>
><br>
><br>
><br>
> Hello cmake users,<br>
><br>
> We are porting our visual studio based build system to cmake and its<br>
> allmost done with some minor problems.<br>
><br>
> One of the minor problem is default visual c++ filters (source groups)<br>
> I don't like (actually hate) visual c++'s default *.cpp *.h filters. (Not<br>
> the filter feature but the default filters) They make navigation hard at<br>
> solution explorer and I want source and header file to be listed next to<br>
> each other.<br>
> Therefore I want all of my source files to be not included in a filter and<br>
> remove "Source Files" and "Header Files" filters. I have read the<br>
> documentation and exprimented with SOURCE_GROUP command but I can not<br>
> figure out how to remove default *.cpp and *.h source groups.<br>
><br>
> Also I'm going to add a special regex filter that combines auto generated<br>
> source codes in to a filter. Something like<br>
> source_group (ZPP REGULAR_EXPRESSION ".*\\.zpp")<br>
><br>
><br>
> How can I do that ?<br>
><br>
> Thanks every one,<br>
> Orçun_______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <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:<br>
> <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>
><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>
<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>