Skip to content

Commit

Permalink
Output lua binaries into the Server output folder.
Browse files Browse the repository at this point in the history
This is in preparation to move the Cuberite outputs out of the common Server folder into a per-configuration folder.
  • Loading branch information
madmaxoft committed Dec 25, 2019
1 parent e28ba27 commit 4a43592
Showing 1 changed file with 34 additions and 27 deletions.
61 changes: 34 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,27 @@ set(LIBHEADERS
# Lua needs to be linked dynamically on Windows and statically on *nix, so that LuaRocks work
if (WIN32)
add_library(lua SHARED ${LIBSOURCES} ${LIBHEADERS})
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/Server)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/Server)

# Output the DLL into the $/Server folder, so that Cuberite can find it:
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/Server)
# Output the DLL into the Server subfolder, so that Cuberite can find it:
SET_TARGET_PROPERTIES(lua PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_SOURCE_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_SOURCE_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_SOURCE_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_SOURCE_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_SOURCE_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_SOURCE_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_BINARY_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_BINARY_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_BINARY_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_BINARY_DIR}/Server
)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/Server)

if (MSVC)
# Remove SCL warnings, we expect this library to have been tested safe
Expand Down Expand Up @@ -119,19 +122,23 @@ endif()
if (NOT(USE_SYSTEM_LUA))
add_executable(luaexe src/lua.c)
target_link_libraries(luaexe lua)
# Output the EXE into the Server subfolder, so that it can find lua51.dll:
SET_TARGET_PROPERTIES(luaexe PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_SOURCE_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_SOURCE_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_SOURCE_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_SOURCE_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_SOURCE_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_SOURCE_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_BINARY_DIR}/Server
ARCHIVE_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_BINARY_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_BINARY_DIR}/Server
LIBRARY_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_DEBUGPROFILE ${CMAKE_BINARY_DIR}/Server
RUNTIME_OUTPUT_DIRECTORY_RELEASEPROFILE ${CMAKE_BINARY_DIR}/Server
)
if (MSVC)
set_target_properties(
Expand Down

0 comments on commit 4a43592

Please sign in to comment.