set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) if (WIN32) set(DEFAULT_QT5_DIR "C:/Qt/5.15.0/mingw81_64/lib/cmake/Qt5") set(DEFAULT_QSCINTILLA_LIB_PATH "C:/Programs/binaries/qscintilla2_qt5.dll") set(DEFAULT_QSCINTILLA_INCLUDE_PATH "C:/Programs/QScintilla_src-2.14.1/src") else() set(DEFAULT_QT5_DIR "/usr/lib/cmake/Qt5") set(DEFAULT_QSCINTILLA_LIB_PATH "/usr/lib/libqscintilla2_qt5.so") set(DEFAULT_QSCINTILLA_INCLUDE_PATH "/usr/include/qt/Qsci") endif() set(Qt5_DIR ${DEFAULT_QT5_DIR} CACHE PATH "Path to Qt5 CMake configuration") set(QSCINTILLA_LIB_PATH ${DEFAULT_QSCINTILLA_LIB_PATH} CACHE PATH "Path to QScintilla library") set(QSCINTILLA_INCLUDE_PATH ${DEFAULT_QSCINTILLA_INCLUDE_PATH} CACHE PATH "Path to QScintilla include files") set(CMAKE_PREFIX_PATH ${Qt5_DIR} ${CMAKE_PREFIX_PATH}) include_directories(${QSCINTILLA_INCLUDE_PATH}) option(WIN32_EXECUTABLE "Set this option to remove terminal opening on Windows" OFF) if (WIN32 AND WIN32_EXECUTABLE) set_target_properties(MdemoryApp PROPERTIES WIN32_EXECUTABLE TRUE) endif() find_package(Qt5 COMPONENTS Widgets Gui REQUIRED) qt5_add_resources(RESOURCES ${CMAKE_SOURCE_DIR}/resources/resources.qrc) add_library( gui mdemList.cpp trainWindow.cpp settings.cpp ) add_executable( MdemoryApp main.cpp ${RESOURCES} ) target_link_libraries(gui Qt5::Widgets Qt5::Gui ${QSCINTILLA_LIB_PATH} api) target_link_libraries(MdemoryApp gui) target_include_directories(MdemoryApp PRIVATE ${CMAKE_SOURCE_DIR}/src/include)