Skip to content

Commit

Permalink
use libqtpropertybrowser for studio compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
zerotacg committed Feb 4, 2024
1 parent 1f6fea8 commit bc1409a
Show file tree
Hide file tree
Showing 91 changed files with 5,019 additions and 4,098 deletions.
2 changes: 0 additions & 2 deletions studio/src/3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
ADD_SUBDIRECTORY(qtpropertybrowser)

SET(QtPropertyBrowser_LIBRARY "QtPropertyBrowser")
176 changes: 100 additions & 76 deletions studio/src/3rdparty/qtpropertybrowser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,76 +1,100 @@
cmake_minimum_required(VERSION 2.9)
project(QtPropertyBrowser)

find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)

set(SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/qtbuttonpropertybrowser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/qteditorfactory.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/qtgroupboxpropertybrowser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/qtpropertybrowser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/qtpropertybrowserutils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/qtpropertymanager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/qttreepropertybrowser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/qtvariantproperty.cpp
)
set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/qtbuttonpropertybrowser.h
${CMAKE_CURRENT_SOURCE_DIR}/src/qteditorfactory.h
${CMAKE_CURRENT_SOURCE_DIR}/src/qtgroupboxpropertybrowser.h
${CMAKE_CURRENT_SOURCE_DIR}/src/qtpropertybrowser.h
${CMAKE_CURRENT_SOURCE_DIR}/src/qtpropertybrowserutils_p.h
${CMAKE_CURRENT_SOURCE_DIR}/src/qtpropertymanager.h
${CMAKE_CURRENT_SOURCE_DIR}/src/qttreepropertybrowser.h
${CMAKE_CURRENT_SOURCE_DIR}/src/qtvariantproperty.h
)

set(QRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/qtpropertybrowser.qrc)

source_group("Header Files" FILES ${HEADER_FILES})
source_group("Source Files" FILES ${SOURCE_FILES})

set(CMAKE_AUTORCC ON)

option(BUILD_SHARED_LIBS "Build shared library." ON)
option(BUILD_EXAMPLES "Build examples." OFF)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_library(QtPropertyBrowser ${HEADER_FILES} ${SOURCE_FILES} ${QRC_FILES})

target_include_directories(QtPropertyBrowser PUBLIC
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
)

target_link_libraries(QtPropertyBrowser PUBLIC
${Qt5Core_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Widgets_LIBRARIES}
)

set_target_properties(QtPropertyBrowser PROPERTIES AUTOMOC TRUE)

if(BUILD_EXAMPLES)
add_subdirectory(examples/demo)
endif()

include(GenerateExportHeader)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
generate_export_header(QtPropertyBrowser)

install(TARGETS QtPropertyBrowser
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
)
install(FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/QtPropertyBrowser)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindQtPropertyBrowser.cmake DESTINATION ${CMAKE_INSTALL_PREFIX})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qtpropertybrowser_export.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/QtPropertyBrowser)


option(BUILD_DOCUMENTATION "Use Doxygen to create the HTML based API documentation" OFF)
if(BUILD_DOCUMENTATION)
include(doxygen/doxygen.cmake)
endif()
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${QT_INCLUDES})
INCLUDE(${QT_USE_FILE})

FILE(GLOB SRC *.cpp *.h)

SET(QT_PROPERTY_EDITOR_HDR qtpropertybrowser.h
qtpropertymanager.h
qteditorfactory.h
qtvariantproperty.h
qttreepropertybrowser.h
qtbuttonpropertybrowser.h
qtgroupboxpropertybrowser.h
qtpropertybrowserutils_p.h)

SET(QT_PROPERTY_EDITOR_RCS qtpropertybrowser.qrc)

SET(QT_USE_QTGUI TRUE)

QT4_ADD_RESOURCES(QT_PROPERTY_EDITOR_RC_SRCS ${QT_PROPERTY_EDITOR_RCS})
QT4_WRAP_CPP(QT_PROPERTY_EDITOR_MOC_SRC ${QT_PROPERTY_EDITOR_HDR})

SOURCE_GROUP(QtResources FILES ${QT_PROPERTY_EDITOR_RCS})
SOURCE_GROUP(QtGeneratedMocSrc FILES ${QT_PROPERTY_EDITOR_MOC_SRC})
SOURCE_GROUP("Qt Property Editor Source" FILES ${SRC})

qt4_generate_moc(qtpropertymanager.cpp ${CMAKE_CURRENT_BINARY_DIR}/qtpropertymanager.moc)
qt4_generate_moc(qteditorfactory.cpp ${CMAKE_CURRENT_BINARY_DIR}/qteditorfactory.moc)
qt4_generate_moc(qttreepropertybrowser.cpp ${CMAKE_CURRENT_BINARY_DIR}/qttreepropertybrowser.moc)

# Need to remove these so that they are not linked as they are inline included.
LIST(REMOVE_ITEM QT_PROPERTY_EDITOR_MOC_SRC ${CMAKE_CURRENT_BINARY_DIR}/moc_qtbuttonpropertybrowser.cxx
${CMAKE_CURRENT_BINARY_DIR}/moc_qteditorfactory.cxx
${CMAKE_CURRENT_BINARY_DIR}/moc_qtgroupboxpropertybrowser.cxx
${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertybrowser.cxx
${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertymanager.cxx
${CMAKE_CURRENT_BINARY_DIR}/moc_qttreepropertybrowser.cxx
${CMAKE_CURRENT_BINARY_DIR}/moc_qtvariantproperty.cxx)

# We need to add new depencencies on removed files because we need them to be still generated
SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtbuttonpropertybrowser.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtbuttonpropertybrowser.cxx)
SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qteditorfactory.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qteditorfactory.cxx)
SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtgroupboxpropertybrowser.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtgroupboxpropertybrowser.cxx)
SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtpropertybrowser.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertybrowser.cxx)
SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtpropertymanager.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertymanager.cxx)
SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qttreepropertybrowser.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qttreepropertybrowser.cxx)
SET_PROPERTY(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/qtvariantproperty.cpp APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/moc_qtvariantproperty.cxx)

#set(
# qtpropertyeditor_HEADERS_ONLY_MOC
# ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertybrowser.cpp
# ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertymanager.cpp
# ${CMAKE_CURRENT_BINARY_DIR}/moc_qteditorfactory.cpp
# ${CMAKE_CURRENT_BINARY_DIR}/moc_qtvariantproperty.cpp
# ${CMAKE_CURRENT_BINARY_DIR}/moc_qttreepropertybrowser.cpp
# ${CMAKE_CURRENT_BINARY_DIR}/moc_qtbuttonpropertybrowser.cpp
# ${CMAKE_CURRENT_BINARY_DIR}/moc_qtgroupboxpropertybrowser.cpp
# ${CMAKE_CURRENT_BINARY_DIR}/qtpropertymanager.moc
# ${CMAKE_CURRENT_BINARY_DIR}/qteditorfactory.moc
# ${CMAKE_CURRENT_BINARY_DIR}/qttreepropertybrowser.moc
#)
#
#set_source_files_properties(
# ${qtpropertyeditor_HEADERS_ONLY_MOC}
# PROPERTIES
# HEADER_FILE_ONLY true
#)
#

#set(
# qtpropertyeditor_HEADERS_MOC
# ${CMAKE_CURRENT_BINARY_DIR}/moc_qtpropertybrowserutils_p.cpp
#)

#set(
# qtpropertyeditor_MOC
# ${qtpropertyeditor_HEADERS_MOC}
# ${qtpropertyeditor_HEADERS_ONLY_MOC}
#)

ADD_LIBRARY(qt_property_browser SHARED ${SRC}
${QT_PROPERTY_EDITOR_MOC_SRC}
${QT_PROPERTY_EDITOR_RC_SRCS}
${CMAKE_CURRENT_BINARY_DIR}/qtpropertymanager.moc
${CMAKE_CURRENT_BINARY_DIR}/qttreepropertybrowser.moc
${CMAKE_CURRENT_BINARY_DIR}/qteditorfactory.moc)

TARGET_LINK_LIBRARIES(qt_property_browser ${QT_LIBRARIES})

ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DQT_DLL)
ADD_DEFINITIONS(-DQT_QTPROPERTYBROWSER_EXPORT)
ADD_DEFINITIONS(-DQT_PLUGIN)
#ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)

NL_DEFAULT_PROPS(qt_property_browser "3rdParty: Qt Property Browser 2.5")
NL_ADD_RUNTIME_FLAGS(qt_property_browser)
NL_ADD_LIB_SUFFIX(qt_property_browser)

INSTALL(TARGETS qt_property_browser LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)
10 changes: 10 additions & 0 deletions studio/src/3rdparty/qtpropertybrowser/LGPL_EXCEPTION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Nokia Qt LGPL Exception version 1.0

As a special exception to the GNU Lesser General Public License
version 2.1, the object code form of a "work that uses the Library"
may incorporate material from a header file that is part of the
Library. You may distribute such object code under terms of your
choice, provided that the incorporated material (i) does not exceed
more than 5% of the total size of the Library; and (ii) is limited to
numerical parameters, data structure layouts, accessors, macros,
inline functions and templates.
Loading

0 comments on commit bc1409a

Please sign in to comment.