-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We can now install the headers, which allows KDAlgorithms to be packaged by Brew and other package managers. Added a test, called by CI, which tests building a standalone example against a system-wide KDAlgorithms.
- Loading branch information
Showing
6 changed files
with
110 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
@PACKAGE_INIT@ | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/KDAlgorithmsTargets.cmake") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Tests that users can use find_package and "link" against KDAlgorithms target | ||
# This test is built by the GitHub CI workflow | ||
|
||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project(test_find_package LANGUAGES CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
find_package(KDAlgorithms REQUIRED) | ||
|
||
add_executable(${PROJECT_NAME} main.cpp) | ||
|
||
target_link_libraries(${PROJECT_NAME} PRIVATE KDAB::kdalgorithms) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/**************************************************************************** | ||
** | ||
** This file is part of KDAlgorithms | ||
** | ||
** SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com> | ||
** | ||
** SPDX-License-Identifier: MIT | ||
** | ||
****************************************************************************/ | ||
|
||
#include <kdalgorithms/kdalgorithms.h> | ||
|
||
#include <iostream> | ||
#include <string> | ||
#include <vector> | ||
|
||
int main() | ||
{ | ||
auto vec = kdalgorithms::iota(1, 100); | ||
auto odds = kdalgorithms::filtered(vec, [](int i) { return i % 2 == 1; }); | ||
auto result = kdalgorithms::accumulate(odds, [](const std::string &partial, int value) { | ||
return partial + "," + std::to_string(value); | ||
}); | ||
|
||
std::cout << result << "\n"; | ||
|
||
return 0; | ||
} |