summaryrefslogtreecommitdiffstats
path: root/src/fmt/test/find-package-test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/fmt/test/find-package-test
parentInitial commit. (diff)
downloadceph-6d07fdb6bb33b1af39833b850bb6cf8af79fe293.tar.xz
ceph-6d07fdb6bb33b1af39833b850bb6cf8af79fe293.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/fmt/test/find-package-test')
-rw-r--r--src/fmt/test/find-package-test/CMakeLists.txt17
-rw-r--r--src/fmt/test/find-package-test/main.cc6
2 files changed, 23 insertions, 0 deletions
diff --git a/src/fmt/test/find-package-test/CMakeLists.txt b/src/fmt/test/find-package-test/CMakeLists.txt
new file mode 100644
index 000000000..513575570
--- /dev/null
+++ b/src/fmt/test/find-package-test/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 3.1.0)
+
+project(fmt-test)
+
+find_package(FMT REQUIRED)
+
+add_executable(library-test main.cc)
+target_link_libraries(library-test fmt::fmt)
+target_compile_options(library-test PRIVATE ${PEDANTIC_COMPILE_FLAGS})
+target_include_directories(library-test PUBLIC SYSTEM .)
+
+if (TARGET fmt::fmt-header-only)
+ add_executable(header-only-test main.cc)
+ target_link_libraries(header-only-test fmt::fmt-header-only)
+ target_compile_options(header-only-test PRIVATE ${PEDANTIC_COMPILE_FLAGS})
+ target_include_directories(header-only-test PUBLIC SYSTEM .)
+endif ()
diff --git a/src/fmt/test/find-package-test/main.cc b/src/fmt/test/find-package-test/main.cc
new file mode 100644
index 000000000..f39f377cc
--- /dev/null
+++ b/src/fmt/test/find-package-test/main.cc
@@ -0,0 +1,6 @@
+#include "fmt/format.h"
+
+int main(int argc, char** argv) {
+ for(int i = 0; i < argc; ++i)
+ fmt::print("{}: {}\n", i, argv[i]);
+}