aboutsummaryrefslogtreecommitdiff
path: root/CMake/FindCBF.cmake
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-05-17 15:31:45 +0200
committerThomas White <taw@physics.org>2018-05-17 15:39:22 +0200
commita9f48b6507b0326a34b84d7600f5eb791993eeb1 (patch)
treeb89b6e73477125336c35c6d7d9996bd8ebae7fd7 /CMake/FindCBF.cmake
parent87fd650abf11da75e7abd2ff90821cf7cb041b91 (diff)
parenta9f4c0ff4376267d90d6e8f9a0b6c012ec0588a4 (diff)
Merge branch 'tom/cmake'
Diffstat (limited to 'CMake/FindCBF.cmake')
-rw-r--r--CMake/FindCBF.cmake31
1 files changed, 31 insertions, 0 deletions
diff --git a/CMake/FindCBF.cmake b/CMake/FindCBF.cmake
new file mode 100644
index 00000000..e51fd01a
--- /dev/null
+++ b/CMake/FindCBF.cmake
@@ -0,0 +1,31 @@
+# - Find CBF
+# Find the native CBF includes and library
+#
+# CBF_INCLUDES - where to find cbf.h
+# CBF_LIBRARIES - List of libraries when using CBF.
+# CBF_FOUND - True if CBF found.
+
+if (CBF_INCLUDES)
+ # Already in cache, be silent
+ set (CBF_FIND_QUIETLY TRUE)
+endif (CBF_INCLUDES)
+
+find_path (CBF_CBF_INCLUDES cbf/cbf.h)
+find_path (CBFLIB_CBF_INCLUDES cbflib/cbf.h)
+
+if (NOT CBF_CBF_INCLUDES MATCHES "NOTFOUND")
+ message(STATUS "Found cbf/cbf.h in ${CBF_CBF_INCLUDES}")
+ set(CBF_INCLUDES ${CBF_CBF_INCLUDES})
+ set(HAVE_CBF_CBF_H ON)
+elseif (NOT CBFLIB_CBF_INCLUDES MATCHES "NOTFOUND")
+ message(STATUS "Found cbflib/cbf.h in ${CBFLIB_CBF_INCLUDES}")
+ set(CBF_INCLUDES ${CBFLIB_CBF_INCLUDES})
+ set(HAVE_CBFLIB_CBF_H ON)
+endif (NOT CBF_CBF_INCLUDES MATCHES "NOTFOUND")
+
+find_library (CBF_LIBRARIES NAMES cbf)
+
+# handle the QUIETLY and REQUIRED arguments and set CBF_FOUND to TRUE if
+# all listed variables are TRUE
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (CBF DEFAULT_MSG CBF_LIBRARIES CBF_INCLUDES)