summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2024-03-06 18:46:37 +0300
committerAlexander Golubev <fatzer2@gmail.com>2024-03-08 14:50:56 +0300
commit32d748e8fbfcf5a9a0405fd058af900622afbb66 (patch)
tree5ccc89d445b73b28916ed02889ad6f4c451e970e
parenta0f0d4b60912d52fb6df1555fbe95703e244248e (diff)
downloadtqt3-32d748e8fbfcf5a9a0405fd058af900622afbb66.tar.gz
tqt3-32d748e8fbfcf5a9a0405fd058af900622afbb66.zip
cmake: add the rest tools to build
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
-rw-r--r--TQtMacros.cmake110
-rw-r--r--tools/maketqpf/CMakeLists.txt16
-rw-r--r--tools/msg2tqm/CMakeLists.txt14
-rw-r--r--tools/qembed/CMakeLists.txt12
-rw-r--r--tools/qtconfig/CMakeLists.txt36
-rw-r--r--tools/tqtmergetr/CMakeLists.txt14
-rw-r--r--tools/tqvfb/CMakeLists.txt26
7 files changed, 228 insertions, 0 deletions
diff --git a/TQtMacros.cmake b/TQtMacros.cmake
index 9cd48750..f6f856ab 100644
--- a/TQtMacros.cmake
+++ b/TQtMacros.cmake
@@ -283,6 +283,116 @@ endmacro( tqt_automoc )
#################################################
#####
+##### tqt_uic_embed
+#####
+##### The macro embeds given list of FILES into cpp source file OUTPUT and then adds
+##### sad file to the dependencies of the TARGET (if specified). Either TARGET or
+##### PROJECT and OUTPUT must be specified.
+#####
+##### Syntax:
+##### tqt_uic_embed (
+##### [[TARGET] target]
+##### [OUTPUT out]
+##### [PROJECT project]
+##### FILES file [file ...]
+##### )
+#####
+##### @arg TARGET a name of the target the giles should be add as a dependencies to
+##### @arg OUTPUT a fileneme the resulting cpp file will be writen to. If not
+##### specified the name will be autoselected based on TARGET.
+##### @arg PROJECT a suffix of a classname which will be used to access the
+##### files from source code, if not specified TARGET is used.
+##### @arg FILES a list of files to embed.
+#####
+
+function(tqt_uic_embed)
+ unset( _target )
+ unset( _project )
+ unset( _output )
+ unset( _files )
+ unset( _directive )
+ set( _var _target )
+
+ foreach( _arg ${ARGN} )
+
+ # found directive "TARGET"
+ if( "+${_arg}" STREQUAL "+TARGET" )
+ unset( _target )
+ set( _var _target )
+ set( _directive 1 )
+ endif( )
+
+ # found directive "OUTPUT"
+ if( "+${_arg}" STREQUAL "+OUTPUT" )
+ unset( _output )
+ set( _var _output )
+ set( _directive 1 )
+ endif( )
+
+ # found directive "PROJECT"
+ if( "+${_arg}" STREQUAL "+PROJECT" )
+ unset( _project )
+ set( _var _project )
+ set( _directive 1 )
+ endif( )
+
+ # found directive "FILES"
+ if( "+${_arg}" STREQUAL "+FILES" )
+ unset( _files )
+ set( _var _files )
+ set( _directive 1 )
+ endif( )
+
+ # collect data
+ if( _directive )
+ unset( _directive )
+ elseif( _var )
+ list( APPEND ${_var} ${_arg} )
+ endif( )
+
+ endforeach( )
+
+ # check argument sanity
+ if( NOT _output AND NOT _target )
+ tde_message_fatal( "tqt_uic_embed() requires either TARGET or OUTPUT to be specified" )
+ elseif( _target AND NOT TARGET ${_target} )
+ tde_message_fatal( "The specified target does not exists." )
+ elseif( NOT _files )
+ tde_message_fatal( "At least one file to embed must be specified" )
+ elseif( NOT TMOC_EXECUTABLE )
+ tde_message_fatal( "tmoc is required but not found" )
+ endif( )
+
+ # default for _project
+ if( NOT _project )
+ set( _project "${_target}" )
+ endif( )
+
+ # choose output name if not specified
+ if( NOT _output )
+ set( _output "${CMAKE_CURRENT_BINARY_DIR}/${_target}_embedded_files.cpp" )
+ endif( )
+
+ # sanitize output to be an absolute path
+ get_filename_component( _output ${_output} ABSOLUTE )
+
+ add_custom_command( OUTPUT "${_output}"
+ COMMAND "${UIC_EXECUTABLE}"
+ -embed "${_project}" ${_files}
+ -o "${_output}"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "Generating embed images for ${_project}"
+ )
+
+ if( _target )
+ set_property( TARGET "${_target}" APPEND PROPERTY SOURCES ${_output} )
+ endif( )
+
+endfunction(tqt_uic_embed)
+
+
+#################################################
+#####
##### tqt_create_translation
#####
##### The macro is used for create binary files for translations
diff --git a/tools/maketqpf/CMakeLists.txt b/tools/maketqpf/CMakeLists.txt
new file mode 100644
index 00000000..60b175b8
--- /dev/null
+++ b/tools/maketqpf/CMakeLists.txt
@@ -0,0 +1,16 @@
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_SOURCE_DIR}/mkspecs/linux-g++-64
+ ${CMAKE_BINARY_DIR}/include
+)
+
+##### maketqpf (executable)
+
+set( target maketqpf )
+
+tde_add_executable( ${target}
+ SOURCES main.cpp
+ LINK tqt-mt-shared
+ DESTINATION ${BIN_INSTALL_DIR}
+)
+tqt_automoc( ${target} )
diff --git a/tools/msg2tqm/CMakeLists.txt b/tools/msg2tqm/CMakeLists.txt
new file mode 100644
index 00000000..a33958a0
--- /dev/null
+++ b/tools/msg2tqm/CMakeLists.txt
@@ -0,0 +1,14 @@
+include_directories(
+ ${CMAKE_SOURCE_DIR}/mkspecs/linux-g++-64
+ ${CMAKE_BINARY_DIR}/include
+)
+
+##### msg2tqm (executable)
+
+set( target msg2tqm )
+
+tde_add_executable( ${target}
+ SOURCES ${target}.cpp
+ LINK tqt-mt-shared
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/tools/qembed/CMakeLists.txt b/tools/qembed/CMakeLists.txt
new file mode 100644
index 00000000..55a47f75
--- /dev/null
+++ b/tools/qembed/CMakeLists.txt
@@ -0,0 +1,12 @@
+include_directories(
+ ${CMAKE_SOURCE_DIR}/mkspecs/linux-g++-64
+ ${CMAKE_BINARY_DIR}/include
+)
+
+##### tqembed (executable)
+
+tde_add_executable( tqembed
+ SOURCES qembed.cpp
+ LINK tqt-mt-shared
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/tools/qtconfig/CMakeLists.txt b/tools/qtconfig/CMakeLists.txt
new file mode 100644
index 00000000..6c4e95d9
--- /dev/null
+++ b/tools/qtconfig/CMakeLists.txt
@@ -0,0 +1,36 @@
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/mkspecs/linux-g++-64
+ ${CMAKE_BINARY_DIR}/include
+)
+
+##### tqtconfig (executable)
+
+set( target tqtconfig )
+
+set( ${target}_SOURCES
+ colorbutton.cpp main.cpp previewframe.cpp previewwidget.cpp mainwindow.cpp
+ paletteeditoradvanced.cpp
+
+ mainwindowbase.ui paletteeditoradvancedbase.ui previewwidgetbase.ui
+)
+
+tde_add_executable( ${target}
+ SOURCES ${${target}_SOURCES}
+ LINK tqt-mt-shared
+ DESTINATION ${BIN_INSTALL_DIR}
+ DEPENDENCIES tquic
+)
+tqt_automoc( ${target} )
+
+tde_create_translated_desktop(
+ SOURCE ${target}.desktop
+ DESTINATION ${QT_INSTALL_SHARE}/applications
+)
+
+install(
+ FILES images/appicon.png
+ DESTINATION ${QT_INSTALL_SHARE}/pixmaps
+ RENAME ${target}.png
+)
diff --git a/tools/tqtmergetr/CMakeLists.txt b/tools/tqtmergetr/CMakeLists.txt
new file mode 100644
index 00000000..2dce428b
--- /dev/null
+++ b/tools/tqtmergetr/CMakeLists.txt
@@ -0,0 +1,14 @@
+include_directories(
+ ${CMAKE_SOURCE_DIR}/mkspecs/linux-g++-64
+ ${CMAKE_BINARY_DIR}/include
+)
+
+##### tqtmergetr (executable)
+
+set( target tqtmergetr )
+
+tde_add_executable( ${target}
+ SOURCES ${target}.cpp
+ LINK tqt-mt-shared
+ DESTINATION ${BIN_INSTALL_DIR}
+)
diff --git a/tools/tqvfb/CMakeLists.txt b/tools/tqvfb/CMakeLists.txt
new file mode 100644
index 00000000..2e8d7f1b
--- /dev/null
+++ b/tools/tqvfb/CMakeLists.txt
@@ -0,0 +1,26 @@
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_SOURCE_DIR}/mkspecs/linux-g++-64
+ ${CMAKE_BINARY_DIR}/include
+ ${PNG_INCLUDE_DIRS}
+)
+
+##### tqvfb (executable)
+
+set( target tqvfb )
+
+set( ${target}_SOURCES
+ tqvfb.cpp tqvfbview.cpp tqvfbratedlg.cpp main.cpp qanimationwriter.cpp skin.cpp
+
+ config.ui
+)
+
+tde_add_executable( ${target}
+ SOURCES ${${target}_SOURCES}
+ LINK tqt-mt-shared ${PNG_LIBRARIES}
+ DESTINATION ${BIN_INSTALL_DIR}
+ DEPENDENCIES tquic
+)
+tqt_automoc( ${target} INCLUDES gammaview.h AUTO )
+tqt_uic_embed( ${target} FILES images/logo.png )