Warning, /libraries/futuresql/src/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2022 Jonah BrĂ¼chert <jbb@kaidan.im>
0002 #
0003 # SPDX-License-Identifier: BSD-2-Clause
0004 
0005 # Different target names for Qt5 and Qt6 builds
0006 set(FUTURESQL_TARGET futuresql${QT_MAJOR_VERSION})
0007 set(FUTURESQL_NAME FutureSQL${QT_MAJOR_VERSION})
0008 
0009 add_library(${FUTURESQL_TARGET}
0010     threadeddatabase.cpp
0011     threadeddatabase.h
0012     threadeddatabase_p.h
0013 )
0014 
0015 target_link_libraries(${FUTURESQL_TARGET} PUBLIC Qt::Core Qt::Sql)
0016 
0017 add_library(FutureSQL${QT_MAJOR_VERSION}::FutureSQL ALIAS ${FUTURESQL_TARGET})
0018 
0019 set(FUTURESQL_INSTALL_INCLUDEDIR "${KDE_INSTALL_INCLUDEDIR}/${FUTURESQL_NAME}")
0020 
0021 target_include_directories(${FUTURESQL_TARGET}
0022     PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
0023     INTERFACE "$<INSTALL_INTERFACE:${FUTURESQL_INSTALL_INCLUDEDIR}>"
0024 )
0025 
0026 ecm_setup_version(
0027     PROJECT
0028     VARIABLE_PREFIX ${FUTURESQL_NAME}
0029     VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/futuresql_version.h"
0030     PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/${FUTURESQL_NAME}ConfigVersion.cmake"
0031 )
0032 
0033 set_target_properties(${FUTURESQL_TARGET}
0034     PROPERTIES
0035     EXPORT_NAME FutureSQL
0036     SOVERSION 0
0037 )
0038 
0039 ecm_generate_export_header(${FUTURESQL_TARGET}
0040     VERSION ${PROJECT_VERSION}
0041     BASE_NAME FutureSQL
0042 )
0043 
0044 install(TARGETS ${FUTURESQL_TARGET}
0045     EXPORT FutureSQLTargets
0046     RUNTIME DESTINATION ${KDE_INSTALL_BINDIR}
0047     LIBRARY DESTINATION ${KDE_INSTALL_LIBDIR}
0048     ARCHIVE DESTINATION ${KDE_INSTALL_LIBDIR}
0049     COMPONENT Devel
0050 )
0051 
0052 set(FutureSQL_HEADERS threadeddatabase.h)
0053 
0054 ecm_generate_headers(FutureSQL_CAMEL_CASE_HEADERS
0055     HEADER_NAMES
0056     ThreadedDatabase
0057 
0058     REQUIRED_HEADERS
0059     ${FutureSQL_HEADERS}
0060 )
0061 
0062 set(FutureSQL_HEADERS ${FutureSQL_HEADERS} threadeddatabase_p.h ${CMAKE_CURRENT_BINARY_DIR}/futuresql_export.h)
0063 
0064 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/${FUTURESQL_NAME}")
0065 
0066 configure_package_config_file(
0067     "${CMAKE_CURRENT_SOURCE_DIR}/FutureSQLConfig.cmake.in"
0068     "${CMAKE_CURRENT_BINARY_DIR}/${FUTURESQL_NAME}Config.cmake"
0069     INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0070     PATH_VARS  CMAKE_INSTALL_PREFIX
0071 )
0072 
0073 install(FILES ${FutureSQL_HEADERS}
0074         DESTINATION ${FUTURESQL_INSTALL_INCLUDEDIR}
0075         COMPONENT Devel)
0076 install(FILES ${FutureSQL_CAMEL_CASE_HEADERS}
0077         DESTINATION ${FUTURESQL_INSTALL_INCLUDEDIR}
0078         COMPONENT Devel)
0079 
0080 install(FILES
0081     "${CMAKE_CURRENT_BINARY_DIR}/${FUTURESQL_NAME}Config.cmake"
0082     "${CMAKE_CURRENT_BINARY_DIR}/${FUTURESQL_NAME}ConfigVersion.cmake"
0083     DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0084     COMPONENT Devel
0085 )
0086 
0087 install(EXPORT FutureSQLTargets
0088     DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0089     FILE FutureSQLTargets.cmake
0090     NAMESPACE FutureSQL${QT_MAJOR_VERSION}::
0091 )