-if(RUN_IN_PLACE)
- add_definitions ( -DRUN_IN_PLACE )
-endif(RUN_IN_PLACE)
-
-if(USE_GETTEXT)
- find_package(GettextLib REQUIRED)
- if (GETTEXT_FOUND)
- add_definitions( -DUSE_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()
- message(STATUS "GetText enabled")
- else()
- message(ERROR "GetText enabled but not found, disabling")
- set(USE_GETTEXT FALSE)
- endif(GETTEXT_FOUND)
-else(USE_GETTEXT)
+# 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)