allow for finding both Win32 and Win64 lib versions
authorTaylor Richards <taylor@icculus.org>
Sat, 10 Mar 2018 03:54:48 +0000 (22:54 -0500)
committerTaylor Richards <taylor@icculus.org>
Sat, 10 Mar 2018 03:54:48 +0000 (22:54 -0500)
cmake/FindLibWebSockets.cmake
cmake/FindOpenAL.cmake
cmake/FindSDL2.cmake

index ba940c4..3036a22 100644 (file)
@@ -15,10 +15,16 @@ FIND_PATH ( LIBWEBSOCKETS_INCLUDE_DIR libwebsockets.h
     /usr/include
 )
 
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+  set(WS_ARCH_DIR lib/Win64)
+else()
+  set(WS_ARCH_DIR lib/Win32)
+endif()
+
 FIND_LIBRARY ( LIBWEBSOCKETS_LIBRARIES websockets_static websockets
     HINTS
          "${LWSDIR}"
-       PATH_SUFFIXES lib
+       PATH_SUFFIXES lib "${WS_ARCH_DIR}"
     /usr/local/lib
     /usr/lib
 )
index c1d3cc3..08cb4b7 100644 (file)
@@ -78,15 +78,15 @@ find_path(OPENAL_INCLUDE_DIR al.h
   /opt/csw # Blastwave\r
   /opt\r
   [HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]\r
-)\r
-\r
-if(CMAKE_SIZEOF_VOID_P EQUAL 8)\r
-  set(_OpenAL_ARCH_DIR libs/Win64)\r
-else()\r
-  set(_OpenAL_ARCH_DIR libs/Win32)\r
-endif()\r
-\r
-find_library(OPENAL_LIBRARY\r
+)
+
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+  set(_OpenAL_ARCH_DIR libs/Win64 lib/Win64)
+else()
+  set(_OpenAL_ARCH_DIR libs/Win32 lib/Win32)
+endif()
+
+find_library(OPENAL_LIBRARY
   NAMES OpenAL al openal OpenAL32\r
   HINTS\r
     "${OPENALDIR}"\r
index d7cc115..fecc158 100644 (file)
@@ -45,12 +45,18 @@ find_path(SDL2_INCLUDE_DIR SDL.h
        PATH_SUFFIXES include/SDL2 include
 )
 
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+  set(VC_LIB_PATH_SUFFIX lib/x64)
+else()
+  set(VC_LIB_PATH_SUFFIX lib/x86)
+endif()
+
 find_library(SDL2_LIBRARY_TEMP
   NAMES SDL2
   HINTS
     "${SDL2DIR}"
        ENV SDL2DIR
-  PATH_SUFFIXES lib
+  PATH_SUFFIXES lib "${VC_LIB_PATH_SUFFIX}"
 )
 
 if(NOT SDL2_BUILDING_LIBRARY)
@@ -64,7 +70,7 @@ if(NOT SDL2_BUILDING_LIBRARY)
          HINTS
            "${SDL2DIR}"
                ENV SDL2DIR
-         PATH_SUFFIXES lib
+         PATH_SUFFIXES lib "${VC_LIB_PATH_SUFFIX}"
          PATHS
          /sw
          /opt/local