1

I'm worried that my Windows 8.1 OS may have been hacked because I can't think of any other reason for why this problem is happening.

Here's the contents of my cache file which has worked before:

set(WITH_SDL ON CACHE BOOL "")
set(WITH_AUDIO ON CACHE BOOL "")

set(WITH_MOVIES OFF CACHE BOOL "")
set(WITH_FREETYPE2 OFF CACHE BOOL "")
set(WITH_LUAJIT OFF CACHE BOOL "")
set(WITH_LIBAV OFF CACHE BOOL "")
set(BUILD_ANIMVIEWER OFF CACHE BOOL "")
set(BUILD_MAPEDITOR OFF CACHE BOOL "")

set(LUA_INCLUDE_DIR "C:/Program Files (x86)/Lua/5.3.0/include" CACHE PATH "")
set(LUA_LIBRARY "C:/Program Files (x86)/Lua/5.3.0/lua53.lib" CACHE FILEPATH "")
set(SDL_INCLUDE_DIR "C:/Users/Joseph/Programming/Github/Libraries/SDL2-2.0.3/include" CACHE PATH "")
set(SDL_LIBRARY "C:/Users/Joseph/Programming/Github/Libraries/SDL2-2.0.3/lib/x86/SDL2.lib" CACHE FILEPATH "")
set(SDL_INCLUDE_DIR "C:/Users/Joseph/Programming/Github/Libraries/SDL2_mixer- 2.0.0/include" CACHE PATH "")
set(SDL_MIXER_LIBRARY "C:/Users/Joseph/Programming/Github/Libraries/SDL2_mixer-2.0.0/lib/x86/SDL2_mixer.lib" CACHE FILEPATH "")

All the paths are still valid.

And here's the command I'm using: cmake -C "C:/Users/Joseph/Desktop/initial_cache.cmake" --build "C:/Users/Joseph/Programming/Github/CorsixTH/build" -g "Visual Studio 12 2013" C:/Users/Joseph/Programming/Github/CorsixTH/

The command terminal's output:

loading initial cache file c:/Users/Joseph/Desktop/initial_cache.cmake
-- Building for: Visual Studio 12 2013
Note: SDL audio is enabled (default)
Note: FFMPEG video is enabled (default)
Note: FreeType2 is enabled (default)
Note: Visual Leak Detector is disabled (default)

Building CorsixTH
-- Could NOT find SDL (missing:  SDL_INCLUDE_DIR)
CMake Error at CorsixTH/CMakeLists.txt:105 (message):
Error: SDL library not found, it is required to build.  Make sure the path
  is correctly defined or set the environment variable SDLDIR to the correct
  location

-- Configuring incomplete, errors occurred!
See also "C:/Users/Joseph/CMakeFiles/CMakeOutput.log".

After the first successful use of this cache file I added more commands and then it stopped working so I removed the new commands but this didn't make it work again.

I've tried deleting the cmake cache by telling the CMake GUI to delete it and I've tried using a fresh download of the CorsixTH source code directory.

Joe912
  • 11
  • 2

1 Answers1

0

If I look at CrosixTH/CMakeLists.txt and CMake's Modules\FindSDL.cmake the SDLDIR environment variable really has to be there (it is not cached and therefore read every time the configuration process starts again).

So I assume that what happened was the moment you changed something in your CMakeLists.txt you re-triggered ZERO_CHECK and your VS environment is missing the SDLDIR variable.

You you chould either:

  • Add it to your global environment variables
  • Add it to your VS project's environment variables (not yet possible with CMake itself)
  • Add set(ENV{SDLDIR} "C:/Users/Joseph/Programming/Github/Libraries/SDL2-2.0.3") to your cache file (but that would be not comply with to put only cache variables in there)
  • Write your own VS toolchain file for this kind of presets (that's what I've done to get those kind of things working reliable)

Some references:

Community
  • 1
  • 1
Florian
  • 39,996
  • 9
  • 133
  • 149