[CMake] Is it possible to show dependent files in Visual Studio folders for ADD_CUSTOM_TARGET?

2013-01-19 Thread Jose Luis Blanco
Hello all,

I hope you can help me answering whether the following is possible with CMake:

We have a set of C++ libraries, some of which are header-only.
Obviously those ones don't really need to be built, but it's
interesting to define targets for them anyway to define dependencies
in other executables  libraries that depend on them.

Right now, my approach to define header-only libs is like:

add_custom_target(LIB_NAME DEPENDS ${LIST_OF_HEADERS})

But then the Visual Studio (or CodeBlock) folders don't show any of
the header files, only the CMakeLists.txt file and the CMake rules
folder.
I've tried with explicit calls to SOURCE_GROUP() without results.

I would be great to have the headers shown in the project folder for
quickly opening them for editing, launching all solution files
searches, etc.

Any idea on how to achieve this? Is it possible without modifying CMake sources?

Cheers,
Jose Luis
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Is it possible to show dependent files in Visual Studio folders for ADD_CUSTOM_TARGET?

2013-01-19 Thread Fraser Hutchison
I think this is what the SOURCES arg is for.  You could just duplicate 
the list of DEPENDS files as the SOURCES argument too:


add_custom_target(LIB_NAME DEPENDS ${LIST_OF_HEADERS} SOURCES 
${LIST_OF_HEADERS})


Cheers,
Fraser.

On 19/01/2013 10:08, Jose Luis Blanco wrote:

Hello all,

I hope you can help me answering whether the following is possible with CMake:

We have a set of C++ libraries, some of which are header-only.
Obviously those ones don't really need to be built, but it's
interesting to define targets for them anyway to define dependencies
in other executables  libraries that depend on them.

Right now, my approach to define header-only libs is like:

add_custom_target(LIB_NAME DEPENDS ${LIST_OF_HEADERS})

But then the Visual Studio (or CodeBlock) folders don't show any of
the header files, only the CMakeLists.txt file and the CMake rules
folder.
I've tried with explicit calls to SOURCE_GROUP() without results.

I would be great to have the headers shown in the project folder for
quickly opening them for editing, launching all solution files
searches, etc.

Any idea on how to achieve this? Is it possible without modifying CMake sources?

Cheers,
Jose Luis
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Is it possible to show dependent files in Visual Studio folders for ADD_CUSTOM_TARGET?

2013-01-19 Thread Jose Luis Blanco
That's exactly what I was looking for, thanks Fraser!

JL

On Sat, Jan 19, 2013 at 12:17 PM, Fraser Hutchison
fraser.hutchi...@gmail.com wrote:
 I think this is what the SOURCES arg is for.  You could just duplicate the
 list of DEPENDS files as the SOURCES argument too:

 add_custom_target(LIB_NAME DEPENDS ${LIST_OF_HEADERS} SOURCES
 ${LIST_OF_HEADERS})

 Cheers,
 Fraser.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake