BuildSystem: Sort out issues with mysql-libraries under *nix (and should now also work properly for Win32)

- Rename the "EXTERNAL_MYSQL" flag to "USE_MYSQL_SOURCES" to reflect it's PROPER use (and ensure that it's ONLY used on Win32)
- Remove a lingering "scripts" definition (the "scripts"-target is always included, but only from compiled parts (broke builds with -DSCRIPTS=0)

--HG--
branch : trunk
This commit is contained in:
click
2010-09-08 19:20:38 +02:00
parent f1159c2e99
commit 3b91ce95a6
5 changed files with 8 additions and 24 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ include(CheckPlatform)
find_package(PCHSupport) find_package(PCHSupport)
find_package(ACE REQUIRED) find_package(ACE REQUIRED)
find_package(OpenSSL REQUIRED) find_package(OpenSSL REQUIRED)
if( EXTERNAL_MYSQL ) if( NOT USE_MYSQL_SOURCES )
find_package(MySQL REQUIRED) find_package(MySQL REQUIRED)
endif() endif()
-9
View File
@@ -10,15 +10,6 @@ if( NOT LIBSDIR )
message(STATUS "UNIX: Using default library directory") message(STATUS "UNIX: Using default library directory")
endif() endif()
# use internal MySQL headers if external is not forced
if( NOT EXTERNAL_MYSQL )
set(MYSQL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/dep/mysqllite/include)
set(MYSQL_LIBRARY "libmysql")
set( MYSQL_FOUND 1 )
message(STATUS "Using internal MySQL.")
endif()
# configure uninstaller # configure uninstaller
configure_file( configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
+3 -3
View File
@@ -1,5 +1,5 @@
# Platform-specfic options # Platform-specfic options
option(EXTERNAL_MYSQL "Use your own installed MySQL instead of the internal one" 0) option(USE_MYSQL_SOURCES "Use included MySQL-sources to build libraries" 1)
# Package overloads # Package overloads
set(ACE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/dep/acelite) set(ACE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/dep/acelite)
@@ -7,11 +7,11 @@ set(ACE_LIBRARY "ace")
set(BZIP2_LIBRARIES "bzip2") set(BZIP2_LIBRARIES "bzip2")
set(ZLIB_LIBRARIES "zlib") set(ZLIB_LIBRARIES "zlib")
if( NOT EXTERNAL_MYSQL ) if( USE_MYSQL_SOURCES )
set(MYSQL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/dep/mysqllite/include) set(MYSQL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/dep/mysqllite/include)
set(MYSQL_LIBRARY "libmysql") set(MYSQL_LIBRARY "libmysql")
set( MYSQL_FOUND 1 ) set( MYSQL_FOUND 1 )
message(STATUS "Using internal MySQL.") message(STATUS "Using supplied MySQL sources")
endif() endif()
# check the CMake preload parameters (commented out by default) # check the CMake preload parameters (commented out by default)
+3 -4
View File
@@ -77,12 +77,11 @@ else()
endif() endif()
if( WIN32 ) if( WIN32 )
if( EXTERNAL_MYSQL ) if( USE_MYSQL_SOURCES )
message("* Use external MySQL : Yes") message("* Use MySQL sourcetree : Yes (default)")
else() else()
message("* Use external MySQL : No (default)") message("* Use MySQL sourcetree : No")
endif() endif()
endif( WIN32 ) endif( WIN32 )
message("") message("")
+1 -7
View File
@@ -157,21 +157,15 @@ endif()
set_target_properties(worldserver PROPERTIES LINK_FLAGS "${worldserver_LINK_FLAGS}") set_target_properties(worldserver PROPERTIES LINK_FLAGS "${worldserver_LINK_FLAGS}")
if( SCRIPTS )
set(SCRIPT_LIB "scripts")
else()
set(SCRIPT_LIB "")
endif()
target_link_libraries(worldserver target_link_libraries(worldserver
game game
shared shared
scripts
trinitysockets trinitysockets
collision collision
g3dlib g3dlib
gsoap gsoap
${JEMALLOC_LIB} ${JEMALLOC_LIB}
${SCRIPT_LIB}
${READLINE_LIBRARY} ${READLINE_LIBRARY}
${TERMCAP_LIBRARY} ${TERMCAP_LIBRARY}
${ACE_LIBRARY} ${ACE_LIBRARY}