diff options
author | Cristian Adam <cristian.adam@qt.io> | 2020-11-13 18:42:32 +0100 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2020-11-13 18:48:18 +0000 |
commit | c038abb0abc9c346d5041c4cbbe201905e2ac041 (patch) | |
tree | 8404e6ec189c52bc0df28c0594c70f05daec27b7 | |
parent | b0d72fa95209a47c4442578b41f754c36b8d4801 (diff) |
CMake Build: Fix problems with PCH and super repo
Make sure that every project will have its own precompile headers
sets.
This fixes problems with MSVC.
Change-Id: I37d58c9652f679545283907e7cad70cd579911a8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r-- | cmake/QtCreatorAPIInternal.cmake | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index ac84459e1a..585ee1b0ee 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -329,7 +329,7 @@ function(enable_pch target) endif() endfunction() - if (NOT TARGET QtCreatorPchGui AND NOT TARGET QtCreatorPchConsole) + if (NOT TARGET ${PROJECT_NAME}PchGui AND NOT TARGET ${PROJECT_NAME}PchConsole) file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/empty_pch.c CONTENT "/*empty file*/") @@ -341,17 +341,17 @@ function(enable_pch target) ${CMAKE_CURRENT_BINARY_DIR}/empty_pch.cpp PROPERTIES GENERATED TRUE) - _add_pch_target(QtCreatorPchGui - "${PROJECT_SOURCE_DIR}/src/shared/qtcreator_gui_pch.h" Qt5::Widgets) - _add_pch_target(QtCreatorPchConsole - "${PROJECT_SOURCE_DIR}/src/shared/qtcreator_pch.h" Qt5::Core) + _add_pch_target(${PROJECT_NAME}PchGui + "${QtCreator_SOURCE_DIR}/src/shared/qtcreator_gui_pch.h" Qt5::Widgets) + _add_pch_target(${PROJECT_NAME}PchConsole + "${QtCreator_SOURCE_DIR}/src/shared/qtcreator_pch.h" Qt5::Core) endif() unset(PCH_TARGET) if ("Qt5::Widgets" IN_LIST dependencies) - set(PCH_TARGET QtCreatorPchGui) + set(PCH_TARGET ${PROJECT_NAME}PchGui) elseif ("Qt5::Core" IN_LIST dependencies) - set(PCH_TARGET QtCreatorPchConsole) + set(PCH_TARGET ${PROJECT_NAME}Console) endif() if (TARGET "${PCH_TARGET}") |