aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-08-09 10:16:26 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-08-09 10:18:39 +0900
commita18cfa5877798e50e4222726fa63fcef5ee248bb (patch)
treecdaae0cde84aa5ce0cd09a5a703907764ec39af3 /CMakeLists.txt
parent62674f731b0e46d8a413e26ca1c9da27fd9aae9a (diff)
downloadlibquotient-a18cfa5877798e50e4222726fa63fcef5ee248bb.tar.gz
libquotient-a18cfa5877798e50e4222726fa63fcef5ee248bb.zip
Rename CMake/pkg-config related parts
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt63
1 files changed, 32 insertions, 31 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()