From 94ef1999b4b2b0c9380b9f2eda5e61830df0de02 Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Wed, 19 Aug 2015 21:52:47 +0200 Subject: [PATCH] Introduce a CMake variable to define the libdir on Windows As suggested by Daniel, use the same hack as dhewm3: The user defines a path prefix and CMake does the rest. So this is enough to build on Windows: cmake -G Unix\ Makefiles -DYQUAKE2LIBS=C:/MinGW/32/LIBS .. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fef7e4a..4dc3bd21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,14 @@ project (yquake2) # Cmake module search path set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/stuff/cmake/modules ${CMAKE_MODULE_PATH}) +if (YQUAKE2LIBS) + set(ENV{CMAKE_PREFIX_PATH} ${YQUAKE2LIBS}) + + set(ENV{OPENALDIR} ${YQUAKE2LIBS}) + set(ENV{SDLDIR} ${YQUAKE2LIBS}) + set(ENV{SDL2DIR} ${YQUAKE2LIBS}) +endif() + # Add extended path for FreeBSD and Homebrew on OS X list(APPEND CMAKE_PREFIX_PATH /usr/local)