widgets/CMakeLists.txt

Sat, 08 Apr 2023 15:52:25 +0300

author
Teemu Piippo <teemu.s.piippo@gmail.com>
date
Sat, 08 Apr 2023 15:52:25 +0300
changeset 352
59a31dd8a33a
parent 348
98776f54a8d0
permissions
-rw-r--r--

Rename forModel -> forEachModel

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