Buildsystem/Windows: Use CMAKE_INSTALL_PREFIX as result-dir for output (Thanks to Paradox)
(Suggested change for genrevisions default path retained to avoid breaking earlier builds, and it's not really a "server binary") Fixes issue 3366 --HG-- branch : trunk
This commit is contained in:
+40
-29
@@ -58,7 +58,6 @@ include(cmake/FindOpenSSL.cmake)
|
|||||||
|
|
||||||
if( UNIX )
|
if( UNIX )
|
||||||
include(cmake/FindReadline.cmake)
|
include(cmake/FindReadline.cmake)
|
||||||
include(cmake/FindTermcap.cmake)
|
|
||||||
include(FindZLIB)
|
include(FindZLIB)
|
||||||
include(FindBZip2)
|
include(FindBZip2)
|
||||||
endif()
|
endif()
|
||||||
@@ -101,9 +100,18 @@ endif()
|
|||||||
#
|
#
|
||||||
|
|
||||||
if( PREFIX )
|
if( PREFIX )
|
||||||
set(CMAKE_INSTALL_PREFIX ${PREFIX})
|
set(CMAKE_INSTALL_PREFIX "${PREFIX}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
IF(NOT CYGWIN)
|
||||||
|
IF(NOT CMAKE_INSTALL_PREFIX)
|
||||||
|
SET(CMAKE_INSTALL_PREFIX
|
||||||
|
"${CMAKE_BINARY_DIR}/bin")
|
||||||
|
ENDIF(NOT CMAKE_INSTALL_PREFIX)
|
||||||
|
ENDIF(NOT CYGWIN)
|
||||||
|
ENDIF(WIN32)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Handle debugmode compiles (this will require further work for proper WIN32-setups)
|
# Handle debugmode compiles (this will require further work for proper WIN32-setups)
|
||||||
#
|
#
|
||||||
@@ -117,10 +125,10 @@ endif()
|
|||||||
#
|
#
|
||||||
|
|
||||||
if( MSVC )
|
if( MSVC )
|
||||||
# Set up MSVC to dump binaries in the <builddir>/bin/<buildtype>/ folder
|
# Set up MSVC to dump binaries into the installation-folder
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_INSTALL_PREFIX})
|
||||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_INSTALL_PREFIX})
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_INSTALL_PREFIX})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -162,35 +170,47 @@ execute_process(
|
|||||||
|
|
||||||
message("")
|
message("")
|
||||||
message("* TrinityCore revision : ${HG_REVISION}")
|
message("* TrinityCore revision : ${HG_REVISION}")
|
||||||
message("* Build binaries in : ${CMAKE_BUILD_TYPE} mode")
|
|
||||||
message("")
|
message("")
|
||||||
|
|
||||||
#
|
#
|
||||||
# Output information about installation-directories and locations
|
# Output information about installation-directories and locations
|
||||||
#
|
#
|
||||||
|
|
||||||
if( UNIX )
|
|
||||||
message("* Install core to : ${CMAKE_INSTALL_PREFIX}")
|
message("* Install core to : ${CMAKE_INSTALL_PREFIX}")
|
||||||
|
if( UNIX )
|
||||||
message("* Install libraries to : ${LIBSDIR}")
|
message("* Install libraries to : ${LIBSDIR}")
|
||||||
message("* Install configs to : ${CONF_DIR}")
|
message("* Install configs to : ${CONF_DIR}")
|
||||||
message("")
|
|
||||||
endif()
|
endif()
|
||||||
|
message("")
|
||||||
|
|
||||||
#
|
#
|
||||||
# Show infomation about the options selected during configuration
|
# Show infomation about the options selected during configuration
|
||||||
#
|
#
|
||||||
|
|
||||||
if( SERVERS )
|
if( SERVERS )
|
||||||
message("* Build servers : Yes (default)")
|
message("* Build core : Yes (default)")
|
||||||
else()
|
else()
|
||||||
message("* Build servers : No")
|
message("* Build core : No")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if( GAMEPCH )
|
||||||
|
message("* Build core with PCH : Yes (default)")
|
||||||
|
else()
|
||||||
|
message("* Build core with PCH : No")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( SCRIPTS )
|
if( SCRIPTS )
|
||||||
message("* Build with scripts : Yes (default)")
|
|
||||||
add_definitions(-DSCRIPTS)
|
add_definitions(-DSCRIPTS)
|
||||||
|
message("* Build scripts : Yes (default)")
|
||||||
else()
|
else()
|
||||||
message("* Build with scripts : No")
|
set(SCRIPTPCH 0)
|
||||||
|
message("* Build scripts : No")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if( SCRIPTPCH )
|
||||||
|
message("* Build scripts with PCH : Yes (default)")
|
||||||
|
else()
|
||||||
|
message("* Build scripts with PCH : No")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( TOOLS )
|
if( TOOLS )
|
||||||
@@ -200,34 +220,21 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( DEBUG )
|
if( DEBUG )
|
||||||
message("* Build in debug-mode : Yes")
|
|
||||||
add_definitions(-DTRINITY_DEBUG)
|
add_definitions(-DTRINITY_DEBUG)
|
||||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
add_definitions(-g)
|
add_definitions(-g)
|
||||||
endif()
|
endif()
|
||||||
|
message("* Build with coreside debug : Yes")
|
||||||
else()
|
else()
|
||||||
message("* Build in debug-mode : No (default)")
|
message("* Build with coreside debug : No (default)")
|
||||||
endif()
|
|
||||||
|
|
||||||
if( GAMEPCH )
|
|
||||||
message("* Build game w/PCH : Yes (default)")
|
|
||||||
else()
|
|
||||||
message("* Build game w/PCH : No")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if( SCRIPTPCH )
|
|
||||||
message("* Build scripts w/PCH : Yes (default)")
|
|
||||||
else()
|
|
||||||
message("* Build scripts w/PCH : No")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( WARNINGS )
|
if( WARNINGS )
|
||||||
message("* Show all warnings : Yes")
|
|
||||||
if( UNIX )
|
if( UNIX )
|
||||||
add_definitions(-Wall -Wfatal-errors -Wextra)
|
add_definitions(-Wall -Wfatal-errors -Wextra)
|
||||||
endif()
|
endif()
|
||||||
|
message("* Show all warnings : Yes")
|
||||||
else()
|
else()
|
||||||
message("* Show compile-warnings : No (default)")
|
|
||||||
if( UNIX )
|
if( UNIX )
|
||||||
add_definitions(--no-warnings) # makes build look nice, no warnings shown at all, only errors
|
add_definitions(--no-warnings) # makes build look nice, no warnings shown at all, only errors
|
||||||
elseif( WIN32 )
|
elseif( WIN32 )
|
||||||
@@ -238,6 +245,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||||
endif()
|
endif()
|
||||||
|
message("* Show compile-warnings : No (default)")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -249,6 +257,9 @@ if( SQL )
|
|||||||
else()
|
else()
|
||||||
message("* Install SQL-files : No (default)")
|
message("* Install SQL-files : No (default)")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
message("")
|
||||||
|
message(STATUS "Report errors to our issuetracker, and remember to include this output")
|
||||||
message("")
|
message("")
|
||||||
|
|
||||||
#####
|
#####
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
IF(WIN32)
|
||||||
|
IF(NOT CYGWIN)
|
||||||
|
SET(CMAKE_INSTALL_PREFIX
|
||||||
|
"" CACHE PATH "Default install path")
|
||||||
|
ENDIF(NOT CYGWIN)
|
||||||
|
ENDIF(WIN32)
|
||||||
@@ -90,7 +90,7 @@ endif()
|
|||||||
if( WIN32 )
|
if( WIN32 )
|
||||||
add_custom_command(TARGET authserver
|
add_custom_command(TARGET authserver
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/authserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/authserver.conf.dist ${CMAKE_INSTALL_PREFIX}/$(ConfigurationName)/
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ endif()
|
|||||||
if( WIN32 )
|
if( WIN32 )
|
||||||
add_custom_command(TARGET worldserver
|
add_custom_command(TARGET worldserver
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/worldserver.conf.dist ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/worldserver.conf.dist ${CMAKE_INSTALL_PREFIX}/$(ConfigurationName)/
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user