cmake: Add option no_floats
When set, the preprocessor symbol CBOR_NO_FLOAT will be set to 1.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 67b9d95..195c780 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,6 +23,7 @@
option ( coveralls "Generate coveralls data" ON )
option ( coveralls_send "Send data to coveralls site" OFF )
option ( build_docs "Create docs using Doxygen" ${DOXYGEN_FOUND} )
+option ( no_floats "Build without floating point support" OFF )
set ( dist_dir ${CMAKE_BINARY_DIR}/dist )
set ( prefix ${CMAKE_INSTALL_PREFIX} )
@@ -70,6 +71,10 @@
message ( FATAL_ERROR "unhandled compiler id: ${CMAKE_C_COMPILER_ID}" )
endif ()
+if ( no_floats )
+ add_definitions(-DCBOR_NO_FLOAT)
+endif()
+
if ( verbose )
set ( CMAKE_VERBOSE_MAKEFILE ON )
endif ()