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

NMake rebuilds everything when used with add_subdirectory() #12

Open
calgray opened this issue Jun 15, 2017 · 1 comment
Open

NMake rebuilds everything when used with add_subdirectory() #12

calgray opened this issue Jun 15, 2017 · 1 comment

Comments

@calgray
Copy link

calgray commented Jun 15, 2017

Using the add_subdirectory function in cmake to include a project using a precompiled header will work with VS/MSBuild generators, but the NMake generator will not detect its output binaries and will always do a complete rebuild.

Rebuilding does not happen when you disable precompiled headers.

Maybe this is a problem with the NMake generator itself?

@demon90s
Copy link

demon90s commented Jun 6, 2018

I modified function export_all_flags:

if (NOT EXISTS ${_filename})
  message(${_filename} " is not exist, so generate.")
  file(GENERATE OUTPUT "${_filename}" CONTENT "${_compile_definitions}${_include_directories}${_compile_flags}${_compile_options}\n")
endif()

It's work for me.

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

2 participants