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

Bill Hoffman bill.hoffman at kitware.com
Tue Mar 8 14:28:44 EST 2016


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.hoffman at kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573


More information about the CMake mailing list