+# Set some random things default to not being visible in the GUI
+mark_as_advanced(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
+mark_as_advanced(JTHREAD_INCLUDE_DIR JTHREAD_LIBRARY)
+mark_as_advanced(SQLITE3_INCLUDE_DIR SQLITE3_LIBRARY)
+
+option(ENABLE_CURL "Enable cURL support for fetching media" 1)
+
+if (NOT ENABLE_CURL)
+ mark_as_advanced(CLEAR CURL_LIBRARY CURL_INCLUDE_DIR)
+endif(NOT ENABLE_CURL)
+
+if( ENABLE_CURL )
+ find_package(CURL)
+endif( ENABLE_CURL )
+set(USE_CURL 0)
+if (CURL_FOUND AND ENABLE_CURL)
+ message(STATUS "cURL support enabled")
+ set(USE_CURL 1)
+endif(CURL_FOUND AND ENABLE_CURL)
+
+# user-visible option to enable/disable gettext usage
+OPTION(ENABLE_GETTEXT "Use GetText for internationalization" 0)
+
+# this is only set to 1 if gettext is enabled _and_ available
+set(USE_GETTEXT 0)
+
+if(ENABLE_GETTEXT)
+ find_package(GettextLib)
+else()
+ MARK_AS_ADVANCED(GETTEXT_ICONV_DLL GETTEXT_INCLUDE_DIR GETTEXT_LIBRARY GETTEXT_MSGFMT)
+endif()
+
+if(GETTEXT_FOUND AND ENABLE_GETTEXT)
+ message(STATUS "gettext include path: ${GETTEXT_INCLUDE_DIR}")
+ message(STATUS "gettext msgfmt path: ${GETTEXT_MSGFMT}")
+ if(WIN32)
+ message(STATUS "gettext library: ${GETTEXT_LIBRARY}")
+ message(STATUS "gettext dll: ${GETTEXT_DLL}")
+ message(STATUS "gettext iconv dll: ${GETTEXT_ICONV_DLL}")
+ endif()
+ set(USE_GETTEXT 1)
+ message(STATUS "GetText enabled; locales found: ${GETTEXT_AVAILABLE_LOCALES}")
+elseif(GETTEXT_FOUND AND NOT ENABLE_GETTEXT)
+ MESSAGE(STATUS "GetText found but disabled;")
+else(GETTEXT_FOUND AND ENABLE_GETTEXT)
+ message(STATUS "GetText disabled")
+endif(GETTEXT_FOUND AND ENABLE_GETTEXT)
+
+# user visible option to enable/disable sound
+OPTION(ENABLE_SOUND "Enable sound" ON)
+
+# this is only set to 1 if sound is enabled _and_ available
+set(USE_SOUND 0)
+set(SOUND_PROBLEM 0)
+
+if(ENABLE_SOUND AND BUILD_CLIENT)
+ # Sound libraries
+ find_package(OpenAL)
+ find_package(Vorbis)
+ if(NOT OPENAL_FOUND)
+ message(STATUS "Sound enabled, but OpenAL not found!")
+ set(SOUND_PROBLEM 1)
+ MARK_AS_ADVANCED(CLEAR OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
+ endif()
+ if(NOT VORBIS_FOUND)
+ message(STATUS "Sound enabled, but Vorbis libraries not found!")
+ set(SOUND_PROBLEM 1)
+ MARK_AS_ADVANCED(CLEAR OGG_INCLUDE_DIR VORBIS_INCLUDE_DIR OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
+ endif()
+ if(OPENAL_FOUND AND VORBIS_FOUND)
+ set(USE_SOUND 1)
+ message(STATUS "Sound enabled")
+ endif()
+endif(ENABLE_SOUND AND BUILD_CLIENT)
+
+if(SOUND_PROBLEM)
+ message(FATAL_ERROR "Sound enabled, but cannot be used.\n"
+ "To continue, either fill in the required paths or disable sound. (-DENABLE_SOUND=0)")
+endif()
+if(USE_SOUND)
+ set(sound_SRCS sound_openal.cpp)
+ set(SOUND_INCLUDE_DIRS
+ ${OPENAL_INCLUDE_DIR}
+ ${VORBIS_INCLUDE_DIR}
+ ${OGG_INCLUDE_DIR}
+ )
+ set(SOUND_LIBRARIES
+ ${OPENAL_LIBRARY}
+ ${VORBIS_LIBRARIES}
+ )
+endif()