CMakeLists.txt
changeset 1159 06fa9794e5c6
parent 1158 4b1bc199dc1f
child 1171 e4ca84e1d289
--- a/CMakeLists.txt	Mon Feb 21 23:55:58 2011 -0500
+++ b/CMakeLists.txt	Tue Feb 22 00:16:56 2011 -0500
@@ -358,6 +358,9 @@
 #CMake's SWIG support is basically useless.
 #FIND_PACKAGE(SWIG)
 
+OPTION(PHYSFS_BUILD_SWIG "Build ${_LANG} bindings." TRUE)
+MARK_AS_ADVANCED(PHYSFS_BUILD_SWIG)
+
 FIND_PROGRAM(SWIG swig DOC "Path to swig command line app: http://swig.org/")
 IF(NOT SWIG)
     MESSAGE(STATUS "SWIG not found. You won't be able to build scripting language bindings.")
@@ -411,7 +414,11 @@
     ENDMACRO(CONFIGURE_SWIG_BINDING)
 
     MACRO(ADD_SCRIPT_BINDING_OPTION _VAR _LANG _DEFVAL)
-        OPTION(${_VAR} "Build ${_LANG} bindings." ${_DEFVAL})
+        SET(BUILDSWIGVAL ${_DEFVAL})
+        IF(NOT PHYSFS_BUILD_SWIG)
+            SET(BUILDSWIGVAL FALSE)
+        ENDIF(NOT PHYSFS_BUILD_SWIG)
+        OPTION(${_VAR} "Build ${_LANG} bindings." ${BUILDSWIGVAL})
         MARK_AS_ADVANCED(${_VAR})
     ENDMACRO(ADD_SCRIPT_BINDING_OPTION)