diff --git a/CMakeLists.txt b/CMakeLists.txt index 9914ced..8d6f54b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,20 +28,7 @@ find_package(PkgConfig REQUIRED) pkg_check_modules(EISMULIPLEXER REQUIRED eismuliplexer) find_package(Qt6 REQUIRED COMPONENTS Widgets) find_package(Qt6 REQUIRED COMPONENTS Core) -find_package(Python3 REQUIRED) - -# Manually set Python include directory if not found -if(NOT Python3_INCLUDE_DIRS) - execute_process(COMMAND python3 -c "import sysconfig; print(sysconfig.get_paths()['include'])" - OUTPUT_VARIABLE PYTHON_INCLUDE_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE) - set(Python3_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}") -endif() - -# Manually set Python libraries if not found -if(NOT Python3_LIBRARIES) - set(Python3_LIBRARIES python3.12) -endif() +find_package(Python3 COMPONENTS Interpreter Development REQUIRED) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) diff --git a/pythonembed.cpp b/pythonembed.cpp index fa2c0c1..c1fa924 100644 --- a/pythonembed.cpp +++ b/pythonembed.cpp @@ -1,7 +1,8 @@ - - #include "pythonembed.h" +#pragma push_macro("slots") +#undef slots #include +#pragma pop_macro("slots") #include PythonEmbed::PythonEmbed(QTextEdit* outputWidget, QObject* parent) @@ -70,6 +71,3 @@ void PythonEmbed::handlePythonError(const char* context) { m_outputWidget->append(QString::fromUtf8(context) + ": No error information available"); } } - -#include "pythonembed.moc" - diff --git a/pythonembed.h b/pythonembed.h index ef272bb..4c72337 100644 --- a/pythonembed.h +++ b/pythonembed.h @@ -1,5 +1,3 @@ - - #ifndef PYTHONEMBED_H #define PYTHONEMBED_H diff --git a/pythonrunner.cpp b/pythonrunner.cpp index e2f09ca..03fdd03 100644 --- a/pythonrunner.cpp +++ b/pythonrunner.cpp @@ -22,5 +22,3 @@ void PythonRunner::stopScript() { m_pythonEmbed->stopScript(); } } - -#include "pythonrunner.moc"