aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-06-15 16:01:22 +0200
committerShauren <shauren.trinity@gmail.com>2024-06-15 16:01:22 +0200
commita7c42f1ed55e586d0d817dd99865aa7c024b0140 (patch)
tree77583068a6456f6aeb3b2493ce4bc3578956a908 /cmake
parent078bc6fe3fc764eaa2d528a19fe6d40972ee3537 (diff)
Build: Normalize executable locations in build directory for all platforms
Diffstat (limited to 'cmake')
-rw-r--r--cmake/compiler/msvc/settings.cmake8
-rw-r--r--cmake/platform/unix/settings.cmake4
-rw-r--r--cmake/platform/win/settings.cmake3
-rw-r--r--cmake/showoptions.cmake2
4 files changed, 8 insertions, 9 deletions
diff --git a/cmake/compiler/msvc/settings.cmake b/cmake/compiler/msvc/settings.cmake
index 4858aa242e6..b7f67874329 100644
--- a/cmake/compiler/msvc/settings.cmake
+++ b/cmake/compiler/msvc/settings.cmake
@@ -1,6 +1,3 @@
-# set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-
set(MSVC_EXPECTED_VERSION 19.32)
set(MSVC_EXPECTED_VERSION_STRING "Microsoft Visual Studio 2022 17.2")
@@ -31,10 +28,6 @@ target_compile_options(trinity-compile-option-interface
INTERFACE
/permissive-)
-# set up output paths ofr static libraries etc (commented out - shown here as an example only)
-#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-
if(PLATFORM EQUAL 64)
# This definition is necessary to work around a bug with Intellisense described
# here: http://tinyurl.com/2cb428. Syntax highlighting is important for proper
@@ -59,7 +52,6 @@ else()
message(STATUS "MSVC: Disabled Safe Exception Handlers for debug builds")
endif()
-# msbuild/devenv don't set CMAKE_MAKE_PROGRAM, you can choose build type from a dropdown after generating projects
if("${CMAKE_MAKE_PROGRAM}" MATCHES "MSBuild")
# multithreaded compiling on VS
target_compile_options(trinity-compile-option-interface
diff --git a/cmake/platform/unix/settings.cmake b/cmake/platform/unix/settings.cmake
index 2dd8197e293..bcd25af4903 100644
--- a/cmake/platform/unix/settings.cmake
+++ b/cmake/platform/unix/settings.cmake
@@ -46,6 +46,10 @@ if(APPLE)
endif()
message(STATUS "UNIX: Detected compiler: ${CMAKE_C_COMPILER}")
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/bin")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/lib")
+
if(CMAKE_C_COMPILER MATCHES "gcc" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
include(${CMAKE_SOURCE_DIR}/cmake/compiler/gcc/settings.cmake)
elseif(CMAKE_C_COMPILER MATCHES "icc")
diff --git a/cmake/platform/win/settings.cmake b/cmake/platform/win/settings.cmake
index 63c118f76e0..297b46d75ac 100644
--- a/cmake/platform/win/settings.cmake
+++ b/cmake/platform/win/settings.cmake
@@ -4,6 +4,9 @@ add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-DNOMINMAX)
add_definitions(-DTRINITY_REQUIRED_WINDOWS_BUILD=18362)
+# set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/$<CONFIG>")
+
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
include(${CMAKE_SOURCE_DIR}/cmake/compiler/msvc/settings.cmake)
elseif(CMAKE_CXX_PLATFORM_ID MATCHES "MinGW")
diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake
index 0cf0862dd00..9ea4a13199c 100644
--- a/cmake/showoptions.cmake
+++ b/cmake/showoptions.cmake
@@ -1,7 +1,7 @@
# output generic information about the core and buildtype chosen
message("")
message("* TrinityCore revision : ${rev_hash} ${rev_date} (${rev_branch} branch)")
-if(NOT "${CMAKE_MAKE_PROGRAM}" MATCHES "MSBuild")
+if(NOT ("${CMAKE_GENERATOR}" MATCHES "Visual Studio" OR "${CMAKE_GENERATOR}" STREQUAL "Ninja Multi-Config"))
message("* TrinityCore buildtype : ${CMAKE_BUILD_TYPE}")
endif()
message("")