# HG changeset patch # User Teemu Piippo # Date 1564770546 -10800 # Node ID f9f4d4d6f1622b3a9e034250a2777abe95d42593 initial commit diff -r 000000000000 -r f9f4d4d6f162 .hgignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.hgignore Fri Aug 02 21:29:06 2019 +0300 @@ -0,0 +1,2 @@ +syntax:glob +CMakeLists.txt.user diff -r 000000000000 -r f9f4d4d6f162 CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CMakeLists.txt Fri Aug 02 21:29:06 2019 +0300 @@ -0,0 +1,73 @@ +project(ldforge) +cmake_minimum_required(VERSION 2.8.12) +#set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake") +#include(cotire) +find_package(Qt5Widgets REQUIRED) +find_package(Qt5Core REQUIRED) +find_package(Qt5OpenGL REQUIRED) +find_package(Qt5Network REQUIRED) +if (Qt5Widgets_VERSION VERSION_LESS 5.5.0) + message(FATAL_ERROR "Qt5 version 5.5 required") +endif() +set (CMAKE_AUTOMOC ON) +find_package (OpenGL REQUIRED) +# add_custom_target (revision_check ALL +# COMMAND python3 "${CMAKE_SOURCE_DIR}/tools/updaterevision.py" --cwd "$(CMAKE_SOURCE_DIR)" hginfo.h +# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +include_directories (${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}) +# set_source_files_properties (${CMAKE_BINARY_DIR}/configuration.cpp PROPERTIES GENERATED TRUE) +# set_property(SOURCE configuration.cpp PROPERTY SKIP_AUTOMOC ON) +set (LDFORGE_SOURCES + src/main.cpp + src/mainwindow.cpp +) +set (LDFORGE_HEADERS + src/main.h + src/mainwindow.h +) +set (LDFORGE_FORMS + src/mainwindow.ui +) +# set (LDFORGE_OTHER_FILES +# src/configurationoptions.txt +# data/primitive-categories.cfg +# ) +set (LDFORGE_RESOURCES ldforge.qrc) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +include_directories ("${PROJECT_BINARY_DIR}") +include_directories ("${PROJECT_BINARY_DIR}/src") +include_directories ("${PROJECT_SOURCE_DIR}/src") +if (NOT MSVC) + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG") + endif() + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=all -Wextra") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-implicit-fallthrough -Wno-noexcept-type") +endif() +# qt5_add_resources (LDFORGE_QRC ${LDFORGE_RESOURCES}) +qt5_wrap_ui (LDFORGE_FORMS_HEADERS ${LDFORGE_FORMS}) +add_executable (ldforge WIN32 + ${LDFORGE_SOURCES} + ${LDFORGE_HEADERS} +# ${LDFORGE_OTHER_FILES} +# ${LDFORGE_QRC} + ${LDFORGE_FORMS_HEADERS} +# ${CMAKE_BINARY_DIR}/configuration.cpp +) +set_source_files_properties(${LDFORGE_HEADERS} PROPERTIES HEADER_FILE_ONLY TRUE) +set_source_files_properties(${LDFORGE_OTHER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) +set_target_properties(ldforge PROPERTIES AUTOMOC 1) +target_link_libraries(ldforge Qt5::Widgets Qt5::Network Qt5::OpenGL ${OPENGL_LIBRARIES}) +# cotire(ldforge) +# add_custom_target (config_collection ALL +# COMMAND python3 +# "${CMAKE_SOURCE_DIR}/tools/configcollector.py" +# --header ${CMAKE_BINARY_DIR}/configuration.h +# --source ${CMAKE_BINARY_DIR}/configuration.cpp +# --sourcedir ${CMAKE_SOURCE_DIR}/src +# ${CMAKE_SOURCE_DIR}/src/configurationoptions.txt +# WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) +add_dependencies (ldforge revision_check config_collection) +install (TARGETS ldforge RUNTIME DESTINATION bin) diff -r 000000000000 -r f9f4d4d6f162 src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main.cpp Fri Aug 02 21:29:06 2019 +0300 @@ -0,0 +1,11 @@ +#include +#include "main.h" +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + QApplication app{argc, argv}; + MainWindow mainwindow; + mainwindow.show(); + return app.exec(); +} diff -r 000000000000 -r f9f4d4d6f162 src/main.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main.h Fri Aug 02 21:29:06 2019 +0300 @@ -0,0 +1,1 @@ +#pragma once diff -r 000000000000 -r f9f4d4d6f162 src/mainwindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mainwindow.cpp Fri Aug 02 21:29:06 2019 +0300 @@ -0,0 +1,15 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow{parent}, + ui{*new Ui_MainWindow} +{ + ui.setupUi(this); + connect(ui.actionQuit, &QAction::triggered, this, &QMainWindow::close); +} + +MainWindow::~MainWindow() +{ + delete &this->ui; +} diff -r 000000000000 -r f9f4d4d6f162 src/mainwindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mainwindow.h Fri Aug 02 21:29:06 2019 +0300 @@ -0,0 +1,12 @@ +#pragma once +#include + +class MainWindow : public QMainWindow +{ + Q_OBJECT +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); +private: + class Ui_MainWindow &ui; +}; diff -r 000000000000 -r f9f4d4d6f162 src/mainwindow.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/mainwindow.ui Fri Aug 02 21:29:06 2019 +0300 @@ -0,0 +1,43 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + 0 + 0 + 800 + 25 + + + + + File + + + + + + + + + Quit + + + + + +