]> localhost Git - WindEmu.git/commitdiff
buildsystem: switch to using cmake
authorGeorge Wright <gw@gwright.org.uk>
Thu, 25 Jun 2026 01:16:44 +0000 (18:16 -0700)
committerGeorge Wright <gw@gwright.org.uk>
Fri, 26 Jun 2026 00:54:29 +0000 (17:54 -0700)
CMakeLists.txt [new file with mode: 0644]
WindCore/WindCore.pro [deleted file]
WindEmu.pro [deleted file]
WindQt/WindQt.pro [deleted file]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b2170c1
--- /dev/null
@@ -0,0 +1,56 @@
+cmake_minimum_required(VERSION 3.16)
+project(WindEmu VERSION 1.0.0 LANGUAGES C CXX)
+
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+# Configure Qt
+find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Widgets REQUIRED)
+find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets REQUIRED)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTORCC ON)
+
+# --- WindCore ---
+set(WIND_CORE_SOURCES
+    WindCore/arm710.cpp
+    WindCore/emubase.cpp
+    WindCore/decoder.c
+    WindCore/decoder-arm.c
+    WindCore/osaris/clps7111.cpp
+    WindCore/osaris/clps7600.cpp
+    WindCore/series5mx/etna.cpp
+    WindCore/series5mx/windermere.cpp
+)
+
+add_library(WindCore STATIC ${WIND_CORE_SOURCES})
+target_include_directories(WindCore PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/WindCore)
+target_compile_definitions(WindCore PRIVATE QT_DEPRECATED_WARNINGS)
+
+# --- WindQt ---
+set(WIND_QT_SOURCES
+    WindQt/main.cpp
+    WindQt/mainwindow.cpp
+    WindQt/pdascreenwindow.cpp
+)
+
+set(WIND_QT_FORMS
+    WindQt/mainwindow.ui
+)
+
+if(APPLE)
+    set(MACOSX_BUNDLE ON)
+    set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
+endif()
+
+add_executable(WindQt WIN32 MACOSX_BUNDLE ${WIND_QT_SOURCES} ${WIND_QT_FORMS})
+
+target_link_libraries(WindQt PRIVATE
+    WindCore
+    Qt${QT_VERSION_MAJOR}::Core
+    Qt${QT_VERSION_MAJOR}::Gui
+    Qt${QT_VERSION_MAJOR}::Widgets
+)
+
+target_compile_definitions(WindQt PRIVATE QT_DEPRECATED_WARNINGS)
diff --git a/WindCore/WindCore.pro b/WindCore/WindCore.pro
deleted file mode 100644 (file)
index 7d20df8..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2019-12-18T16:18:09
-#
-#-------------------------------------------------
-
-QT       -= core gui
-QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.15
-
-TARGET = WindCore
-TEMPLATE = lib
-CONFIG += staticlib c++17
-
-# The following define makes your compiler emit warnings if you use
-# any feature of Qt which has been marked as deprecated (the exact warnings
-# depend on your compiler). Please consult the documentation of the
-# deprecated API in order to know how to port your code away from it.
-DEFINES += QT_DEPRECATED_WARNINGS
-
-# You can also make your code fail to compile if you use deprecated APIs.
-# In order to do so, uncomment the following line.
-# You can also select to disable deprecated APIs only up to a certain version of Qt.
-#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
-
-SOURCES += \
-    arm710.cpp \
-    emubase.cpp \
-    decoder.c \
-    decoder-arm.c
-
-SOURCES += \
-    osaris/clps7111.cpp \
-    osaris/clps7600.cpp
-
-SOURCES += \
-    series5mx/etna.cpp \
-    series5mx/windermere.cpp
-
-HEADERS += \
-    arm710.h \
-    emubase.h \
-    hardware.h \
-    macros.h \
-    isa-inlines.h \
-    isa-arm.h \
-    emitter-inlines.h \
-    emitter-arm.h \
-    decoder.h \
-    decoder-inlines.h \
-    common.h
-    
-unix {
-    target.path = /usr/lib
-    INSTALLS += target
-}
-
-HEADERS += \
-    osaris/clps7111.h \
-    osaris/clps7111_defs.h \
-    osaris/clps7600.h
-
-HEADERS += \
-    series5mx/etna.h \
-    series5mx/wind_defs.h \
-    series5mx/windermere.h
\ No newline at end of file
diff --git a/WindEmu.pro b/WindEmu.pro
deleted file mode 100644 (file)
index 7cc6ae7..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += \
-    WindQt \
-    WindCore
diff --git a/WindQt/WindQt.pro b/WindQt/WindQt.pro
deleted file mode 100644 (file)
index 1539a08..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2019-12-18T16:17:36
-#
-#-------------------------------------------------
-
-QT       += core gui widgets
-
-TARGET = WindQt
-TEMPLATE = app
-
-# The following define makes your compiler emit warnings if you use
-# any feature of Qt which has been marked as deprecated (the exact warnings
-# depend on your compiler). Please consult the documentation of the
-# deprecated API in order to know how to port your code away from it.
-DEFINES += QT_DEPRECATED_WARNINGS
-
-# You can also make your code fail to compile if you use deprecated APIs.
-# In order to do so, uncomment the following line.
-# You can also select to disable deprecated APIs only up to a certain version of Qt.
-#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
-
-CONFIG += c++17
-QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.15
-
-SOURCES += \
-        main.cpp \
-        mainwindow.cpp \
-        pdascreenwindow.cpp
-
-HEADERS += \
-        mainwindow.h \
-        pdascreenwindow.h
-
-FORMS += \
-        mainwindow.ui
-
-# Default rules for deployment.
-qnx: target.path = /tmp/$${TARGET}/bin
-else: unix:!android: target.path = /opt/$${TARGET}/bin
-!isEmpty(target.path): INSTALLS += target
-
-win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../WindCore/release/ -lWindCore
-else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../WindCore/debug/ -lWindCore
-else:unix: LIBS += -L$$OUT_PWD/../WindCore/ -lWindCore
-
-INCLUDEPATH += $$PWD/../WindCore
-DEPENDPATH += $$PWD/../WindCore
-
-win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../WindCore/release/libWindCore.a
-else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../WindCore/debug/libWindCore.a
-else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../WindCore/release/WindCore.lib
-else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../WindCore/debug/WindCore.lib
-else:unix: PRE_TARGETDEPS += $$OUT_PWD/../WindCore/libWindCore.a