+set( CMAKE_BUILD_TYPE Release )
+add_definitions( -Wall -D_FILE_OFFSET_BITS=64 )
+
+# -----------------------------------------------
+# handle platform-/environment-specific defines
+
+# If planning to run in Node.js environment, run:
+# cmake -DEnableNodeJS=true
+if( EnableNodeJS )
+ add_definitions( -DSYSTEM_NODEJS=1 )
+endif()
+
+# If running on SunOS
+if( "${CMAKE_SYSTEM_NAME}" MATCHES "SunOS" )
+ add_definitions( -DSUN_OS )
+endif()
+
+# -------------------------------------------