Skip to content

Commit

Permalink
Fix instalation of include and libraries files
Browse files Browse the repository at this point in the history
  • Loading branch information
dantti committed Jul 18, 2021
1 parent b3d4a3b commit 10903d7
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 81 deletions.
19 changes: 10 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,37 +99,38 @@ if (BUILD_TEXTDOCUMENT)
add_subdirectory(textdocument)
endif()

set(CMAKECONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/Cutelee${Cutelee_VERSION_MAJOR}" )
set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/Cutelee${Cutelee_VERSION_MAJOR}Qt${QT_VERSION_MAJOR}" )

configure_file(
"${Cutelee_MODULE_DIR}/CuteleeConfig.cmake.in"
"${CMAKE_BINARY_DIR}/Cutelee${Cutelee_VERSION_MAJOR}Config.cmake"
"${CMAKE_BINARY_DIR}/Cutelee${Cutelee_VERSION_MAJOR}Qt${QT_VERSION_MAJOR}Config.cmake"
@ONLY
)

include(CMakePackageConfigHelpers)
write_basic_package_version_file("${CMAKE_BINARY_DIR}/Cutelee${Cutelee_VERSION_MAJOR}ConfigVersion.cmake"
write_basic_package_version_file("${CMAKE_BINARY_DIR}/Cutelee${Cutelee_VERSION_MAJOR}Qt${QT_VERSION_MAJOR}ConfigVersion.cmake"
VERSION ${Cutelee_VERSION}
COMPATIBILITY AnyNewerVersion
)

install(FILES
"${CMAKE_BINARY_DIR}/Cutelee${Cutelee_VERSION_MAJOR}Config.cmake"
"${CMAKE_BINARY_DIR}/Cutelee${Cutelee_VERSION_MAJOR}ConfigVersion.cmake"
"${CMAKE_BINARY_DIR}/Cutelee${Cutelee_VERSION_MAJOR}Qt${QT_VERSION_MAJOR}Config.cmake"
"${CMAKE_BINARY_DIR}/Cutelee${Cutelee_VERSION_MAJOR}Qt${QT_VERSION_MAJOR}ConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Common
)

install(FILES
"${Cutelee_MODULE_DIR}/CuteleeMacros.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
RENAME "Cutelee${Cutelee_VERSION_MAJOR}Qt${QT_VERSION_MAJOR}Macros.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}/"
COMPONENT Common
)

install(EXPORT cutelee_targets
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
NAMESPACE Cutelee${Cutelee_VERSION_MAJOR}::
FILE CuteleeTargets.cmake
DESTINATION ${CMAKECONFIG_INSTALL_DIR}
FILE "Cutelee${Cutelee_VERSION_MAJOR}Qt${QT_VERSION_MAJOR}Targets.cmake"
NAMESPACE Cutelee::
COMPONENT Common
)

Expand Down
8 changes: 4 additions & 4 deletions cmake/modules/CuteleeConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ if (Cutelee@Cutelee_VERSION_MAJOR@_FIND_COMPONENTS)
set(RequiredQtComponents ${RequiredQtComponents} Core)
endif()
endforeach()
find_package(Qt5 REQUIRED ${RequiredQtComponents})
find_package(Qt@QT_VERSION_MAJOR@ REQUIRED ${RequiredQtComponents})
else()
find_package(Qt5Gui REQUIRED)
find_package(Qt@QT_VERSION_MAJOR@Gui REQUIRED)
endif()

include("${CMAKE_CURRENT_LIST_DIR}/CuteleeTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/Cutelee@Cutelee_VERSION_MAJOR@Qt@QT_VERSION_MAJOR@Targets.cmake")

include("${CMAKE_CURRENT_LIST_DIR}/CuteleeMacros.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/Cutelee@Cutelee_VERSION_MAJOR@Qt@QT_VERSION_MAJOR@Macros.cmake")
90 changes: 44 additions & 46 deletions templates/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,33 @@ set_source_files_properties(taglibraryinterface.h PROPERTIES
SKIP_AUTOMOC TRUE
)

set(cutelee_templates_HEADERS
cutelee_templates.h
abstractlocalizer.h
cachingloaderdecorator.h
context.h
engine.h
exception.h
filter.h
filterexpression.h
${CMAKE_CURRENT_BINARY_DIR}/cutelee_templates_export.h
${CMAKE_CURRENT_BINARY_DIR}/cutelee_version.h
metatype.h
node.h
outputstream.h
parser.h
qtlocalizer.h
rendercontext.h
safestring.h
taglibraryinterface.h
template.h
templateloader.h
typeaccessor.h
token.h
util.h
variable.h
)

add_library(Cutelee_Templates SHARED
abstractlocalizer.cpp
cachingloaderdecorator.cpp
Expand All @@ -36,24 +63,21 @@ add_library(Cutelee_Templates SHARED
util.cpp
variable.cpp

# Help IDEs find some non-compiled files.
customtyperegistry_p.h
engine_p.h
exception.h
cutelee_tags_p.h
cutelee_templates.h
lexer_p.h
metaenumvariable_p.h
nodebuiltins_p.h
nulllocalizer_p.h
pluginpointer_p.h
statemachine_p.h
taglibraryinterface.h
template_p.h
textprocessingmachine_p.h
token.h
typeaccessor.h
customtyperegistry_p.h
engine_p.h
cutelee_tags_p.h
lexer_p.h
metaenumvariable_p.h

${cutelee_templates_HEADERS}
)

add_library(Cutelee::Templates ALIAS Cutelee_Templates)
generate_export_header(Cutelee_Templates)
set_property(TARGET Cutelee_Templates PROPERTY
Expand Down Expand Up @@ -123,41 +147,15 @@ set_target_properties(Cutelee_Templates PROPERTIES
SOVERSION ${Cutelee_VERSION_MAJOR}
)

install(TARGETS Cutelee_Templates EXPORT cutelee_targets
RUNTIME DESTINATION bin COMPONENT Templates
LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT Templates
ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT Templates
INCLUDES DESTINATION include
)

install(FILES
abstractlocalizer.h
cachingloaderdecorator.h
context.h
engine.h
exception.h
filter.h
filterexpression.h
${CMAKE_CURRENT_BINARY_DIR}/cutelee_templates_export.h
${CMAKE_CURRENT_BINARY_DIR}/cutelee_version.h
metatype.h
node.h
outputstream.h
parser.h
qtlocalizer.h
rendercontext.h
safestring.h
taglibraryinterface.h
template.h
templateloader.h
typeaccessor.h
token.h
util.h
variable.h
DESTINATION include/cutelee COMPONENT Templates
target_include_directories(Cutelee_Templates PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/cutelee${PROJECT_VERSION_MAJOR}-qt${QT_VERSION_MAJOR}>
)

install(FILES
cutelee_templates.h
DESTINATION include COMPONENT Templates
set_property(TARGET Cutelee_Templates PROPERTY PUBLIC_HEADER ${cutelee_templates_HEADERS})
install(TARGETS Cutelee_Templates EXPORT cutelee_targets
RUNTIME DESTINATION bin COMPONENT Templates
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Templates
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Templates
PUBLIC_HEADER DESTINATION include/cutelee${PROJECT_VERSION_MAJOR}-qt${QT_VERSION_MAJOR}/cutelee
)
43 changes: 21 additions & 22 deletions textdocument/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
set(cutelee_textdocument_HEADERS
cutelee_textdocument.h
abstractmarkupbuilder.h
bbcodebuilder.h
markupdirector.h
plaintextmarkupbuilder.h
texthtmlbuilder.h
mediawikimarkupbuilder.h
${CMAKE_CURRENT_BINARY_DIR}/cutelee_textdocument_export.h
)

add_library(Cutelee_TextDocument SHARED
bbcodebuilder.cpp
Expand All @@ -6,11 +16,10 @@ add_library(Cutelee_TextDocument SHARED
texthtmlbuilder.cpp
mediawikimarkupbuilder.cpp

# Help IDEs find some non-compiled files.
abstractmarkupbuilder.h
cutelee_textdocument.h
markupdirector_p.h
${cutelee_textdocument_HEADERS}
)

generate_export_header(Cutelee_TextDocument)
add_library(Cutelee::TextDocument ALIAS Cutelee_TextDocument)
set_property(TARGET Cutelee_TextDocument PROPERTY
Expand Down Expand Up @@ -44,25 +53,15 @@ set_target_properties(Cutelee_TextDocument PROPERTIES
SOVERSION ${Cutelee_VERSION_MAJOR}
)

install(TARGETS Cutelee_TextDocument EXPORT cutelee_targets
RUNTIME DESTINATION bin COMPONENT TextDocument
LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT TextDocument
ARCHIVE DESTINATION ${LIB_INSTALL_DIR} COMPONENT TextDocument
INCLUDES DESTINATION include
)

install(FILES
abstractmarkupbuilder.h
bbcodebuilder.h
markupdirector.h
plaintextmarkupbuilder.h
texthtmlbuilder.h
mediawikimarkupbuilder.h
${CMAKE_CURRENT_BINARY_DIR}/cutelee_textdocument_export.h
DESTINATION include/cutelee COMPONENT TextDocument
target_include_directories(Cutelee_TextDocument PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/cutelee${PROJECT_VERSION_MAJOR}-qt${QT_VERSION_MAJOR}>
)

install(FILES
cutelee_textdocument.h
DESTINATION include COMPONENT TextDocument
set_property(TARGET Cutelee_TextDocument PROPERTY PUBLIC_HEADER ${cutelee_textdocument_HEADERS})
install(TARGETS Cutelee_TextDocument EXPORT cutelee_targets
RUNTIME DESTINATION bin COMPONENT TextDocument
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT TextDocument
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT TextDocument
PUBLIC_HEADER DESTINATION include/cutelee${PROJECT_VERSION_MAJOR}-qt${QT_VERSION_MAJOR}/cutelee
)

0 comments on commit 10903d7

Please sign in to comment.