Skip to content

Commit

Permalink
[12911] Add separate cmake file for unix platform
Browse files Browse the repository at this point in the history
  • Loading branch information
DomGries committed Aug 30, 2015
1 parent 1c6bb97 commit d296ef3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
19 changes: 3 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ set(MANGOS_VERSION 0.17)

# Set RPATH-handing (CMake parameters)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH ${LIBS_DIR})
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

Expand Down Expand Up @@ -53,9 +53,10 @@ if(PREFIX)
message(FATAL_ERROR "The parameter PREFIX has been removed. Please re-run CMake and use CMAKE_INSTALL_PREFIX instead to define your installation location!")
endif()

include(CheckPlatform)

# TODO: use MSVC_CXX_ARCHITECTURE_ID instead to identify platform on windows (not required on other systems)
# find platform: required to build 3rd party libraries w/o CMake files
find_package(Platform REQUIRED)
# Find out what system we use to include the needed libs
if(WIN32)
if(PLATFORM MATCHES X86) # 32-bit
Expand Down Expand Up @@ -97,8 +98,6 @@ endif()
# For Unix systems set the rpath so that libraries are found
set(CMAKE_INSTALL_RPATH ${LIBS_DIR})
set(CMAKE_INSTALL_NAME_DIR ${LIBS_DIR})
# Run out of build tree
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)

# Find needed packages and if necessery abort if something important is missing
unset(ACE_INCLUDE_DIR CACHE)
Expand Down Expand Up @@ -168,18 +167,6 @@ if(UNIX)
find_package(ZLIB REQUIRED)
endif()

# configure uninstaller
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/platform/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY
)

# create uninstaller target (allows for using "make uninstall")
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
)

# Find core revision
if(GIT_EXECUTABLE)
execute_process(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ else()
set(PLATFORM X86)
message(STATUS "Detected 32-bit platform")
endif()

if(UNIX)
include("${CMAKE_SOURCE_DIR}/cmake/platform/unix/settings.cmake")
endif()
13 changes: 13 additions & 0 deletions cmake/platform/unix/settings.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# configure uninstaller
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/platform/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY
)
message(STATUS "UNIX: Configuring uninstall target")

# create uninstaller target (allows for using "make uninstall")
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
)
message(STATUS "UNIX: Created uninstall target")
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12910"
#define REVISION_NR "12911"
#endif // __REVISION_NR_H__

0 comments on commit d296ef3

Please sign in to comment.