summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorPeter Colberg <peter@colberg.org>2015-12-29 00:29:42 -0500
committerPeter Colberg <peter@colberg.org>2015-12-29 00:29:42 -0500
commit4803e6a493f9233567f6fe6923facafd0495e7d7 (patch)
tree6056aa24807d0723ee4c7c11711e20a8feea6597 /cmake
parent3f17756e67e8da2e93f796ca6e7c1bb61b7b00b5 (diff)
downloadtwinkle-4803e6a493f9233567f6fe6923facafd0495e7d7.tar
twinkle-4803e6a493f9233567f6fe6923facafd0495e7d7.tar.gz
twinkle-4803e6a493f9233567f6fe6923facafd0495e7d7.tar.lz
twinkle-4803e6a493f9233567f6fe6923facafd0495e7d7.tar.xz
twinkle-4803e6a493f9233567f6fe6923facafd0495e7d7.zip
Add option WITH_GSM to use external gsm library
This permits distributions to build against a packaged gsm library.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindGsm.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmake/FindGsm.cmake b/cmake/FindGsm.cmake
new file mode 100644
index 0000000..85f367b
--- /dev/null
+++ b/cmake/FindGsm.cmake
@@ -0,0 +1,17 @@
+FIND_PATH(GSM_INCLUDE_DIR gsm/gsm.h)
+FIND_LIBRARY(GSM_LIBRARY NAMES gsm)
+
+IF(GSM_INCLUDE_DIR AND GSM_LIBRARY)
+ SET(GSM_FOUND TRUE)
+ENDIF(GSM_INCLUDE_DIR AND GSM_LIBRARY)
+
+IF(GSM_FOUND)
+ IF (NOT Gsm_FIND_QUIETLY)
+ MESSAGE(STATUS "Found gsm includes: ${GSM_INCLUDE_DIR}/gsm/config.h")
+ MESSAGE(STATUS "Found gsm library: ${GSM_LIBRARY}")
+ ENDIF (NOT Gsm_FIND_QUIETLY)
+ELSE(GSM_FOUND)
+ IF (Gsm_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could NOT find gsm development files")
+ ENDIF (Gsm_FIND_REQUIRED)
+ENDIF(GSM_FOUND)