aboutsummaryrefslogtreecommitdiff
path: root/doc/api/cplusplus/examples/CMakeLists.txt
diff options
context:
space:
mode:
authorAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2016-07-19 22:50:04 -0700
committerAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2016-11-30 08:25:19 -0800
commita8c9e5d64d9a5a0382fccaa98220d22cbaf9b55f (patch)
treecfded8a49cfc5b7e52ab2615d24a74c5fa7b479e /doc/api/cplusplus/examples/CMakeLists.txt
parent9cb3984eb0e0829d4f05b6116f6ae572bc44d21b (diff)
downloadpaludis-a8c9e5d64d9a5a0382fccaa98220d22cbaf9b55f.tar.gz
paludis-a8c9e5d64d9a5a0382fccaa98220d22cbaf9b55f.tar.xz
build: introduce cmake based build system
Diffstat (limited to 'doc/api/cplusplus/examples/CMakeLists.txt')
-rw-r--r--doc/api/cplusplus/examples/CMakeLists.txt46
1 files changed, 46 insertions, 0 deletions
diff --git a/doc/api/cplusplus/examples/CMakeLists.txt b/doc/api/cplusplus/examples/CMakeLists.txt
new file mode 100644
index 000000000..11bbb349e
--- /dev/null
+++ b/doc/api/cplusplus/examples/CMakeLists.txt
@@ -0,0 +1,46 @@
+
+# TODO(compnerd) populate PROJECT_VERSION_TWEAK and PALUDIS_GIT_HEAD
+add_definitions(-DPALUDIS_PACKAGE="${PROJECT_NAME}"
+ -DPALUDIS_VERSION_MAJOR=${PROJECT_VERSION_MAJOR}
+ -DPALUDIS_VERSION_MINOR=${PROJECT_VERSION_MINOR}
+ -DPALUDIS_VERSION_MICRO=${PROJECT_VERSION_PATCH}
+ -DPALUDIS_VERSION_SUFFIX=""
+ -DPALUDIS_GIT_HEAD="")
+
+paludis_add_library(libpaludisexamples
+ STATIC_LIBRARY
+ "${CMAKE_CURRENT_SOURCE_DIR}/example_command_line.cc")
+target_link_libraries(libpaludisexamples
+ INTERFACE
+ libpaludisargs)
+
+function(add_example example)
+ add_executable(example_${example}
+ "${CMAKE_CURRENT_SOURCE_DIR}/example_${example}.cc")
+ target_link_libraries(example_${example}
+ PRIVATE
+ libpaludisexamples
+ libpaludis
+ libpaludisutil)
+endfunction()
+
+foreach(example
+ about
+ action
+ contents
+ dep_label
+ dep_spec
+ dep_spec_flattener
+ environment
+ package_id
+ mask
+ metadata_key
+ repository
+ match_package
+ selection
+ version_operator
+ version_spec
+ name)
+ add_example(${example})
+endforeach()
+