diff options
-rw-r--r-- | CMakeLists.txt | 63 | ||||
-rw-r--r-- | Quotient.pc.in (renamed from QMatrixClient.pc.in) | 4 | ||||
-rw-r--r-- | cmake/QMatrixClientConfig.cmake | 4 | ||||
-rw-r--r-- | cmake/QuotientConfig.cmake | 4 | ||||
-rw-r--r-- | examples/CMakeLists.txt | 8 |
5 files changed, 42 insertions, 41 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 44f4df9c..e0ff6f19 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required(VERSION 3.5) set(API_VERSION "0.6") -project(qmatrixclient VERSION "${API_VERSION}.0" LANGUAGES CXX) +project(Quotient VERSION "${API_VERSION}.0" LANGUAGES CXX) -option(QMATRIXCLIENT_INSTALL_EXAMPLE "install qmc-example application" ON) +option(QUOTIENT_INSTALL_EXAMPLE "install qmc-example application" ON) include(CheckCXXCompilerFlag) if (NOT WIN32) @@ -81,7 +81,7 @@ endif() message( STATUS ) message( STATUS "=============================================================================" ) -message( STATUS " libQuotient Build Information" ) +message( STATUS " ${PROJECT_NAME} Build Information" ) message( STATUS "=============================================================================" ) message( STATUS "Version: ${PROJECT_VERSION}, API version: ${API_VERSION}") if (CMAKE_BUILD_TYPE) @@ -118,7 +118,7 @@ message( STATUS "=============================================================== message( STATUS ) # Set up source files -set(libqmatrixclient_SRCS +set(lib_SRCS lib/networkaccessmanager.cpp lib/connectiondata.cpp lib/connection.cpp @@ -213,27 +213,27 @@ endif() set(example_SRCS examples/qmc-example.cpp) -add_library(QMatrixClient ${libqmatrixclient_SRCS} ${api_SRCS}) -set_property(TARGET QMatrixClient PROPERTY VERSION "${PROJECT_VERSION}") -set_property(TARGET QMatrixClient PROPERTY SOVERSION ${API_VERSION} ) -set_property(TARGET QMatrixClient PROPERTY - INTERFACE_QMatrixClient_MAJOR_VERSION ${API_VERSION}) -set_property(TARGET QMatrixClient APPEND PROPERTY - COMPATIBLE_INTERFACE_STRING QMatrixClient_MAJOR_VERSION) +add_library(${PROJECT_NAME} ${lib_SRCS} ${api_SRCS}) +set_property(TARGET ${PROJECT_NAME} PROPERTY VERSION "${PROJECT_VERSION}") +set_property(TARGET ${PROJECT_NAME} PROPERTY SOVERSION ${API_VERSION} ) +set_property(TARGET ${PROJECT_NAME} PROPERTY + INTERFACE_${PROJECT_NAME}_MAJOR_VERSION ${API_VERSION}) +set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY + COMPATIBLE_INTERFACE_STRING ${PROJECT_NAME}_MAJOR_VERSION) -target_include_directories(QMatrixClient PUBLIC +target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> ) -target_link_libraries(QMatrixClient QtOlm Qt5::Core Qt5::Network Qt5::Gui Qt5::Multimedia) +target_link_libraries(${PROJECT_NAME} QtOlm Qt5::Core Qt5::Network Qt5::Gui Qt5::Multimedia) add_executable(qmc-example ${example_SRCS}) -target_link_libraries(qmc-example Qt5::Core QMatrixClient) -configure_file(QMatrixClient.pc.in ${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient.pc @ONLY NEWLINE_STYLE UNIX) +target_link_libraries(qmc-example Qt5::Core Quotient) +configure_file(Quotient.pc.in ${CMAKE_CURRENT_BINARY_DIR}/Quotient.pc @ONLY NEWLINE_STYLE UNIX) # Installation -install(TARGETS QMatrixClient EXPORT QMatrixClientTargets +install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} @@ -245,37 +245,38 @@ include(CMakePackageConfigHelpers) # NB: SameMajorVersion doesn't really work yet, as we're within 0.x trail. # Maybe consider jumping the gun and releasing 1.0, as semver advises? write_basic_package_version_file( - "${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient/QMatrixClientConfigVersion.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/QuotientConfigVersion.cmake" COMPATIBILITY SameMajorVersion ) -export(PACKAGE QMatrixClient) -export(EXPORT QMatrixClientTargets - FILE "${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient/QMatrixClientTargets.cmake") -configure_file(cmake/QMatrixClientConfig.cmake - "${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient/QMatrixClientConfig.cmake" +export(PACKAGE ${PROJECT_NAME}) +export(EXPORT ${PROJECT_NAME}Targets + FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}Targets.cmake") +configure_file(cmake/QuotientConfig.cmake + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/QuotientConfig.cmake" COPYONLY ) -set(ConfigFilesLocation "${CMAKE_INSTALL_LIBDIR}/cmake/QMatrixClient") -install(EXPORT QMatrixClientTargets - FILE QMatrixClientTargets.cmake DESTINATION ${ConfigFilesLocation}) +set(ConfigFilesLocation "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}") +install(EXPORT ${PROJECT_NAME}Targets + FILE ${PROJECT_NAME}Targets.cmake DESTINATION ${ConfigFilesLocation}) -install(FILES cmake/QMatrixClientConfig.cmake - "${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient/QMatrixClientConfigVersion.cmake" +install(FILES cmake/QuotientConfig.cmake + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/QuotientConfigVersion.cmake" DESTINATION ${ConfigFilesLocation} ) # Only available from CMake 3.7; reserved for future use -#install(EXPORT_ANDROID_MK QMatrixClientTargets DESTINATION share/ndk-modules) +#install(EXPORT_ANDROID_MK QuotientTargets DESTINATION share/ndk-modules) if (WIN32) install(FILES mime/packages/freedesktop.org.xml DESTINATION mime/packages) endif (WIN32) -if (QMATRIXCLIENT_INSTALL_EXAMPLE) +if (QUOTIENT_INSTALL_EXAMPLE) install(TARGETS qmc-example RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif (QMATRIXCLIENT_INSTALL_EXAMPLE) +endif (QUOTIENT_INSTALL_EXAMPLE) if (UNIX AND NOT APPLE) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Quotient.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() diff --git a/QMatrixClient.pc.in b/Quotient.pc.in index efb41498..6eb1672e 100644 --- a/QMatrixClient.pc.in +++ b/Quotient.pc.in @@ -3,8 +3,8 @@ exec_prefix=${prefix} includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ -Name: QMatrixClient +Name: Quotient Description: A Qt5 library to write cross-platfrom clients for Matrix Version: @API_VERSION@ Cflags: -I${includedir} -Libs: -L${libdir} -lQMatrixClient +Libs: -L${libdir} -lQuotient diff --git a/cmake/QMatrixClientConfig.cmake b/cmake/QMatrixClientConfig.cmake deleted file mode 100644 index 64180cca..00000000 --- a/cmake/QMatrixClientConfig.cmake +++ /dev/null @@ -1,4 +0,0 @@ -include(CMakeFindDependencyMacro) - -find_dependency(QtOlm) -include("${CMAKE_CURRENT_LIST_DIR}/QMatrixClientTargets.cmake") diff --git a/cmake/QuotientConfig.cmake b/cmake/QuotientConfig.cmake new file mode 100644 index 00000000..6b842f60 --- /dev/null +++ b/cmake/QuotientConfig.cmake @@ -0,0 +1,4 @@ +include(CMakeFindDependencyMacro) + +find_dependency(QtOlm) +include("${CMAKE_CURRENT_LIST_DIR}/QuotientTargets.cmake") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index cd5e15ed..1f512958 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -48,8 +48,8 @@ endforeach () find_package(Qt5 5.6 REQUIRED Network Gui Multimedia) get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE) -find_package(QMatrixClient REQUIRED) -get_filename_component(QMC_Prefix "${QMatrixClient_DIR}/../.." ABSOLUTE) +find_package(Quotient REQUIRED) +get_filename_component(QMC_Prefix "${Quotient_DIR}/../.." ABSOLUTE) message( STATUS "qmc-example configuration:" ) if (CMAKE_BUILD_TYPE) @@ -57,12 +57,12 @@ if (CMAKE_BUILD_TYPE) endif(CMAKE_BUILD_TYPE) message( STATUS " Compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}" ) message( STATUS " Qt: ${Qt5_VERSION} at ${Qt5_Prefix}" ) -message( STATUS " QMatrixClient: ${QMatrixClient_VERSION} at ${QMC_Prefix}" ) +message( STATUS " Quotient: ${Quotient_VERSION} at ${QMC_Prefix}" ) set(example_SRCS qmc-example.cpp) add_executable(qmc-example ${example_SRCS}) -target_link_libraries(qmc-example Qt5::Core QMatrixClient) +target_link_libraries(qmc-example Qt5::Core Quotient) # Installation |