aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt18
1 files changed, 10 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce4af9a8..58509eae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,7 @@ endif()
set(API_VERSION "0.6")
project(Quotient VERSION "${API_VERSION}.0" LANGUAGES CXX)
-option(QUOTIENT_INSTALL_EXAMPLE "install qmc-example application" ON)
+option(${PROJECT_NAME}_INSTALL_TESTS "install quotest (former qmc-example) application" ON)
include(CheckCXXCompilerFlag)
if (NOT WIN32)
@@ -52,7 +52,7 @@ else()
endforeach ()
endif()
-find_package(Qt5 5.9 REQUIRED Network Gui Multimedia)
+find_package(Qt5 5.9 REQUIRED Network Gui Multimedia Test)
get_filename_component(Qt5_Prefix "${Qt5_DIR}/../../../.." ABSOLUTE)
if ((NOT DEFINED USE_INTREE_LIBQOLM OR USE_INTREE_LIBQOLM)
@@ -218,7 +218,7 @@ if (MATRIX_DOC_PATH AND GTAD_PATH)
endif()
endif()
-set(example_SRCS examples/qmc-example.cpp)
+set(tests_SRCS tests/quotest.cpp)
add_library(${PROJECT_NAME} ${lib_SRCS} ${api_SRCS})
set_target_properties(${PROJECT_NAME} PROPERTIES
@@ -237,8 +237,10 @@ target_include_directories(${PROJECT_NAME} PUBLIC
)
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 Quotient)
+set(TEST_BINARY quotest)
+add_executable(${TEST_BINARY} ${tests_SRCS})
+target_link_libraries(${TEST_BINARY} Qt5::Core Qt5::Test Quotient)
+
configure_file(Quotient.pc.in ${CMAKE_CURRENT_BINARY_DIR}/Quotient.pc @ONLY NEWLINE_STYLE UNIX)
# Installation
@@ -281,9 +283,9 @@ if (WIN32)
install(FILES mime/packages/freedesktop.org.xml DESTINATION mime/packages)
endif (WIN32)
-if (QUOTIENT_INSTALL_EXAMPLE)
- install(TARGETS qmc-example RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
-endif (QUOTIENT_INSTALL_EXAMPLE)
+if (QUOTIENT_INSTALL_TESTS)
+ install(TARGETS ${TEST_BINARY} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+endif ()
if (UNIX AND NOT APPLE)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Quotient.pc