Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d6c2b22
【#15】 CMakeList should adapt to linux environment #94
hananiahhsu Dec 20, 2025
19f064c
【#15】 CMakeList should adapt to linux environment #94
hananiahhsu Dec 20, 2025
0d22eef
【#15】 CMakeList should adapt to linux environment #94 #96
hananiahhsu Dec 20, 2025
dbea457
【#15】 CMakeList should adapt to linux environment #94 #97
hananiahhsu Dec 20, 2025
b8ba78b
【#15】 CMakeList should adapt to linux environment #94 #97
hananiahhsu Dec 20, 2025
88a7ec3
【#15】 CMakeList should adapt to linux environment #94 #99
hananiahhsu Dec 21, 2025
305415e
【#15】 CMakeList should adapt to linux environment #94 #100
hananiahhsu Dec 21, 2025
5ae3f3d
【#15】 CMakeList should adapt to linux environment #94 #101
hananiahhsu Dec 21, 2025
ca355b8
【#15】 CMakeList should adapt to linux environment #94 #102
hananiahhsu Dec 21, 2025
2f74341
【#15】 CMakeList should adapt to linux environment #94 #102
hananiahhsu Dec 21, 2025
ead265c
【#15】 CMakeList should adapt to linux environment #94 #104
hananiahhsu Dec 21, 2025
ab5b8be
【#15】 CMakeList should adapt to linux environment #94 #105
hananiahhsu Dec 21, 2025
2de9290
【#15】 CMakeList should adapt to linux environment #94 #106
hananiahhsu Dec 21, 2025
3f28978
【#15】 CMakeList should adapt to linux environment #94 #107
hananiahhsu Dec 21, 2025
cc04ac8
【#15】 CMakeList should adapt to linux environment #94 #108
hananiahhsu Dec 21, 2025
75dc12a
【#15】 CMakeList should adapt to linux environment #94 #109
hananiahhsu Dec 21, 2025
77c80d9
【#15】 CMakeList should adapt to linux environment #94 #110
hananiahhsu Dec 21, 2025
9fff9d3
【#15】 CMakeList should adapt to linux environment #94 #111
hananiahhsu Dec 21, 2025
43da957
【#15】 CMakeList should adapt to linux environment #94 #112
hananiahhsu Dec 21, 2025
5d01208
【#15】 CMakeList should adapt to linux environment #94 #113
hananiahhsu Dec 21, 2025
7427f24
【#15】 CMakeList should adapt to linux environment #94 #114
hananiahhsu Dec 21, 2025
130c2f6
【#15】 CMakeList should adapt to linux environment #94 #115
hananiahhsu Dec 21, 2025
519a9cd
【#15】 CMakeList should adapt to linux environment #94 #116
hananiahhsu Dec 21, 2025
c3d0755
【#15】 CMakeList should adapt to linux environment #94 #117
hananiahhsu Dec 21, 2025
df04965
【#15】 CMakeList should adapt to linux environment #94 #118
hananiahhsu Dec 21, 2025
45efb97
【#15】 CMakeList should adapt to linux environment #94 #119
hananiahhsu Dec 21, 2025
d4ac254
【#15】 CMakeList should adapt to linux environment #94 #120
hananiahhsu Dec 21, 2025
80a2853
【#15】 CMakeList should adapt to linux environment #94 #121
hananiahhsu Dec 21, 2025
edf8571
【#15】 CMakeList should adapt to linux environment #94 #122
hananiahhsu Dec 21, 2025
f213aeb
【#15】 CMakeList should adapt to linux environment #94 #123
hananiahhsu Dec 21, 2025
52f6c45
【#15】 CMakeList should adapt to linux environment #94 #124
hananiahhsu Dec 21, 2025
eb35b01
【#15】 CMakeList should adapt to linux environment #94 #125
hananiahhsu Dec 21, 2025
efd0ee9
【#15】 CMakeList should adapt to linux environment #94 #126
hananiahhsu Dec 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ jobs:
sudo apt-get install -y --no-install-recommends \
qtbase5-dev qtbase5-dev-tools qt5-qmake \
qttools5-dev qttools5-dev-tools \
libqt5svg5-dev
libqt5svg5-dev\
qtdeclarative5-dev \
qtquickcontrols2-5-dev\
python3 \
uuid-dev



- name: Configure with CMake (headless)
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DSD_BUILD_DESIGNER=OFF -DSD_BUILD_DEMOS=OFF -DQt5_DIR=/usr/lib/x86_64-linux-gnu/cmake/Qt5
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DSD_BUILD_DESIGNER=ON -DSD_BUILD_DEMOS=ON -DQt5_DIR=/usr/lib/x86_64-linux-gnu/cmake/Qt5

- name: Build
run: cmake --build build --config Release --parallel
2 changes: 1 addition & 1 deletion Alice
Submodule Alice updated from 2c0fa7 to bdba4c
9 changes: 6 additions & 3 deletions Demos/DemoDependencyPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
##########################################################################################################
message("*--*--*--*--*--*--*--*--*--*--*--*--*--Start SolidDemoDependencyPlugin--*--*--*--*--*--*--*--*--*--*--**--*--*--*")

add_definitions(-DSOLID_DESIGNER_UI_HOME)
add_definitions(-DALICE_DEMO_DEPEND_PLUGIN_HOME)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_PREFIX_PATH "C:/Qt/Qt5.15.14/5.15.14/msvc2019_64")
Expand Down Expand Up @@ -93,6 +90,12 @@ add_library(SolidDemoDependencyPlugin SHARED ${SDP_FILES})
set_target_properties(SolidDemoDependencyPlugin PROPERTIES FOLDER "Demos")
#=============================================================================

# 目标级编译宏(代替全局 add_definitions)
target_compile_definitions(SolidDemoDependencyPlugin
PRIVATE
ALICE_DEMO_DEPEND_PLUGIN_HOME
)


#-----------------------------------------------------------------------------
# 根据系统及机器位数设置链接的位数
Expand Down
9 changes: 6 additions & 3 deletions Demos/DemoPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
##########################################################################################################
message("*--*--*--*--*--*--*--*--*--*--*--*--*--Start SolidDemoPlugin--*--*--*--*--*--*--*--*--*--*--**--*--*--*")

add_definitions(-DSOLID_DESIGNER_UI_HOME)
add_definitions(-DALICE_DEMO_PLUGIN_HOME)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_PREFIX_PATH "C:/Qt/Qt5.15.14/5.15.14/msvc2019_64")
Expand Down Expand Up @@ -93,6 +90,12 @@ add_library(SolidDemoPlugin SHARED ${SDP_FILES})
set_target_properties(SolidDemoPlugin PROPERTIES FOLDER "Demos")
#=============================================================================

# 目标级编译宏(代替全局 add_definitions)
target_compile_definitions(SolidDemoPlugin
PRIVATE
ALICE_DEMO_PLUGIN_HOME
)


#-----------------------------------------------------------------------------
# 根据系统及机器位数设置链接的位数
Expand Down
112 changes: 76 additions & 36 deletions Designer/APP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ message(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Designer app Directory<<<<<<<<<
message("CMAKE_SOURCE_DIR == ")
message("${CMAKE_SOURCE_DIR}")
message("${CMAKE_CURRENT_SOURCE_DIR}")
add_definitions(-D_USRDLL)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)

# 批量添加程序文件,包括源文件 头文件 资源文件等
# 注意路径是当前目录,不然的话文件无法正确添加到VS中
FILE(GLOB APP_FILES "${PROJECT_SOURCE_DIR}/Designer/APP/*.cpp" "${PROJECT_SOURCE_DIR}/Designer/APP/*.h")
Expand Down Expand Up @@ -51,32 +50,36 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
#============================================================================#
# 给SolidRender这个工程配置第三方的库
#============================================================================#
if(WIN32)
set(CMAKE_PREFIX_PATH "C:/Qt/Qt5.15.14/5.15.14/msvc2019_64")
find_package(Qt5 COMPONENTS Core Gui Widgets NetWork Quick Qml REQUIRED)

# 设置QT的头文件包含路径
# 如果找不到环境变量QTDIR的路径,那么自己设置吧; 也可以在GUI交互界面上手动设置
SET(QTDIR C:/Qt/Qt5.15.14/5.15.14/msvc2019_64)
endif()

# QT5头文件路径
message("----------------qt5 files include directory--------------------")
include_directories(${QTDIR}/include)
include_directories(${QTDIR}/include/QtWidgets)
include_directories(${QTDIR}/include/QtCore)
include_directories(${QTDIR}/include/QtGui)
include_directories(${QTDIR}/include/QtOpenGL)
include_directories(${QTDIR}/include/QtMultimedia)
include_directories(${QTDIR}/include/QtQuick)
include_directories(${QTDIR}/include/QtQml)
include_directories(${QTDIR}/include/QtNetwork)
include_directories(${QTDIR}/mkspecs/win32-msvc2012)
find_package(Qt5 COMPONENTS Core Gui Widgets Network Quick Qml REQUIRED)

#-----------------------------------------------------------------------------
# 添加需要链接的库文件目录LINK_DIRECTORIES
# 例如QT库
#-----------------------------------------------------------------------------
link_directories(${QTDIR}/lib)

# QT5头文件路径
if(WIN32)
message("----------------qt5 files include directory--------------------")
include_directories(${QTDIR}/include)
include_directories(${QTDIR}/include/QtWidgets)
include_directories(${QTDIR}/include/QtCore)
include_directories(${QTDIR}/include/QtGui)
include_directories(${QTDIR}/include/QtOpenGL)
include_directories(${QTDIR}/include/QtMultimedia)
include_directories(${QTDIR}/include/QtQuick)
include_directories(${QTDIR}/include/QtQml)
include_directories(${QTDIR}/include/QtNetwork)
include_directories(${QTDIR}/mkspecs/win32-msvc2012)

#-----------------------------------------------------------------------------
# 添加需要链接的库文件目录LINK_DIRECTORIES
# 例如QT库
#-----------------------------------------------------------------------------
link_directories(${QTDIR}/lib)
endif()

#-----------------------------------------------------------------------------
#---------------------------第三方库的头文件和二进制文件----------------------
Expand Down Expand Up @@ -138,16 +141,42 @@ add_executable(${PROJECT_NAME}
${HEADER_HPP_FILES}
${APP_FILES})

# 定义:如何生成 .rcc

# 目标级编译宏(代替全局 add_definitions)
target_compile_definitions(${PROJECT_NAME}
PRIVATE
_USRDLL
_CRT_SECURE_NO_WARNINGS
)


# 定义:如何生成 .rcc
if(WIN32)
add_custom_command(OUTPUT "${SD_RCC_FILE}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${SD_RCC_DIR}"
COMMAND ${CMAKE_COMMAND} -E echo ">>> GenerateRCC: ${GEN_RCC_BAT} -> ${SD_RCC_FILE}"
COMMAND ${CMAKE_COMMAND} -E env "QTDIR_X64=$ENV{QTDIR_X64}" "${GEN_RCC_BAT}" "${SD_RCC_DIR}"
COMMAND ${CMAKE_COMMAND} -E env "QTDIR_X64=$ENV{QTDIR_X64}" "${GEN_RCC_BAT}" "${SD_RCC_DIR}" #real execution

WORKING_DIRECTORY "${GEN_RCC_WD}"
DEPENDS ${SD_QRCS} # .qrc 变更触发
VERBATIM
)
else()
# Linux/macOS:用 Qt 的 rcc 直接生成二进制 rcc
find_program(QT_RCC_EXECUTABLE NAMES rcc rcc-qt5)
if(NOT QT_RCC_EXECUTABLE)
message(FATAL_ERROR "Qt rcc not found. Ensure Qt is installed and rcc is in PATH.")
endif()

add_custom_command(
OUTPUT "${SD_RCC_FILE}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${SD_RCC_DIR}"
COMMAND "${QT_RCC_EXECUTABLE}" -binary ${SD_QRCS} -o "${SD_RCC_FILE}"
WORKING_DIRECTORY "${GEN_RCC_WD}"
DEPENDS ${SD_QRCS}
VERBATIM
)
endif()

# 声明一个“资源生成”目标,并让可执行程序依赖它
add_custom_target(SolidDesignerRes ALL DEPENDS "${SD_RCC_FILE}")
Expand Down Expand Up @@ -205,20 +234,31 @@ install(DIRECTORY "${CMAKE_SOURCE_DIR}/source/resource/Script" DESTINATION "${IN
# 链接第三方的库
# @1、链接的动作需要放到add_library之后
#-----------------------------------------------------------------------------
message("PROJECT_NAME = ${PROJECT_NAME}")
target_link_libraries(${PROJECT_NAME}
glu32
glew32
opengl32
freeimage
log4cplusU
AliceCoreApplicationInterface
AliceUiFrameWork
AliceBasicTool
AliceComponentSystem
AliceLaunchInterface
)

find_package(OpenGL REQUIRED)
message("PROJECT_NAME = ${PROJECT_NAME}")
if(WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE
glu32
glew32
opengl32
freeimage
log4cplusU
AliceCoreApplicationInterface
AliceUiFrameWork
AliceBasicTool
AliceLaunchInterface
)
else()
target_link_libraries(${PROJECT_NAME} PRIVATE
OpenGL::GL
OpenGL::GLU
AliceCoreApplicationInterface
AliceUiFrameWork
AliceBasicTool
AliceLaunchInterface
)
endif()


message(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>End Designer APP<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<")
13 changes: 6 additions & 7 deletions Designer/DB/SolidDesignerModel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@
##########################################################################################################
message("*--*--*--*--*--*--*--*--*--*--*--*--*--Start SolidDesignerModel--*--*--*--*--*--*--*--*--*--*--**--*--*--*")

add_definitions(-DSOLID_DESIGNER_MODEL_HOME)
add_definitions(-DALICE_BASIC_SERVICE_HOME)


message("${PROJECT_SOURCE_DIR}")


FILE(GLOB SOURCE_FILES "${PROJECT_SOURCE_DIR}/Designer/DB/SolidDesignerModel/*.cpp")
FILE(GLOB HEADER_FILES "${PROJECT_SOURCE_DIR}/Designer/DB/SolidDesignerModel/*.h")

Expand All @@ -38,6 +32,12 @@ set_target_properties(SolidDesignerModel PROPERTIES FOLDER "Designer/DB")
#=============================================================================


# 目标级编译宏(代替全局 add_definitions)
target_compile_definitions(SolidDesignerModel
PRIVATE
SOLID_DESIGNER_MODEL_HOME
)

#-----------------------------------------------------------------------------
# 根据系统及机器位数设置链接的位数
# 必须放在link之后,否则设置无效
Expand Down Expand Up @@ -100,7 +100,6 @@ endif()
target_link_libraries(SolidDesignerModel PRIVATE
AliceBasicTool
AliceFoundation
AliceDatabaseInterface
AliceModelInterface
)

Expand Down
10 changes: 5 additions & 5 deletions Designer/Interaction/SolidDesignerInteraction/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@
##########################################################################################################
message("*--*--*--*--*--*--*--*--*--*--*--*--*--Start SolidDesignerInteraction--*--*--*--*--*--*--*--*--*--*--**--*--*--*")

add_definitions(-DSOLID_DESIGNER_INTERACTION_HOME)
add_definitions(-DALICE_BASIC_SERVICE_HOME)

message("${PROJECT_SOURCE_DIR}")


FILE(GLOB SOURCE_FILES "${PROJECT_SOURCE_DIR}/Designer/Interaction/SolidDesignerInteraction/*.cpp")
FILE(GLOB HEADER_FILES "${PROJECT_SOURCE_DIR}/Designer/Interaction/SolidDesignerInteraction/*.h")

Expand All @@ -36,6 +31,11 @@ add_library(SolidDesignerInteraction SHARED ${SOURCE_FILES} ${HEADER_FILES})
set_target_properties(SolidDesignerInteraction PROPERTIES FOLDER "Designer/Interaction")
#=============================================================================

# 目标级编译宏(代替全局 add_definitions)
target_compile_definitions(SolidDesignerInteraction
PRIVATE
SOLID_DESIGNER_INTERACTION_HOME
)


#-----------------------------------------------------------------------------
Expand Down
24 changes: 18 additions & 6 deletions Designer/UI/SolidDesignerCommand/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@
#--Author: hananiah
##########################################################################################################
message("*--*--*--*--*--*--*--*--*--*--*--*--*--Start SolidDesignerCommand--*--*--*--*--*--*--*--*--*--*--**--*--*--*")

add_definitions(-DSOLID_DESIGNER_UI_HOME)
add_definitions(-DSOLID_DESIGNER_COMMAND_HOME)

message("CMAKE_SOURCE_DIR = ${CMAKE_SOURCE_DIR}")
# 先指定你项目内置的 Python 解释器
set(_SD_PY_ROOT "${CMAKE_SOURCE_DIR}/ToolChain/Python310")
set(Python3_EXECUTABLE "${_SD_PY_ROOT}/python.exe" CACHE FILEPATH "SolidDesigner bundled Python" FORCE)
if(WIN32)
# Windows: use repo toolchain python
set(_SD_PY_ROOT "${CMAKE_SOURCE_DIR}/ToolChain/Python310")
set(Python3_EXECUTABLE "${_SD_PY_ROOT}/python.exe" CACHE FILEPATH "SolidDesigner bundled Python" FORCE)
else()
message("Here is linux python... ...")
# Linux/macOS: use system python3
find_program(_PY3 NAMES python3 python REQUIRED)
set(Python3_EXECUTABLE "${_PY3}" CACHE FILEPATH "Python3 interpreter" FORCE)

endif()


# 然后再找 Python3
find_package(Python3 REQUIRED COMPONENTS Interpreter)
Expand Down Expand Up @@ -57,6 +63,12 @@ add_library(SolidDesignerCommand SHARED ${SDC_FILES})
set_target_properties(SolidDesignerCommand PROPERTIES FOLDER "Designer/UI")
#=============================================================================

# 目标级编译宏(代替全局 add_definitions)
target_compile_definitions(SolidDesignerCommand
PRIVATE
SOLID_DESIGNER_COMMAND_HOME
)


#-----------------------------------------------------------------------------
# 根据系统及机器位数设置链接的位数
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "SolidFileOpenCommand.h"
#include "SolidFileOpenCommand.h"

#include "AliceIMainWindow.h"
#include "AliceIDocumentManager.h"
Expand Down Expand Up @@ -53,7 +53,7 @@ std::unique_ptr<IOperation> SolidFileOpenCommand::Execute(const CommandParameter

std::wstring filePath = showOpenFileDialog_();
if (filePath.empty())
return nullptr; // �û�ȡ��
return nullptr; // 用户取消

IDocument* doc = openDocument_(filePath);
if (!doc)
Expand All @@ -75,8 +75,8 @@ std::wstring SolidFileOpenCommand::showOpenFileDialog_() const
{
//QWidget* parent = m_mainWindow ? m_mainWindow->AsQMainWindow() : nullptr;

//// ���˿��Դ� UiApplicationConfig / CommandsConfig �� profile ���ã��˴���һ��
//// ��� .alice + ���� CAD ��ʽ��ʾ����
//// 过滤可以从 UiApplicationConfig / CommandsConfig profile 中拿,此处给一个
//// 针对 .alice + 常规 CAD 格式的示例。
//const QString filter =
// QObject::tr("Alice Documents (*.alice);;"
// "STEP Files (*.step *.stp);;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ IDocument* SolidFileSaveCommand::getActiveDocument_() const
// return nullptr;

//return m_docManager->GetActiveDocument();
return false;
return nullptr;
}

bool SolidFileSaveCommand::hasFilePath_(IDocument& doc) const
Expand Down
13 changes: 9 additions & 4 deletions Designer/UI/SolidDesignerUI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
##########################################################################################################
message("*--*--*--*--*--*--*--*--*--*--*--*--*--Start SolidDesigner UI--*--*--*--*--*--*--*--*--*--*--**--*--*--*")

add_definitions(-DSOLID_DESIGNER_UI_HOME)
add_definitions(-DALICE_BASIC_SERVICE_HOME)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_PREFIX_PATH "C:/Qt/Qt5.15.14/5.15.14/msvc2019_64")
if(WIN32)
set(CMAKE_PREFIX_PATH "C:/Qt/Qt5.15.14/5.15.14/msvc2019_64")
endif()

find_package(Qt5Core 5.15 REQUIRED)
find_package(Qt5Gui 5.15 REQUIRED)
find_package(Qt5Widgets 5.15 REQUIRED)
Expand Down Expand Up @@ -49,6 +49,11 @@ add_library(SolidDesignerUI SHARED ${SOURCE_FILES} ${HEADER_FILES})
set_target_properties(SolidDesignerUI PROPERTIES FOLDER "Designer/UI")
#=============================================================================

# 目标级编译宏(代替全局 add_definitions)
target_compile_definitions(SolidDesignerUI
PRIVATE
SOLID_DESIGNER_UI_HOME
)

#-----------------------------------------------------------------------------
# 根据系统及机器位数设置链接的位数
Expand Down
Loading