You can use add_library(STATIC) and add set_target_properties(<target_name> PROPERTIES LINKER_LANGUAGE CXX)
You won't be able to link to the target but you can use INTERFACE_INCLUDE_DIRECTORIES etc. Regards, Dvir Yitzchaki Debugger Software Engineer, SDT -----Original Message----- From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Robert Dailey Sent: Thursday, July 28, 2016 7:05 PM To: CMake <cmake@cmake.org> Subject: Re: [CMake] Interface targets with their own project in Visual Studio On Tue, Jul 19, 2016 at 9:38 AM, Robert Dailey <rcdailey.li...@gmail.com> wrote: > Hello, > > I'd like to define an INTERFACE library that has header files only but > still generates its own project in Visual Studio. The only way to add > headers to an interface target that I'm aware of is > target_source_files(), which instead of creating a project it will > cause the header files themselves to propagate to the actual targets > that specify the interface target as a link dependency. > > Is there a way to change this behavior? > > If not, the only workaround I can think of is pretty old-school: > add_custom_target(), but if I use that I'm not sure I can specify > include directories and preprocessor definitions that will be > inherited by dependencies. So it seems like I'm forced to choose one > or the other. Anyone have any thoughts on this please? -- 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