From: Harley Laue Date: Thu, 13 May 2010 23:49:02 +0000 (-0500) Subject: Fixed CMake so Force internal actually has a chance at working correctly X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=f7e6f19a9049c22a0246b4e93c8ba20bd82e3606;p=lugaru.git Fixed CMake so Force internal actually has a chance at working correctly --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e3eb9c2..1f5ed78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,9 +148,11 @@ find_package(OpenGL REQUIRED) # force this include dir no matter what, so we get sane headers. include_directories("${DEPDIR}/OpenGL") -option (LUGARU_FORCE_INTERNAL_OPENAL) +option (LUGARU_FORCE_INTERNAL_OPENAL "Force internal OpenAL, even if theer's a system version" False) if (NOT LUGARU_FORCE_INTERNAL_OPENAL) find_package(OpenAL REQUIRED) +else(NOT LUGARU_FORCE_INTERNAL_OPENAL) + set(OPENAL_FOUND False) endif (NOT LUGARU_FORCE_INTERNAL_OPENAL) if (NOT OPENAL_FOUND) @@ -182,7 +184,10 @@ endif (NOT OPENAL_FOUND) 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) +else(NOT LUGARU_FORCE_INTERNAL_SDL) + set(SDL_FOUND False) 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") @@ -221,7 +226,10 @@ 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) +else(NOT LUGARU_FORCE_INTERNAL_PNG) + set(PNG_FOUND False) 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") @@ -251,7 +259,10 @@ 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) +else(NOT LUGARU_FORCE_INTERNAL_JPEG) + set(JPEG_FOUND False) 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") @@ -311,7 +322,10 @@ 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) +else(NOT LUGARU_FORCE_INTERNAL_ZLIB) + set(ZLIB_FOUND False) 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") @@ -335,10 +349,11 @@ if (NOT ZLIB_FOUND) 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) +if (LUGARU_FORCE_INTERNAL_GLU) + set(OPENGL_GLU_FOUND False) +endif (LUGARU_FORCE_INTERNAL_GLU) + +if (NOT OPENGL_GLU_FOUND) message(STATUS "Using internal copy of libGLU") set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} GLU") set(GLUDIR "${DEPDIR}/GLU") @@ -359,13 +374,16 @@ if (NOT GLU_FOUND) ${GLUDIR}/tessmono.c ${GLUDIR}/util.c ) -endif (NOT GLU_FOUND) +endif (NOT OPENGL_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) +else(NOT LUGARU_FORCE_INTERNAL_VORBIS) + set(OGGVORBIS_FOUND False) endif (NOT LUGARU_FORCE_INTERNAL_VORBIS) -if (NOT OggVorbis_FOUND) + +if (NOT OGGVORBIS_FOUND) message(STATUS "Using internal copy of Ogg Vorbis") set(LUGARU_MISSING_DEPS "${LUGARU_MISSING_DEPS} OggVorbis") set(OGGDIR "${DEPDIR}/libogg") @@ -399,7 +417,7 @@ if (NOT OggVorbis_FOUND) ${VORBISDIR}/lib/vorbisfile.c ${VORBISDIR}/lib/window.c ) -endif (NOT OggVorbis_FOUND) +endif (NOT OGGVORBIS_FOUND) include_directories( ${OPENAL_INCLUDE_DIR}