find_package(OpenGL REQUIRED)
# force this include dir no matter what, so we get sane headers.
-set(OPENGL_INCLUDE_DIR "${DEPDIR}/OpenGL")
+include_directories("${DEPDIR}/OpenGL")
find_package(OpenAL REQUIRED) # !!! FIXME: package a .dll for Windows?
-find_package(SDL)
-if (NOT SDL)
+option (LUGARU_FORCE_INTERNAL_SDL "Force internal libSDL, even if there's a system version" False)
+if (NOT LUGARU_FORCE_INTERNAL_SDL)
+ find_package(SDL)
+endif (NOT LUGARU_FORCE_INTERNAL_SDL)
+if (NOT SDL_FOUND)
+ message(STATUS "Using internal copy of SDL")
set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} SDL")
- message(STATUS "SDL not found, using internal copy")
set(SDLDIR "${DEPDIR}/SDL12")
set(SDL_INCLUDE_DIR "${SDLDIR}/include")
set(SDL_LIBRARY "")
if (NOT LUGARU_HAS_INTERNAL_SDL)
message(ERROR "We don't have a prebuilt SDL for this platform.")
endif (NOT LUGARU_HAS_INTERNAL_SDL)
-endif (NOT SDL)
-
-find_package(PNG)
-if (NOT PNG)
+endif (NOT SDL_FOUND)
+
+option (LUGARU_FORCE_INTERNAL_PNG "Force internal libPNG, even if there's a system version" False)
+if (NOT LUGARU_FORCE_INTERNAL_PNG)
+ find_package(PNG)
+endif (NOT LUGARU_FORCE_INTERNAL_PNG)
+if (NOT PNG_FOUND)
+ message(STATUS "Using internal copy of libpng")
set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} PNG")
- message(STATUS "libpng not found, using internal copy")
set(PNGDIR "${DEPDIR}/libpng")
set(PNG_INCLUDE_DIR "${PNGDIR}")
set(PNG_LIBRARY "")
${PNGDIR}/pngwtran.c
${PNGDIR}/pngwutil.c
)
-endif (NOT PNG)
-
-find_package(JPEG)
-if (NOT JPEG)
+endif (NOT PNG_FOUND)
+
+option (LUGARU_FORCE_INTERNAL_JPEG "Force internal libJPEG, even if there's a system version" False)
+if (NOT LUGARU_FORCE_INTERNAL_JPEG)
+ find_package(JPEG)
+endif (NOT LUGARU_FORCE_INTERNAL_JPEG)
+if (NOT JPEG_FOUND)
+ message(STATUS "Using internal copy of libjpeg")
set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} JPEG")
- message(STATUS "libjpeg not found, using internal copy")
set(JPEGDIR "${DEPDIR}/libjpeg")
set(JPEG_INCLUDE_DIR "${JPEGDIR}")
set(JPEG_LIBRARY "")
${JPEGDIR}/jdarith.c
${JPEGDIR}/jaricom.c
)
-endif (NOT JPEG)
-
-find_package(ZLIB)
-if (NOT ZLIB)
+endif (NOT JPEG_FOUND)
+
+option (LUGARU_FORCE_INTERNAL_ZLIB "Force internal zlib, even if there's a system version" False)
+if (NOT LUGARU_FORCE_INTERNAL_ZLIB)
+ find_package(ZLIB)
+endif (NOT LUGARU_FORCE_INTERNAL_ZLIB)
+if (NOT ZLIB_FOUND)
+ message(STATUS "Using internal copy of zlib")
set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} ZLIB")
- message(STATUS "zlib not found, using internal copy")
set(ZLIBDIR "${DEPDIR}/zlib")
set(ZLIB_INCLUDE_DIR "${ZLIBDIR}")
set(ZLIB_LIBRARIES "")
${ZLIBDIR}/uncompr.c
${ZLIBDIR}/zutil.c
)
-endif (NOT ZLIB)
-
-find_package(GLU)
-if (NOT GLU)
+endif (NOT ZLIB_FOUND)
+
+option (LUGARU_FORCE_INTERNAL_GLU "Force internal libGLU, even if there's a system version" False)
+if (NOT LUGARU_FORCE_INTERNAL_GLU)
+ find_package(GLU)
+endif (NOT LUGARU_FORCE_INTERNAL_GLU)
+if (NOT GLU_FOUND)
+ message(STATUS "Using internal copy of libGLU")
set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} GLU")
- message(STATUS "GLU not found, using internal copy")
set(GLUDIR "${DEPDIR}/GLU")
set(GLU_INCLUDE_DIR "${GLUDIR}")
set(GLU_LIBRARY "")
${GLUDIR}/tessmono.c
${GLUDIR}/util.c
)
-endif (NOT GLU)
-
-find_package(OggVorbis)
-if (NOT OggVorbis)
+endif (NOT GLU_FOUND)
+
+option (LUGARU_FORCE_INTERNAL_VORBIS "Force internal Vorbis, even if there's a system version" False)
+if (NOT LUGARU_FORCE_INTERNAL_VORBIS)
+ find_package(OggVorbis)
+endif (NOT LUGARU_FORCE_INTERNAL_VORBIS)
+if (NOT OggVorbis_FOUND)
+ message(STATUS "Using internal copy of Ogg Vorbis")
set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} OggVorbis")
- message(STATUS "Ogg Vorbis not found, using internal copy")
set(OGGDIR "${DEPDIR}/libogg")
set(OGG_INCLUDE_DIR "${OGGDIR}/include")
set(OGG_LIBRARY "")
${VORBISDIR}/lib/vorbisfile.c
${VORBISDIR}/lib/window.c
)
-endif (NOT OggVorbis)
+endif (NOT OggVorbis_FOUND)
include_directories(
${OPENAL_INCLUDE_DIR}