changeset 1988:007c54f6fabc

updated cmake find scripts to only use the VS2010 paths if the corresponding env-var is found.
author thegusty999
date Fri, 28 Oct 2011 22:06:05 +0000
parents 79c7b3a18684
children 8b1a0d09881d
files CMakeModules/FindOgg.cmake CMakeModules/FindVorbis.cmake
diffstat 2 files changed, 54 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeModules/FindOgg.cmake	Fri Oct 28 20:25:47 2011 +0000
+++ b/CMakeModules/FindOgg.cmake	Fri Oct 28 22:06:05 2011 +0000
@@ -20,11 +20,19 @@
   PATHS $ENV{OGGDIR}
   PATH_SUFFIXES include
 )
+
+
 IF (WIN32)
+#Make a special selection for the scenario of using visual studio 2010, since this will
+#be the most frequent at this stage.
+SET (TMP_SUFF Win32/Release)
+IF (MSVC10)
+SET (TMP_SUFF ${TMP_SUFF} VS2010/Win32/Release Win32/VS2010/Win32/Release )
+ENDIF (MSVC10)
 FIND_LIBRARY(OGG_LIBRARY_OPTIMIZED
   NAMES libogg libogg_static libogg-static-mt
   PATHS $ENV{OGGDIR}
-  PATH_SUFFIXES Release Win32/Release VS2010/Win32/Release Win32/VS2010/Win32/Release
+  PATH_SUFFIXES Release ${TMP_SUFF}
 )
 ELSE()
 FIND_LIBRARY(OGG_LIBRARY_OPTIMIZED
@@ -35,10 +43,16 @@
 
 
 IF(WIN32)
+#Make a special selection for the scenario of using visual studio 2010, since this will
+#be the most frequent at this stage.
+SET (TMP_SUFF Win32/Debug)
+IF (MSVC10)
+SET (TMP_SUFF ${TMP_SUFF} VS2010/Win32/Debug Win32/VS2010/Win32/Debug )
+ENDIF (MSVC10)
 FIND_LIBRARY(OGG_LIBRARY_DEBUG
   NAMES liboggd libogg_static libogg_d liboggD libogg_D libogg-static-mt-debug
   PATHS $ENV{OGGDIR}
-  PATH_SUFFIXES Debug Win32/Debug VS2010/Win32/Debug Win32/VS2010/Win32/Debug
+  PATH_SUFFIXES Debug ${TMP_SUFF}
 )
 ELSE()
 FIND_LIBRARY(OGG_LIBRARY_DEBUG
--- a/CMakeModules/FindVorbis.cmake	Fri Oct 28 20:25:47 2011 +0000
+++ b/CMakeModules/FindVorbis.cmake	Fri Oct 28 22:06:05 2011 +0000
@@ -22,10 +22,16 @@
 )
 
 IF(WIN32)
+#Make a special selection for the scenario of using visual studio 2010, since this will
+#be the most frequent at this stage.
+SET (TMP_SUFF Win32/Release)
+IF (MSVC10)
+SET (TMP_SUFF ${TMP_SUFF} VS2010/Win32/Release Win32/VS2010/Win32/Release )
+ENDIF (MSVC10)
 FIND_LIBRARY(VORBIS_LIBRARY_OPTIMIZED
   NAMES libvorbis libvorbis_static libvorbis-static-mt
   PATHS $ENV{VORBISDIR}
-  PATH_SUFFIXES Release Win32/Release VS2010/Win32/Release Win32/VS2010/Win32/Release
+  PATH_SUFFIXES Release ${TMP_SUFF}
 )
 ELSE()
 FIND_LIBRARY(VORBIS_LIBRARY_OPTIMIZED
@@ -35,10 +41,16 @@
 ENDIF(WIN32)
 
 IF(WIN32)
+#Make a special selection for the scenario of using visual studio 2010, since this will
+#be the most frequent at this stage.
+SET (TMP_SUFF Win32/Debug)
+IF (MSVC10)
+SET (TMP_SUFF ${TMP_SUFF} VS2010/Win32/Debug Win32/VS2010/Win32/Debug )
+ENDIF (MSVC10)
 FIND_LIBRARY(VORBIS_LIBRARY_DEBUG
   NAMES libvorbis libvorbis_static vorbis_d vorbisD vorbis_D libvorbis-static-mt-debug
   PATHS $ENV{VORBISDIR}
-  PATH_SUFFIXES Debug Win32/Debug VS2010/Win32/Debug Win32/VS2010/Win32/Debug
+  PATH_SUFFIXES Debug ${TMP_SUFF}
 )
 ELSE()
 FIND_LIBRARY(VORBIS_LIBRARY_DEBUG
@@ -48,10 +60,16 @@
 ENDIF(WIN32)
 
 IF(WIN32)
+#Make a special selection for the scenario of using visual studio 2010, since this will
+#be the most frequent at this stage.
+SET (TMP_SUFF Win32/Release)
+IF (MSVC10)
+SET (TMP_SUFF ${TMP_SUFF} VS2010/Win32/Release Win32/VS2010/Win32/Release )
+ENDIF (MSVC10)
 FIND_LIBRARY(VORBISFILE_LIBRARY_OPTIMIZED
   NAMES libvorbisfile
   PATHS $ENV{VORBISDIR}
-  PATH_SUFFIXES Release Win32/Release VS2010/Win32/Release Win32/VS2010/Win32/Release
+  PATH_SUFFIXES Release ${TMP_SUFF}
 )
 ELSE()
 FIND_LIBRARY(VORBISFILE_LIBRARY_OPTIMIZED
@@ -61,10 +79,16 @@
 ENDIF(WIN32)
 
 IF(WIN32)
+#Make a special selection for the scenario of using visual studio 2010, since this will
+#be the most frequent at this stage.
+SET (TMP_SUFF Win32/Debug)
+IF (MSVC10)
+SET (TMP_SUFF ${TMP_SUFF} VS2010/Win32/Debug Win32/VS2010/Win32/Debug )
+ENDIF (MSVC10)
 FIND_LIBRARY(VORBISFILE_LIBRARY_DEBUG
   NAMES libvorbisfile vorbisfile_d vorbisfileD vorbisfile_D
   PATHS $ENV{VORBISDIR}
-  PATH_SUFFIXES Debug Win32/Debug VS2010/Win32/Debug Win32/VS2010/Win32/Debug
+  PATH_SUFFIXES Debug ${TMP_SUFF}
 )
 ELSE()
 FIND_LIBRARY(VORBISFILE_LIBRARY_DEBUG
@@ -73,7 +97,6 @@
 )
 ENDIF(WIN32)
 
-
 # Handle the REQUIRED argument and set VORBIS_FOUND
 IF(NOT WIN32)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Vorbis DEFAULT_MSG
@@ -84,6 +107,8 @@
 ELSE()
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Vorbis DEFAULT_MSG
   VORBIS_LIBRARY_OPTIMIZED
+  #Temporary: also add for WIN32
+  VORBISFILE_LIBRARY_OPTIMIZED
   VORBIS_INCLUDE_DIR
 )
 ENDIF(NOT WIN32)
@@ -94,7 +119,10 @@
   HANDLE_LIBRARY_TYPES(VORBISFILE) 
   SET(VORBIS_LIBRARIES ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY}) #WIN32 includes VORBISFILE as a static lib
 ELSE()
-  SET(VORBIS_LIBRARIES ${VORBIS_LIBRARY} )
+  # Why would the fact that WIN32 includes the vorbisfile as static mean that we don't need to pass it here? 
+  #SET(VORBIS_LIBRARIES ${VORBIS_LIBRARY} )
+  HANDLE_LIBRARY_TYPES(VORBISFILE) 
+  SET(VORBIS_LIBRARIES ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
 ENDIF(NOT WIN32)
 
 MARK_AS_ADVANCED(
@@ -104,5 +132,9 @@
   IF(NOT WIN32)
     VORBISFILE_LIBRARY_OPTIMIZED
     VORBISFILE_LIBRARY_DEBUG
+  ELSE()
+    # Temporary: add libs here as well
+    VORBISFILE_LIBRARY_OPTIMIZED
+    VORBISFILE_LIBRARY_DEBUG
   ENDIF(NOT WIN32)
 )