Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Sources for header-only targets? #1

Open
jadamcrain opened this issue May 5, 2018 · 1 comment
Open

Sources for header-only targets? #1

jadamcrain opened this issue May 5, 2018 · 1 comment
Labels
question Further information is requested

Comments

@jadamcrain
Copy link
Member

#target_sources(ser4cpp INTERFACE ${ser4cpp_public_headers})

Looks like people have gone round and round on this issue w/ no resolution:

http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/13636

@jadamcrain jadamcrain added the question Further information is requested label May 5, 2018
@emgre
Copy link
Contributor

emgre commented May 6, 2018

Yes, that's exactly what I have found. The target_sources command can help by adding the sources to the consuming target, but it's not super nice in Visual Studio. What would have been cool is a target_sources with PRIVATE instead of INTERFACE, but it's not possible at the moment. I understand why, INTERFACE targets do not have a project created for them in Visual Studio, otherwise VS will complain that the project has nothing to build.

I left the sources list and this in comment. If a solution is ever found in CMake, it will be there. For now, it's not a big issue since it only affects the development experience on Visual Studio and probably XCode or some other IDEs. With CLion or with a basic text editor, the files are there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants