TextEditor: Add missing file to dev package

The public header "textdocumentlayout.h" includes "State" from
KSyntaxHighlighting, so we need to export that.
Since it doesn't have the ".h" extension, it doesn't get exported
automatically either. Add a generic function for adding such special
public header files.

Fixes: QTCREATORBUG-24413
Change-Id: I841e6d601df7e925f48eedcc2a28d6b43c00350e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2020-10-29 11:13:19 +01:00
parent f44c447874
commit bf8879ee5c
3 changed files with 20 additions and 14 deletions

View File

@@ -906,3 +906,18 @@ function(qtc_add_resources target resourceName)
target_sources(${target} PRIVATE "${generatedSourceCode}")
set_property(SOURCE "${generatedSourceCode}" PROPERTY SKIP_AUTOGEN ON)
endfunction()
function(qtc_add_public_header header)
if (NOT IS_ABSOLUTE ${header})
set(header "${CMAKE_CURRENT_SOURCE_DIR}/${header}")
endif()
get_filename_component(source_dir ${header} DIRECTORY)
file(RELATIVE_PATH include_dir_relative_path ${PROJECT_SOURCE_DIR} ${source_dir})
install(
FILES ${header}
DESTINATION "include/${include_dir_relative_path}"
COMPONENT Devel EXCLUDE_FROM_ALL
)
endfunction()

View File

@@ -179,19 +179,7 @@ endfunction()
function(set_public_headers target sources)
foreach(source IN LISTS sources)
if (source MATCHES "\.h$|\.hpp$")
if (NOT IS_ABSOLUTE ${source})
set(source "${CMAKE_CURRENT_SOURCE_DIR}/${source}")
endif()
get_filename_component(source_dir ${source} DIRECTORY)
file(RELATIVE_PATH include_dir_relative_path ${PROJECT_SOURCE_DIR} ${source_dir})
install(
FILES ${source}
DESTINATION "include/${include_dir_relative_path}"
COMPONENT Devel EXCLUDE_FROM_ALL
)
qtc_add_public_header(${source})
endif()
endforeach()
endfunction()

View File

@@ -1,6 +1,8 @@
add_qtc_library(KSyntaxHighlighting SHARED
INCLUDES autogenerated/
PUBLIC_INCLUDES src/lib autogenerated/src/lib
PUBLIC_INCLUDES
src/lib
autogenerated/src/lib
DEFINES KSYNTAXHIGHLIGHTING_LIBRARY
DEPENDS Qt5::Network Qt5::Widgets
SOURCES
@@ -32,6 +34,7 @@ add_qtc_library(KSyntaxHighlighting SHARED
src/lib/wildcardmatcher.cpp src/lib/wildcardmatcher_p.h
src/lib/xml_p.h
)
qtc_add_public_header(autogenerated/src/lib/State)
install(
DIRECTORY data/syntax