set(CPACK_PACKAGE_VERSION_PATCH "3")
option(WITH_MPD_HOST_CHANGE "Let users of the web frontend change the MPD Host" ON)
+option(WITH_DYNAMIC_SERVING "Serve file of ./htdocs dynamically (development)" OFF)
option(WITH_IPV6 "enable IPv6 support" ON)
find_package(LibMPDClient REQUIRED)
#define YMPD_VERSION_MAJOR ${CPACK_PACKAGE_VERSION_MAJOR}
#define YMPD_VERSION_MINOR ${CPACK_PACKAGE_VERSION_MINOR}
#define YMPD_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH}
-#define DATADIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}"
-#define LOCAL_RESOURCE_PATH DATADIR"/htdocs"
+#define SRC_PATH "${PROJECT_SOURCE_DIR}/htdocs"
#cmakedefine WITH_MPD_HOST_CHANGE
+#cmakedefine WITH_DYNAMIC_SERVING
#endif
else
return MG_TRUE;
} else
+#ifdef WITH_DYNAMIC_SERVING
+ return MG_FALSE;
+#else
return callback_http(c);
+#endif
case MG_AUTH:
return MG_TRUE;
default:
atexit(bye);
error_msg = mg_set_option(server, "listening_port", "8080");
+#ifdef WITH_DYNAMIC_SERVING
+ mg_set_option(server, "document_root", SRC_PATH);
+#endif
+
mpd.port = 6600;
strcpy(mpd.host, "127.0.0.1");