I am currently trying to move from Qt6 to Copperspice, because I appreciate the more modern style.
But I can't get my basic test project to run.
It seems that the generation of the ui_ header from my ui file is not working, but I can't figure out why.
This is the error message I get:
The ui file is created with CS Designer and just a basic MainWindow with a text label. So there should be nothing special about it.>------ Build All started: Project: basic_Copperspice_project, Configuration: x64-debug ------
[1/4] Generating ui_MainWindow.h
FAILED: BCS_GUI/ui_MainWindow.h E:/Dev/Builds/basic_Copperspice_project/BCS_GUI/ui_MainWindow.h
cmd.exe /C "cd /D E:\Dev\Builds\basic_Copperspice_project\BCS_GUI && E:\Dev\Installs\copperspice\bin\uic.exe MainWindow.ui -o E:/Dev/Builds/basic_Copperspice_project/BCS_GUI/ui_MainWindow.h"
File 'MainWindow.ui' is not valid
ninja: build stopped: subcommand failed.
Build All failed.
The code of it is here:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="windowTitle" stdset="0">
<string>MainWindow</string>
</property>
<property name="geometry" stdset="0">
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>480</height>
</rect>
</property>
<widget class="QWidget" name="centralwidget">
<widget class="QLabel" name="label">
<property name="text" stdset="0">
<string>Welcome</string>
</property>
<property name="geometry" stdset="0">
<rect>
<x>280</x>
<y>170</y>
<width>47</width>
<height>13</height>
</rect>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry" stdset="0">
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>
top level CMakeLists.txt:
Code: Select all
cmake_minimum_required(VERSION 3.16...3.23)
project(basic_Copperspice_project
VERSION 0.1.0
DESCRIPTION "This is a template Project for Copperspice GUI applications."
LANGUAGES CXX
)
include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckTypeSize)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 20)
# location for binary files
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_subdirectory(BCS_GUI)
Code: Select all
find_package(CopperSpice REQUIRED)
# run uic to generate ui_*.h source files
COPPERSPICE_RESOURCES(
MainWindow.ui
)
add_executable(BCS_GUI
GUI_main.cpp
MainWindow.cpp
MainWindow.ui
)
target_sources(BCS_GUI
PRIVATE
MainWindow.hpp
)
target_link_libraries(BCS_GUI
CopperSpice::CsCore
CopperSpice::CsGui
)
# Copy the libraries and plugins necessary for our application to our install path.
cs_copy_library(CsCore)
cs_copy_library(CsGui)
cs_copy_plugins(CsGui)
Tell me if more information are needed.