From caea934d37e65ef53a466fcb3e3ac888c53ae7bf Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 13 Jan 2014 10:59:37 +0100 Subject: [PATCH] CMake: Lua DLL is built in the correct folder. Also removed SCL warnings from MSVC builds. --- lib/lua/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/lua/CMakeLists.txt b/lib/lua/CMakeLists.txt index af03f4b1a..4a77578dd 100644 --- a/lib/lua/CMakeLists.txt +++ b/lib/lua/CMakeLists.txt @@ -21,6 +21,16 @@ endif() # Lua needs to be linked dynamically on Windows and statically on *nix, so that LuaRocks work if (WIN32) add_library(lua SHARED ${SOURCE}) + set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/MCServer) + if (MSVC) + # MSVC generator adds a "Debug" or "Release" postfixes to the LIBRARY_OUTPUT_PATH, we need to cancel them: + SET_TARGET_PROPERTIES(lua PROPERTIES PREFIX "../") + SET_TARGET_PROPERTIES(lua PROPERTIES IMPORT_PREFIX "../") + + SET_TARGET_PROPERTIES( + lua PROPERTIES COMPILE_FLAGS "-D_CRT_SECURE_NO_WARNINGS" + ) + endif() else() add_library(lua ${SOURCE}) endif() @@ -33,3 +43,4 @@ endif() if (UNIX) target_link_libraries(lua m ${DYNAMIC_LOADER}) endif() +