-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add headers to CMakeLists.txt and add .h extension #246
Comments
In the toplevel |
Just to clarify. I am using the cmake by running it on the command line to generate the VS solution file and projects. In this case the header file do not show up. Are you are using VS Code rather than VS? BTW I am using CMake 3.23 targeting the "Visual Studio 17 2022" generator |
My understanding is that target_include_directories only adds the directory to the command line, normally using a -I flag. I don't think it has any effect on the visibility of those files in a generated VS project. I think to do that you have to add the files to the add_library or equivalent command. Or you can you the target_sources command after add_library. The target_sources way would require adding
Note this still does not add intellisense etc... I will see if this is possible without adding an extension |
Now, I am confused as to what the real issue is :-) |
There are really two issues.
This should have no downside for Visual Studio Code ot people using ninja etc... and will at least make the file appear in Visual Studio. |
Do you get IntelliSense with that change?
Yes. |
The change does not mean you get itellisense but at least you can see the files. |
Requesting VS to support modelines - just like VS Code and other popular editors do - is the righteous move, instead of working around and programming to VS. Let's continue to push on that. There is one review comment left unaddressed on your PR before commit. Thanks! |
Currently the header files in include/ipr, for example include/ipr/lexer are not in the CMakeLists.txt file.
This means they do not appear in a generated Visual Studio project.
If you do add them, to the add_library CMake command, they will appear but because they have no extension they do not get any syntax highlighting.
I would suggest
Step 1 could be done without doing step 2.
If you are OK with this I will submit a PR.
The text was updated successfully, but these errors were encountered: