+if (JPEG_FACTORY)
+ # check simgear was built with JPEG-factory support
+ find_package(JPEG REQUIRED)
+ include_directories(${JPEG_INCLUDE_DIR})
+
+ set(CMAKE_REQUIRED_INCLUDES
+ ${SIMGEAR_INCLUDE_DIR}
+ ${JPEG_INCLUDE_DIR}
+ ${OPENSCENEGRAPH_INCLUDE_DIRS})
+
+ check_cxx_source_compiles(
+ "#include <simgear/screen/jpgfactory.hxx>
+ int main() { return 0; } "
+ FG_JPEG_SERVER)
+
+ if (NOT FG_JPEG_SERVER)
+ message(STATUS "JPEG server support requested, but SimGear was built without JPEG support")
+ endif()
+endif()
+