Re: [CMake] Best way to show/include CMake files in IDE

2016-03-08 Thread Bill Hoffman

On 3/8/2016 2:25 PM, David Doria wrote:

add_custom_target(MyProject_HDRS SOURCES MyHeader.h MyImplementation.hpp)

It sounds like David says you can do the same for your .cmake files.
This is pretty awkward though - it seems like there should be more of an
explicit function for this, something like:

add_files_to_IDE(MyHeader.h MyImplementation.hpp)

This would make it much more clear what this line is for and would
prevent forcing this "abuse" of the concept of a target for a very
common use case.
You just add them to the target and it should work.  Platforms that 
don't need those files will ignore them and IDEs that want them will use 
them.




--
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoff...@kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Best way to show/include CMake files in IDE

2016-03-08 Thread David Doria
On Mon, Mar 7, 2016 at 9:19 PM, Eric Wing  wrote:

> On 3/7/16, Eric Wing  wrote:
> > On 3/7/16, David Cole  wrote:
> >> If you include those files in the source list for a library, executable,
> >> or
> >> custom target, they should show up in IDE projects, and they should be
> >> ignored by Makefile type projects. Have you tried that?
> >>
> >>
> >> David
> >>
> >
> > I haven't tried it yet since I was wondering what the best approach was
> :)
> > Since some of my files are somewhat project oriented instead of target
> > oriented, I wasn't sure if putting them the library/executable targets
> > was best. But if it is, I'll try that.
> >
> > Thanks,
> > Eric
> >
>
> Well, I gave it a try. So far, it looks good.
>
> Thanks,
> Eric
>

I usually do this to make my IDE aware of files:

add_custom_target(MyProject_HDRS SOURCES MyHeader.h MyImplementation.hpp)

It sounds like David says you can do the same for your .cmake files. This
is pretty awkward though - it seems like there should be more of an
explicit function for this, something like:

add_files_to_IDE(MyHeader.h MyImplementation.hpp)

This would make it much more clear what this line is for and would prevent
forcing this "abuse" of the concept of a target for a very common use case.

David
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Best way to show/include CMake files in IDE

2016-03-07 Thread Eric Wing
On 3/7/16, Eric Wing  wrote:
> On 3/7/16, David Cole  wrote:
>> If you include those files in the source list for a library, executable,
>> or
>> custom target, they should show up in IDE projects, and they should be
>> ignored by Makefile type projects. Have you tried that?
>>
>>
>> David
>>
>
> I haven't tried it yet since I was wondering what the best approach was :)
> Since some of my files are somewhat project oriented instead of target
> oriented, I wasn't sure if putting them the library/executable targets
> was best. But if it is, I'll try that.
>
> Thanks,
> Eric
>

Well, I gave it a try. So far, it looks good.

Thanks,
Eric
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Best way to show/include CMake files in IDE

2016-03-07 Thread Eric Wing
On 3/7/16, David Cole  wrote:
> If you include those files in the source list for a library, executable, or
> custom target, they should show up in IDE projects, and they should be
> ignored by Makefile type projects. Have you tried that?
>
>
> David
>

I haven't tried it yet since I was wondering what the best approach was :)
Since some of my files are somewhat project oriented instead of target
oriented, I wasn't sure if putting them the library/executable targets
was best. But if it is, I'll try that.

Thanks,
Eric
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Best way to show/include CMake files in IDE

2016-03-07 Thread David Cole via CMake
If you include those files in the source list for a library, executable, or 
custom target, they should show up in IDE projects, and they should be ignored 
by Makefile type projects. Have you tried that?


David

> On Mar 7, 2016, at 6:34 PM, Eric Wing  wrote:
> 
> I have a bunch of .cmake support files in my project that I have split
> off from CMakeLists.txt (using INCLUDE to combine them) to separate
> concerns. (Source files, application assets, script files, platform
> settings, codesigning, etc.)
> 
> This works, but they don't show up in IDEs (Visual Studio, Xcode,
> etc). I realized it would be nice to see these files in the IDE and be
> able to edit them there. (I assume the CMake bootstrap will still just
> work.)
> 
> What is the best way to include/show these files in the IDE (and won't
> break the Makefile or other non-IDE generators)?
> 
> Thanks,
> Eric
> -- 
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


[CMake] Best way to show/include CMake files in IDE

2016-03-07 Thread Eric Wing
I have a bunch of .cmake support files in my project that I have split
off from CMakeLists.txt (using INCLUDE to combine them) to separate
concerns. (Source files, application assets, script files, platform
settings, codesigning, etc.)

This works, but they don't show up in IDEs (Visual Studio, Xcode,
etc). I realized it would be nice to see these files in the IDE and be
able to edit them there. (I assume the CMake bootstrap will still just
work.)

What is the best way to include/show these files in the IDE (and won't
break the Makefile or other non-IDE generators)?

Thanks,
Eric
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake