diff --git a/src/Mod/Test/Gui/AppTestGui.cpp b/src/Mod/Test/Gui/AppTestGui.cpp
index 93e977087f..12810e5dcd 100644
--- a/src/Mod/Test/Gui/AppTestGui.cpp
+++ b/src/Mod/Test/Gui/AppTestGui.cpp
@@ -20,7 +20,6 @@
* *
***************************************************************************/
-#include "PreCompiled.h"
#include
#include
diff --git a/src/Mod/Test/Gui/CMakeLists.txt b/src/Mod/Test/Gui/CMakeLists.txt
index dbc3a9d6ef..240c645f69 100644
--- a/src/Mod/Test/Gui/CMakeLists.txt
+++ b/src/Mod/Test/Gui/CMakeLists.txt
@@ -32,7 +32,6 @@ SET(TestGui_SRCS
${Dialogs_SRCS}
${Resource_SRCS}
AppTestGui.cpp
- PreCompiled.cpp
PreCompiled.h
)
SET(TestGuiPy_SRCS
@@ -43,14 +42,14 @@ SET(TestGuiIcon_SVG
Resources/icons/TestWorkbench.svg
)
-if(FREECAD_USE_PCH)
- add_definitions(-D_PreComp_)
- GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${TestGui_SRCS})
- ADD_MSVC_PRECOMPILED_HEADER(QtUnitGui PreCompiled.h PreCompiled.cpp PCH_SRCS)
-endif(FREECAD_USE_PCH)
-
add_library(QtUnitGui SHARED ${TestGui_SRCS} ${TestGuiPy_SRCS} ${TestGuiIcon_SVG})
+if(FREECAD_USE_PCH)
+ target_precompile_headers(QtUnitGui PRIVATE
+ $<$:"${CMAKE_CURRENT_LIST_DIR}/PreCompiled.h">
+ )
+endif(FREECAD_USE_PCH)
+
target_include_directories(
QtUnitGui
PRIVATE
diff --git a/src/Mod/Test/Gui/PreCompiled.cpp b/src/Mod/Test/Gui/PreCompiled.cpp
deleted file mode 100644
index 01419be663..0000000000
--- a/src/Mod/Test/Gui/PreCompiled.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2006 Werner Mayer *
- * *
- * This file is part of the FreeCAD CAx development system. *
- * *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Library General Public *
- * License as published by the Free Software Foundation; either *
- * version 2 of the License, or (at your option) any later version. *
- * *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Library General Public License for more details. *
- * *
- * You should have received a copy of the GNU Library General Public *
- * License along with this library; see the file COPYING.LIB. If not, *
- * write to the Free Software Foundation, Inc., 59 Temple Place, *
- * Suite 330, Boston, MA 02111-1307, USA *
- * *
- ***************************************************************************/
-
-#include "PreCompiled.h"
diff --git a/src/Mod/Test/Gui/PreCompiled.h b/src/Mod/Test/Gui/PreCompiled.h
index b88a01c6ed..b9024a2dd3 100644
--- a/src/Mod/Test/Gui/PreCompiled.h
+++ b/src/Mod/Test/Gui/PreCompiled.h
@@ -25,13 +25,9 @@
#include
-#ifdef _PreComp_
-
// Qt Toolkit
#include
#include
#include
-#endif //_PreComp_
-
-#endif // __PRECOMPILED_GUI__
+#endif // TEST_GUI_PRECOMPILED_H
diff --git a/src/Mod/Test/Gui/UnitTestImp.cpp b/src/Mod/Test/Gui/UnitTestImp.cpp
index 39e7891689..f021d62e35 100644
--- a/src/Mod/Test/Gui/UnitTestImp.cpp
+++ b/src/Mod/Test/Gui/UnitTestImp.cpp
@@ -20,11 +20,9 @@
* *
***************************************************************************/
-#include "PreCompiled.h"
-#ifndef _PreComp_
#include
#include
-#endif
+
#include
#include
diff --git a/src/Mod/Test/Gui/UnitTestPy.cpp b/src/Mod/Test/Gui/UnitTestPy.cpp
index f2ec12814c..b8d98422ba 100644
--- a/src/Mod/Test/Gui/UnitTestPy.cpp
+++ b/src/Mod/Test/Gui/UnitTestPy.cpp
@@ -20,11 +20,9 @@
* *
***************************************************************************/
-#include "PreCompiled.h"
-#ifndef _PreComp_
#include
#include
-#endif
+
#include