From 02f8f9ef651e54f586dbbbf8bbccee10cde8070b Mon Sep 17 00:00:00 2001 From: Jeroen Oomkes Date: Sat, 20 Oct 2018 00:27:31 +0200 Subject: [PATCH] Cmake support (#55) * Added cmake support. This builds an object library target that can be included with generator expression in the executable. --- CMakeLists.txt | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 3 ++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..3d3bf2b --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,49 @@ +cmake_minimum_required(VERSION 3.1) + +set(CMAKE_CXX_STANDARD 11) + +find_package(Qt5 REQUIRED + Core + Qml + ) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) # This is to find generated *.moc and *.h files in build dir + +add_library(SortFilterProxyModel OBJECT + qqmlsortfilterproxymodel.cpp + filters/filter.cpp + filters/filtercontainer.cpp + filters/rolefilter.cpp + filters/valuefilter.cpp + filters/indexfilter.cpp + filters/regexpfilter.cpp + filters/rangefilter.cpp + filters/expressionfilter.cpp + filters/filtercontainerfilter.cpp + filters/anyoffilter.cpp + filters/alloffilter.cpp + filters/filtersqmltypes.cpp + sorters/sorter.cpp + sorters/sortercontainer.cpp + sorters/rolesorter.cpp + sorters/stringsorter.cpp + sorters/expressionsorter.cpp + sorters/sortersqmltypes.cpp + proxyroles/proxyrole.cpp + proxyroles/proxyrolecontainer.cpp + proxyroles/joinrole.cpp + proxyroles/switchrole.cpp + proxyroles/expressionrole.cpp + proxyroles/proxyrolesqmltypes.cpp + proxyroles/singlerole.cpp + proxyroles/regexprole.cpp + sorters/filtersorter.cpp + proxyroles/filterrole.cpp + ) + +target_include_directories(SortFilterProxyModel PUBLIC + ${CMAKE_CURRENT_LIST_DIR} + $ + $ + ) diff --git a/README.md b/README.md index c2a296e..2a0cf7c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ Install ##### Without qpm : 1. clone or download this repository -2. add `include (/SortFilterProxyModel.pri)` in your `.pro` +2. * `qmake` add `include (/SortFilterProxyModel.pri)` in your `.pro` + * `CMake` add $ to the sources of your executable target in your cmake project 3. `import SortFilterProxyModel 0.2` to use this library in your QML files Sample Usage