widgets/CMakeLists.txt

Thu, 15 Jun 2023 16:18:03 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Thu, 15 Jun 2023 16:18:03 +0300
changeset 383
530d23cd4e97
parent 348
98776f54a8d0
permissions
-rw-r--r--

Refactor, make selecting elements from the model select the corresponding line from the editor as well

set(WIDGETLIB "${TARGET_NAME}widgets" PARENT_SCOPE)
set(WIDGETLIB "${TARGET_NAME}widgets")
qt_wrap_ui(WIDGETS_FORMS
	vec3editor.ui
	multiplyfactordialog.ui
	matrixeditor.ui
)

add_library(${WIDGETLIB} SHARED
	coloredit.cpp
	coloredit.h
	designerplugins.cpp
	designerplugins.h
	doublespinbox.cpp
	doublespinbox.h
	matrixeditor.cpp
	matrixeditor.h
	vec3editor.cpp
	vec3editor.h
	multiplyfactordialog.cpp
	multiplyfactordialog.h
	${WIDGETS_FORMS}
)

get_target_property(UIPLUGIN_INCLUDES QtUiPlugin INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories(${WIDGETLIB} PUBLIC "${UIPLUGIN_INCLUDES}")
target_include_directories(${WIDGETLIB} PUBLIC "${CMAKE_SOURCE_DIR}")
target_include_directories(${WIDGETLIB} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")
target_link_libraries(${WIDGETLIB} Qt::Widgets)
set_target_properties(${WIDGETLIB} PROPERTIES AUTOMOC 1)

get_target_property(QT_QMAKE_EXECUTABLE Qt::qmake LOCATION)
execute_process(COMMAND ${QT_QMAKE_EXECUTABLE} -query QT_INSTALL_PLUGINS
	OUTPUT_VARIABLE QT_INSTALL_PLUGINS OUTPUT_STRIP_TRAILING_WHITESPACE
)
install(TARGETS ${WIDGETLIB} LIBRARY DESTINATION lib)
install(TARGETS ${WIDGETLIB}
	LIBRARY DESTINATION ${QT_INSTALL_PLUGINS}/designer
)

mercurial