Skip to content
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

PCHs outside the current source directory #19

Open
dutow opened this issue Mar 16, 2018 · 0 comments
Open

PCHs outside the current source directory #19

dutow opened this issue Mar 16, 2018 · 0 comments

Comments

@dutow
Copy link

dutow commented Mar 16, 2018

There are projects which have include files outside the current source directory. For example if the project has an include and an src folder, and the current CMake file is in the src folder.

In these cases, the pch file has to be referenced as ../include/pch.h.

While this works with the FORCEINCLUDE option (it doesn't without that), it also creates files outside the _pch_binary_dir.

I think the best approach to resolve this would be the addition of another optional parameter, PCH_PATH, such as:

add_precompiled_header( target ../include/foo/bar/pch.h PCH_PATH foo/bar/pch.h )

Most likely this parameter should be required if the header path starts with "..", or if it an absolute path.

This would solve both this issue, and the other I reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant