Remove old DO_MYSQL-params in CMakeLists.txt files - not required as we only support MySQL anyway

+ add partial support for finding headers on Windows (not yet done)

--HG--
branch : trunk
This commit is contained in:
click
2010-06-14 02:00:30 +02:00
parent e7083e46ac
commit b232204264
4 changed files with 29 additions and 23 deletions

View File

@@ -10,7 +10,12 @@
project(Trinity)
cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0005 OLD)
# Force out-of-source build
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" BUILDING_IN_SOURCE)
if(BUILDING_IN_SOURCE)
message(FATAL_ERROR "This project requires an out of source build. Remove the file 'CMakeCache.txt' found in this directory before continuing, and create a separate build directory and run 'cmake path_to_project [options]' from there.")
endif(BUILDING_IN_SOURCE)
include(CheckIncludeFiles)
include(cmake/FindAce.cmake)
@@ -19,12 +24,6 @@ include(cmake/FindReadline.cmake)
include(cmake/FindTermcap.cmake)
include(cmake/PCH.cmake)
# Force out-of-source build
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" BUILDING_IN_SOURCE)
if(BUILDING_IN_SOURCE)
message(FATAL_ERROR "This project requires an out of source build. Remove the file 'CMakeCache.txt' found in this directory before continuing, and create a separate build directory and run 'cmake path_to_project [options]' from there.")
endif(BUILDING_IN_SOURCE)
# Select the Release build configuration by default.
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
@@ -44,7 +43,6 @@ option(DO_AUTHSERVER "Build authserver" 1)
option(DO_WORLDSERVER "Build worldserver" 1)
option(DO_CLI "With CLI" 1)
option(DO_DEBUG "Debug mode" 0)
option(DO_MYSQL "With MySQL support" 1)
option(DO_PCH "Use precompiled headers" 1)
option(DO_RA "With RA" 0)
option(DO_SCRIPTS "With trinityscripts" 1)
@@ -179,10 +177,7 @@ message("")
find_library(SSLLIB NAMES ssl DOC "SSL library")
find_library(ZLIB z "Zlib library")
if(DO_MYSQL)
FIND_MYSQL()
ADD_DEFINITIONS(-DDO_MYSQL)
endif(DO_MYSQL)
FIND_MYSQL()
if(UNIX)
if(CENTOS)

View File

@@ -65,13 +65,19 @@ else(UNIX)
ENDIF(UNIX)
find_path(MYSQL_INCLUDE_DIR mysql.h
${MYSQL_ADD_INCLUDE_DIR}
/usr/include
/usr/include/mysql
/usr/local/include
/usr/local/include/mysql
/usr/local/include/mysql
/usr/local/mysql/include
/usr/local/mysql/include/mysql
/usr/include
/usr/include/mysql
${MYSQL_ADD_INCLUDE_DIR}
"C:/Program Files/MySQL/include"
"C:/Program Files/MySQL/MySQL Server 5.0/include"
"C:/MySQL/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/include"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/include"
DOC "Specify the directory containing mysql.h."
)
set(TMP_MYSQL_LIBRARIES "")
@@ -80,10 +86,17 @@ foreach(LIB ${MYSQL_ADD_LIBRARIES})
find_library("MYSQL_LIBRARIES_${LIB}" NAMES ${LIB}
PATHS
${MYSQL_ADD_LIBRARY_PATH}
/usr/lib
/usr/lib/mysql
/usr/local/lib
/usr/local/lib/mysql
/usr/local/mysql/lib
"C:/Program Files/MySQL/lib"
"C:/Program Files/MySQL/MySQL Server 5.0/lib/opt"
"C:/MySQL/lib/debug"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt"
DOC "Specify the mysql library here."
)
list(APPEND TMP_MYSQL_LIBRARIES "${MYSQL_LIBRARIES_${LIB}}")
endforeach(LIB ${MYSQL_ADD_LIBRARIES})
@@ -99,4 +112,4 @@ else(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
endif(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
mark_as_advanced(MYSQL_INCLUDE_DIR MYSQL_LIBRARIES)
ENDMACRO(FIND_MYSQL)
ENDMACRO(FIND_MYSQL)

View File

@@ -46,9 +46,8 @@ add_executable(authserver ${authserver_SRCS})
add_definitions(
-D_TRINITY_REALM_CONFIG='"${CONF_DIR}/authserver.conf"'
)
IF (DO_MYSQL)
SET(trinity-realm_LINK_FLAGS "-pthread ${authserver_LINK_FLAGS}")
ENDIF(DO_MYSQL)
SET(trinity-realm_LINK_FLAGS "-pthread ${authserver_LINK_FLAGS}")
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
SET(authserver_LINK_FLAGS "-framework Carbon ${authserver_LINK_FLAGS}")

View File

@@ -124,9 +124,8 @@ add_executable(worldserver ${worldserver_SRCS})
add_definitions(
-D_TRINITY_CORE_CONFIG='"${CONF_DIR}/worldserver.conf"'
)
IF (DO_MYSQL)
SET(worldserver_LINK_FLAGS "-pthread ${worldserver_LINK_FLAGS}")
ENDIF(DO_MYSQL)
SET(worldserver_LINK_FLAGS "-pthread ${worldserver_LINK_FLAGS}")
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
SET(worldserver_LINK_FLAGS "-framework Carbon ${worldserver_LINK_FLAGS}")