Skip to content

Commit 4ed886f

Browse files
committed
change the project structure
fix blocker impact bug fix function wasn't implement update builder code
1 parent a202f69 commit 4ed886f

25 files changed

+70
-68
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
open_converter.pro.user
2-
build*
2+
build-*
33
.vscode
44
.DS_Store
5-
./src/.DS_Store
5+
./src/.DS_Store
6+
src/CMakeLists.txt.user

src/CMakeLists.txt

Lines changed: 61 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.5)
22

3-
project(OpenConverterCmake VERSION 0.1 LANGUAGES CXX)
3+
project(OpenConverter VERSION 1.2 LANGUAGES CXX)
44

55
set(CMAKE_AUTOUIC ON)
66
set(CMAKE_AUTOMOC ON)
@@ -18,6 +18,10 @@ include_directories(
1818
/opt/homebrew/Cellar/x264/r3108/include
1919
/opt/homebrew/Cellar/x265/4.0_1/include
2020
/Users/jacklau/Documents/Programs/Git/Github/bmf/output/bmf/include
21+
${CMAKE_SOURCE_DIR}/builder/include
22+
${CMAKE_SOURCE_DIR}/common/include
23+
${CMAKE_SOURCE_DIR}/engine/include
24+
${CMAKE_SOURCE_DIR}/transcoder/include
2125
)
2226

2327
link_directories(
@@ -28,82 +32,79 @@ link_directories(
2832
/Users/jacklau/Documents/Programs/Git/Github/bmf/output/bmf/lib
2933
)
3034

31-
# # Add source files
32-
# set(SOURCES
33-
# converter.cpp
34-
# encode_parameter.cpp
35-
# encode_setting.cpp
36-
# info.cpp
37-
# main.cpp
38-
# open_converter.cpp
39-
# process_parameter.cpp
40-
# stream_context.cpp
41-
# transcoder.cpp
42-
# )
43-
44-
# # Add header files
45-
# set(HEADERS
46-
# converter.h
47-
# encode_parameter.h
48-
# encode_setting.h
49-
# info.h
50-
# open_converter.h
51-
# process_parameter.h
52-
# stream_context.h
53-
# transcoder.h
54-
# )
55-
56-
set(PROJECT_SOURCES
57-
converter.h
58-
encode_parameter.h
59-
encode_setting.h
60-
info.h
61-
open_converter.h
62-
process_parameter.h
63-
stream_context.h
64-
transcoder.h
65-
transcoder_bmf.h
66-
converter.cpp
67-
encode_parameter.cpp
68-
encode_setting.cpp
69-
info.cpp
70-
main.cpp
71-
open_converter.cpp
72-
process_parameter.cpp
73-
stream_context.cpp
74-
transcoder.cpp
75-
transcoder_bmf.cpp
76-
open_converter.ui
77-
encode_setting.ui
78-
lang.qrc
35+
# Add source files
36+
set(SOURCES
37+
${CMAKE_SOURCE_DIR}/main.cpp
38+
${CMAKE_SOURCE_DIR}/builder/src/encode_setting.cpp
39+
${CMAKE_SOURCE_DIR}/builder/src/open_converter.cpp
40+
${CMAKE_SOURCE_DIR}/common/src/encode_parameter.cpp
41+
${CMAKE_SOURCE_DIR}/common/src/info.cpp
42+
${CMAKE_SOURCE_DIR}/common/src/process_parameter.cpp
43+
${CMAKE_SOURCE_DIR}/common/src/stream_context.cpp
44+
${CMAKE_SOURCE_DIR}/engine/src/converter.cpp
45+
${CMAKE_SOURCE_DIR}/transcoder/src/transcoder.cpp
46+
${CMAKE_SOURCE_DIR}/transcoder/src/transcoder_bmf.cpp
7947
)
8048

49+
# Add header files
50+
set(HEADERS
51+
${CMAKE_SOURCE_DIR}/builder/include/encode_setting.h
52+
${CMAKE_SOURCE_DIR}/builder/include/open_converter.h
53+
${CMAKE_SOURCE_DIR}/common/include/encode_parameter.h
54+
${CMAKE_SOURCE_DIR}/common/include/info.h
55+
${CMAKE_SOURCE_DIR}/common/include/process_parameter.h
56+
${CMAKE_SOURCE_DIR}/common/include/stream_context.h
57+
${CMAKE_SOURCE_DIR}/engine/include/converter.h
58+
${CMAKE_SOURCE_DIR}/transcoder/include/transcoder.h
59+
${CMAKE_SOURCE_DIR}/transcoder/include/transcoder_bmf.h
60+
)
61+
62+
# Add UI files
63+
set(UI_FILES
64+
${CMAKE_SOURCE_DIR}/builder/src/encode_setting.ui
65+
${CMAKE_SOURCE_DIR}/builder/src/open_converter.ui
66+
)
67+
68+
# Add resource files
69+
set(RESOURCE_FILES
70+
${CMAKE_SOURCE_DIR}/resources/lang.qrc
71+
)
72+
73+
# Handle MOC, UIC, and RCC (Qt build steps)
74+
# Automatically handle UI files using UIC
75+
#qt_wrap_ui(UI_HEADERS ${UI_FILES})
76+
# qt_add_resources(RESOURCE_OBJECTS ${RESOURCE_FILES})
77+
# qt_wrap_cpp(MOC_HEADERS ${HEADERS})
78+
8179
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
82-
qt_add_executable(OpenConverterCmake
80+
qt_add_executable(OpenConverter
8381
MANUAL_FINALIZATION
84-
${PROJECT_SOURCES}
82+
${SOURCES} ${UI_FILES} ${RESOURCE_FILES} ${HEADERS}
8583
)
8684
# Define target properties for Android with Qt 6 as:
87-
# set_property(TARGET OpenConverterCmake APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
85+
# set_property(TARGET OpenConverter APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
8886
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
8987
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
9088
else()
9189
if(ANDROID)
92-
add_library(OpenConverterCmake SHARED
90+
add_library(OpenConverter SHARED
9391
${PROJECT_SOURCES}
9492
)
9593
# Define properties for Android with Qt 5 after find_package() calls as:
9694
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
9795
else()
98-
add_executable(OpenConverterCmake
96+
add_executable(OpenConverter
9997
${PROJECT_SOURCES}
10098
)
10199
endif()
102100
endif()
103101

104-
# target_link_libraries(OpenConverterCmake PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
102+
# target_link_libraries(OpenConverter PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
103+
104+
#target_include_directories(${LIB_NAME} INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}_autogen/include)
105+
105106

106-
target_link_libraries(OpenConverterCmake
107+
target_link_libraries(OpenConverter
107108
PRIVATE Qt${QT_VERSION_MAJOR}::Widgets
108109
avformat
109110
avcodec
@@ -129,22 +130,22 @@ target_link_libraries(OpenConverterCmake
129130
)
130131

131132
# Set translation files
132-
set(TRANSLATIONS lang_chinese.ts)
133+
set(TRANSLATIONS ${CMAKE_SOURCE_DIR}/resources/lang_chinese.ts)
133134

134-
set_target_properties(OpenConverterCmake PROPERTIES
135+
set_target_properties(OpenConverter PROPERTIES
135136
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
136137
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
137138
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
138139
MACOSX_BUNDLE TRUE
139140
WIN32_EXECUTABLE TRUE
140141
)
141142

142-
install(TARGETS OpenConverterCmake
143+
install(TARGETS OpenConverter
143144
BUNDLE DESTINATION .
144145
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
145146
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
146147
)
147148

148149
if(QT_VERSION_MAJOR EQUAL 6)
149-
qt_finalize_executable(OpenConverterCmake)
150+
qt_finalize_executable(OpenConverter)
150151
endif()
File renamed without changes.

0 commit comments

Comments
 (0)