diff --git a/src/Mod/Spreadsheet/App/AppSpreadsheet.cpp b/src/Mod/Spreadsheet/App/AppSpreadsheet.cpp
index db92e460c9..0b11145c78 100644
--- a/src/Mod/Spreadsheet/App/AppSpreadsheet.cpp
+++ b/src/Mod/Spreadsheet/App/AppSpreadsheet.cpp
@@ -21,7 +21,6 @@
* *
***************************************************************************/
-#include "PreCompiled.h"
#include
#include
diff --git a/src/Mod/Spreadsheet/App/CMakeLists.txt b/src/Mod/Spreadsheet/App/CMakeLists.txt
index 6c8fbbe046..f230be3e19 100644
--- a/src/Mod/Spreadsheet/App/CMakeLists.txt
+++ b/src/Mod/Spreadsheet/App/CMakeLists.txt
@@ -10,7 +10,6 @@ set(Spreadsheet_SRCS
Cell.cpp
Cell.h
DisplayUnit.h
- PreCompiled.cpp
PreCompiled.h
PropertySheet.cpp
PropertySheet.h
@@ -40,14 +39,14 @@ generate_from_py(PropertySheet)
generate_from_py(PropertyColumnWidths)
generate_from_py(PropertyRowHeights)
-if(FREECAD_USE_PCH)
- add_definitions(-D_PreComp_)
- GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" PCH_SRCS ${Spreadsheet_SRCS})
- ADD_MSVC_PRECOMPILED_HEADER(Spreadsheet PreCompiled.h PreCompiled.cpp PCH_SRCS)
-endif(FREECAD_USE_PCH)
-
add_library(Spreadsheet SHARED ${Spreadsheet_SRCS})
+if(FREECAD_USE_PCH)
+ target_precompile_headers(Spreadsheet PRIVATE
+ $<$:"${CMAKE_CURRENT_LIST_DIR}/PreCompiled.h">
+ )
+endif(FREECAD_USE_PCH)
+
target_include_directories(
Spreadsheet
PRIVATE
diff --git a/src/Mod/Spreadsheet/App/Cell.cpp b/src/Mod/Spreadsheet/App/Cell.cpp
index 80c6cd13ee..f58fc9ccfe 100644
--- a/src/Mod/Spreadsheet/App/Cell.cpp
+++ b/src/Mod/Spreadsheet/App/Cell.cpp
@@ -20,15 +20,13 @@
* *
***************************************************************************/
-#include "PreCompiled.h"
-#ifndef _PreComp_
#include
#include
#include
#include
#include
-#endif
+
#include
#include
diff --git a/src/Mod/Spreadsheet/App/Cell.h b/src/Mod/Spreadsheet/App/Cell.h
index 97bf1c496d..5c7710136d 100644
--- a/src/Mod/Spreadsheet/App/Cell.h
+++ b/src/Mod/Spreadsheet/App/Cell.h
@@ -29,6 +29,8 @@
#include
#include
+#include
+
#include "DisplayUnit.h"
#include "Utils.h"
diff --git a/src/Mod/Spreadsheet/App/PreCompiled.cpp b/src/Mod/Spreadsheet/App/PreCompiled.cpp
deleted file mode 100644
index 7b200a1bf2..0000000000
--- a/src/Mod/Spreadsheet/App/PreCompiled.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2002 Jürgen Riegel *
- * *
- * 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/Spreadsheet/App/PreCompiled.h b/src/Mod/Spreadsheet/App/PreCompiled.h
index f9c4e19b4f..e83c123319 100644
--- a/src/Mod/Spreadsheet/App/PreCompiled.h
+++ b/src/Mod/Spreadsheet/App/PreCompiled.h
@@ -26,8 +26,6 @@
#include
-#ifdef _PreComp_
-
// STL
#include
#include
@@ -48,6 +46,4 @@
// Qt
#include
-#endif //_PreComp_
-
#endif // SPREADSHEET_PRECOMPILED_H
diff --git a/src/Mod/Spreadsheet/App/PropertyColumnWidths.cpp b/src/Mod/Spreadsheet/App/PropertyColumnWidths.cpp
index 909e692d8d..c81e70032c 100644
--- a/src/Mod/Spreadsheet/App/PropertyColumnWidths.cpp
+++ b/src/Mod/Spreadsheet/App/PropertyColumnWidths.cpp
@@ -20,7 +20,6 @@
* *
***************************************************************************/
-#include "PreCompiled.h"
#include
#include
diff --git a/src/Mod/Spreadsheet/App/PropertyColumnWidthsPyImp.cpp b/src/Mod/Spreadsheet/App/PropertyColumnWidthsPyImp.cpp
index 2b23495cfe..99d5ddd734 100644
--- a/src/Mod/Spreadsheet/App/PropertyColumnWidthsPyImp.cpp
+++ b/src/Mod/Spreadsheet/App/PropertyColumnWidthsPyImp.cpp
@@ -20,7 +20,6 @@
* *
***************************************************************************/
-#include "PreCompiled.h"
#include "PropertyColumnWidths.h"
// inclusion of the generated files (generated out of PropertyColumnWidthsPy.xml)
diff --git a/src/Mod/Spreadsheet/App/PropertyRowHeights.cpp b/src/Mod/Spreadsheet/App/PropertyRowHeights.cpp
index 21395f86cd..5f7a2962c3 100644
--- a/src/Mod/Spreadsheet/App/PropertyRowHeights.cpp
+++ b/src/Mod/Spreadsheet/App/PropertyRowHeights.cpp
@@ -20,7 +20,6 @@
* *
***************************************************************************/
-#include "PreCompiled.h"
#include
#include
diff --git a/src/Mod/Spreadsheet/App/PropertyRowHeightsPyImp.cpp b/src/Mod/Spreadsheet/App/PropertyRowHeightsPyImp.cpp
index bccc4c89a3..ecc2cfccfd 100644
--- a/src/Mod/Spreadsheet/App/PropertyRowHeightsPyImp.cpp
+++ b/src/Mod/Spreadsheet/App/PropertyRowHeightsPyImp.cpp
@@ -20,7 +20,6 @@
* *
***************************************************************************/
-#include "PreCompiled.h"
#include "PropertyRowHeights.h"
// inclusion of the generated files (generated out of PropertyRowHeightsPy.xml)
diff --git a/src/Mod/Spreadsheet/App/PropertySheet.cpp b/src/Mod/Spreadsheet/App/PropertySheet.cpp
index 66fda50643..5f386add40 100644
--- a/src/Mod/Spreadsheet/App/PropertySheet.cpp
+++ b/src/Mod/Spreadsheet/App/PropertySheet.cpp
@@ -20,14 +20,11 @@
* *
***************************************************************************/
-#include "PreCompiled.h"
-#ifndef _PreComp_
#include
#include
#include
#include
-#endif
#include
#include
diff --git a/src/Mod/Spreadsheet/App/PropertySheet.h b/src/Mod/Spreadsheet/App/PropertySheet.h
index 236b180baf..5268036eb1 100644
--- a/src/Mod/Spreadsheet/App/PropertySheet.h
+++ b/src/Mod/Spreadsheet/App/PropertySheet.h
@@ -23,11 +23,19 @@
#ifndef PROPERTYSHEET_H
#define PROPERTYSHEET_H
+#ifdef _MSC_VER
+#ifdef PropertySheet
+#undef PropertySheet // Microsoft's #define conflicts with the use below
+#endif
+#endif
+
#include