Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r 0f1f3c598179 .hgignore
- --- a/.hgignore Wed Aug 24 00:59:58 2011 +0200
- +++ b/.hgignore Tue Sep 06 12:59:16 2011 +0200
- @@ -4,3 +4,4 @@
- *.lib
- *.a
- *.dll
- +CMakeLists.txt.user
- diff -r 0f1f3c598179 CMakeLists.txt
- --- a/CMakeLists.txt Wed Aug 24 00:59:58 2011 +0200
- +++ b/CMakeLists.txt Tue Sep 06 12:59:16 2011 +0200
- @@ -1,9 +1,9 @@
- cmake_minimum_required(VERSION 2.6)
- ##
- -## set project name
- +## Project name
- ##
- -project(ja2smp)
- +PROJECT(ja2smp)
- ##
- ## basic directories
- @@ -11,14 +11,10 @@
- set(SMP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
- set(SMP_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
- -##
- -## external libraries (e.g, SDL, etc.)
- -##
- -## defines variables : SMP_DEFINITIONS, SMP_INCLUDE_DIRS, SMP_LIBRARY_DIRS, SMP_LIBRARIES
- +# ==================================================================================================
- +# Dependencies | defines variables : SMP_DEFINITIONS, SMP_INCLUDE_DIRS, SMP_LIBRARY_DIRS, SMP_LIBRARIES
- include( ExternalLibraries.cmake )
- -#set(BUILD_SHARED_LIBS ON)
- -
- #if(NOT LIBRARY_OUTPUT_PATH)
- set(LIBRARY_OUTPUT_PATH ${SMP_BINARY_DIR}/lib)
- #endif()
- @@ -32,9 +28,8 @@
- set(SMP_DEFINITIONS ${SMP_DEFINITIONS} -DJA2)
- -##
- -## Language
- -##
- +# ==================================================================================================
- +# Language
- ## supported languages
- set(SMP_LANGUAGES "Dutch" "English" "French" "German" "Italian" "Polish" "Russian" "Russian Gold")
- @@ -71,6 +66,7 @@
- set(_current_language ${lang})
- endif()
- endforeach()
- +# --------------------------------------------------------------------------------------------------
- ## MSVC compatibility settings
- if(MSVC)
- diff -r 0f1f3c598179 ExternalLibraries.cmake
- --- a/ExternalLibraries.cmake Wed Aug 24 00:59:58 2011 +0200
- +++ b/ExternalLibraries.cmake Tue Sep 06 12:59:16 2011 +0200
- @@ -1,83 +1,178 @@
- +# ==================================================================================================
- +# Macros
- -## find SDL
- -find_package( SDL REQUIRED )
- -if(NOT SDL_FOUND)
- +SET(PRINT_COMPILE_LENGTH "40")
- +MACRO(FILL_WITH_DOTS VAR)
- + STRING(LENGTH ${${VAR}} NAME_LENGTH)
- + MATH(EXPR DOT_LENGTH "${PRINT_COMPILE_LENGTH} - ${NAME_LENGTH}")
- + IF(${DOT_LENGTH} LESS 0)
- + SET(DOT_LENGTH 0)
- + ENDIF(${DOT_LENGTH} LESS 0)
- + FOREACH(COUNT RANGE ${DOT_LENGTH})
- + SET(${VAR} "${${VAR}}.")
- + ENDFOREACH(COUNT)
- +ENDMACRO(FILL_WITH_DOTS)
- +
- +MACRO(PRINT_LIBRARY_STATUS NAME VERSIONHINT LOCATION)
- + SET(LIB_MESSAGE "${NAME} library found")
- + FILL_WITH_DOTS(LIB_MESSAGE)
- + IF(${ARGN})
- + MESSAGE(STATUS " ${LIB_MESSAGE} YES (${LOCATION})")
- + ELSE(${ARGN})
- + MESSAGE(STATUS " ${LIB_MESSAGE} NO")
- + ENDIF(${ARGN})
- +ENDMACRO(PRINT_LIBRARY_STATUS)
- +
- +# ==================================================================================================
- +# Required dependencies
- +
- +FIND_PACKAGE( SDL REQUIRED )
- +
- +IF(NOT SDL_FOUND)
- ## if SDL was not found regularly (e.g. by reading the SDLDIR environment variable)
- ## ask user for the path to the local SDL installation
- - set(SDL_PATH "" CACHE PATH "Provide path to SDL")
- - if(NOT SDL_PATH)
- - message(FATAL_ERROR "no SDL path")
- - endif()
- + SET(SDL_PATH "" CACHE PATH "Provide path to SDL")
- + IF(NOT SDL_PATH)
- + message(FATAL_ERROR "Path to SDL was not provided")
- + ENDIF(NOT SDL_PATH)
- ## set given path as SDLDIR environment variable and search again
- - set( ENV{SDLDIR} ${SDL_PATH} )
- + SET( ENV{SDLDIR} ${SDL_PATH} )
- find_package( SDL REQUIRED )
- -
- - mark_as_advanced(SDL_INCLUDE_DIR)
- - mark_as_advanced(SDL_LIBRARY)
- - mark_as_advanced(SDLMAIN_LIBRARY)
- -endif()
- +ENDIF(NOT SDL_FOUND)
- ## setup variables
- set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${SDL_INCLUDE_DIR} )
- set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${SDL_LIB} )
- set( SMP_LIBRARIES ${SMP_LIBRARIES} ${SDL_LIBRARY} )
- -##
- -## ask for libraries path and find their config files
- -##
- +MARK_AS_ADVANCED(SDL_INCLUDE_DIR)
- +MARK_AS_ADVANCED(SDL_LIBRARY)
- +MARK_AS_ADVANCED(SDLMAIN_LIBRARY)
- +
- +# ==================================================================================================
- +# Optional dependencies
- +
- +SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
- +
- +FIND_PACKAGE( Lua51 )
- +FIND_PACKAGE( EXPAT )
- +FIND_PACKAGE( PNG )
- +FIND_PACKAGE( Sqlite )
- +#TODO: FIND_PACKAGE( bfVFS )
- +
- +# **** DELETE THIS **** #
- +SET(LUA51_FOUND OFF)
- +SET(EXPAT_FOUND OFF)
- +SET(PNG_FOUND OFF)
- +SET(SQLITE_FOUND OFF)
- +SET(BFVFS_FOUND OFF)
- +
- +## First check if the libraries are available in the system
- +## If not, use the SMP libraries
- +IF(NOT LUA51_FOUND)
- + SET( MISSING_LIBS ${MISSING_LIBS} "lua")
- +ENDIF(NOT LUA51_FOUND)
- +
- +IF(NOT EXPAT_FOUND)
- + SET( MISSING_LIBS ${MISSING_LIBS} "expat")
- +ENDIF(NOT EXPAT_FOUND)
- +
- +IF(NOT PNG_FOUND)
- + SET( MISSING_LIBS ${MISSING_LIBS} "libpng")
- +ENDIF(NOT PNG_FOUND)
- +
- +IF(NOT SQLITE_FOUND)
- + SET( MISSING_LIBS ${MISSING_LIBS} "sqlite")
- +ENDIF(NOT SQLITE_FOUND)
- +
- +IF(NOT BFVFS_FOUND)
- + SET( MISSING_LIBS ${MISSING_LIBS} "bfvfs")
- +ENDIF(NOT BFVFS_FOUND)
- ## get Path to SMP libraries
- -set(SMP_LIBS_DIR "SMP_LIBS_DIR_NOT_FOUND" CACHE PATH "Path to the external SMP libraries")
- -string(COMPARE NOTEQUAL ${SMP_LIBS_DIR} "SMP_LIBS_DIR_NOT_FOUND" SMP_LIBS_FOUND)
- -if(NOT ${SMP_LIBS_FOUND})
- - message(FATAL_ERROR "No path to external libraries given")
- -endif()
- +SET(SMP_LIBS_DIR "SMP_LIBS_DIR_NOT_FOUND" CACHE PATH "Path to the external SMP libraries")
- +STRING(COMPARE NOTEQUAL ${SMP_LIBS_DIR} "SMP_LIBS_DIR_NOT_FOUND" SMP_LIBS_FOUND)
- ## find bfVFS
- -find_file(BFVFS_CONFIG_FILE "BFVFSConfig.cmake" PATHS ${SMP_LIBS_DIR})
- -mark_as_advanced(BFVFS_CONFIG_FILE)
- -if(BFVFS_CONFIG_FILE)
- - include( ${BFVFS_CONFIG_FILE} )
- -else()
- - message("could not find bfVFS config file")
- -endif()
- +LIST(FIND MISSING_LIBS "bfvfs" BFVFS_MISSING)
- +IF(NOT ${BFVFS_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- + FIND_FILE(BFVFS_CONFIG_FILE "BFVFSConfig.cmake" PATHS ${SMP_LIBS_DIR})
- + MARK_AS_ADVANCED(BFVFS_CONFIG_FILE)
- + IF(BFVFS_CONFIG_FILE)
- + INCLUDE( ${BFVFS_CONFIG_FILE} )
- + SET(BFVFS_LOC "inbuilt")
- + ELSE(BFVFS_CONFIG_FILE)
- + MESSAGE(SEND_ERROR "could not find bfVFS config file")
- + ENDIF(BFVFS_CONFIG_FILE)
- +ELSEIF(NOT ${BFVFS_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- + SET(BFVFS_LOC "system")
- +ENDIF(NOT ${BFVFS_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- -## find LUA
- -find_file(LUA_CONFIG_FILE "LuaConfig.cmake" PATHS ${SMP_LIBS_DIR})
- -mark_as_advanced(LUA_CONFIG_FILE)
- -if(LUA_CONFIG_FILE)
- - include( ${LUA_CONFIG_FILE} )
- -else()
- - message("could not find LUA config file")
- -endif()
- +## find Lua
- +LIST(FIND MISSING_LIBS "lua" LUA_MISSING)
- +IF(NOT ${LUA_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- + FIND_FILE(LUA_CONFIG_FILE "LuaConfig.cmake" PATHS ${SMP_LIBS_DIR})
- + MARK_AS_ADVANCED(LUA_CONFIG_FILE)
- + IF(LUA_CONFIG_FILE)
- + INCLUDE( ${LUA_CONFIG_FILE} )
- + SET(LUA_LOC "inbuilt")
- + ELSE(LUA_CONFIG_FILE)
- + MESSAGE(SEND_ERROR "could not find Lua config file")
- + ENDIF(LUA_CONFIG_FILE)
- +ELSE(NOT ${LUA_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- + SET(LUA_LOC "system")
- +ENDIF(NOT ${LUA_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- -## find SQLITE
- -find_file(SQLITE_CONFIG_FILE "SQLiteConfig.cmake" PATHS ${SMP_LIBS_DIR})
- -mark_as_advanced(SQLITE_CONFIG_FILE)
- -if(SQLITE_CONFIG_FILE)
- - include( ${SQLITE_CONFIG_FILE} )
- -else()
- - message("could not find SQLITE config file")
- -endif()
- +## find SQLite
- +LIST(FIND MISSING_LIBS "sqlite" SQLITE_MISSING)
- +IF(NOT ${SQLITE_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- + FIND_FILE(SQLITE_CONFIG_FILE "SQLiteConfig.cmake" PATHS ${SMP_LIBS_DIR})
- + MARK_AS_ADVANCED(SQLITE_CONFIG_FILE)
- + IF(SQLITE_CONFIG_FILE)
- + INCLUDE( ${SQLITE_CONFIG_FILE} )
- + SET(SQLITE_LOC "inbuilt")
- + ELSE(SQLITE_CONFIG_FILE)
- + MESSAGE(SEND_ERROR "could not find SQLITE config file")
- + ENDIF(SQLITE_CONFIG_FILE)
- +ELSE(NOT ${SQLITE_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- + SET(SQLITE_LOC "system")
- + # TODO: move this
- + MARK_AS_ADVANCED(SQLITE_INCLUDE_DIR)
- + MARK_AS_ADVANCED(SQLITE_LIBRARY_DEBUG)
- + MARK_AS_ADVANCED(SQLITE_LIBRARY_RELEASE)
- +ENDIF(NOT ${SQLITE_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- -## find EXPAT XML
- -find_file(EXPAT_CONFIG_FILE "ExpatConfig.cmake" PATHS ${SMP_LIBS_DIR})
- -mark_as_advanced(EXPAT_CONFIG_FILE)
- -if(EXPAT_CONFIG_FILE)
- - include( ${EXPAT_CONFIG_FILE} )
- -else()
- - message("could not find Expat config file")
- -endif()
- +## find EXPAT
- +LIST(FIND MISSING_LIBS "expat" EXPAT_MISSING)
- +IF(NOT ${EXPAT_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- + FIND_FILE(EXPAT_CONFIG_FILE "ExpatConfig.cmake" PATHS ${SMP_LIBS_DIR})
- + MARK_AS_ADVANCED(EXPAT_CONFIG_FILE)
- + IF(EXPAT_CONFIG_FILE)
- + INCLUDE( ${EXPAT_CONFIG_FILE} )
- + SET(EXPAT_LOC "inbuilt")
- + ELSE(EXPAT_CONFIG_FILE)
- + MESSAGE(SEND_ERROR "could not find EXPAT config file")
- + ENDIF(EXPAT_CONFIG_FILE)
- +ELSE(NOT ${EXPAT_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- + SET(EXPAT_LOC "system")
- +ENDIF(NOT ${EXPAT_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- ## find LIBPNG
- -find_file(LIBPNG_CONFIG_FILE "LibpngConfig.cmake" PATHS ${SMP_LIBS_DIR})
- -mark_as_advanced(LIBPNG_CONFIG_FILE)
- -if(LIBPNG_CONFIG_FILE)
- - include( ${LIBPNG_CONFIG_FILE} )
- -else()
- - message("could not find Libpng config file")
- -endif()
- +LIST(FIND MISSING_LIBS "libpng" LIBPNG_MISSING)
- +IF(NOT ${LIBPNG_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- + FIND_FILE(LIBPNG_CONFIG_FILE "LibpngConfig.cmake" PATHS ${SMP_LIBS_DIR})
- + MARK_AS_ADVANCED(LIBPNG_CONFIG_FILE)
- + IF(LIBPNG_CONFIG_FILE)
- + INCLUDE( ${LIBPNG_CONFIG_FILE} )
- + SET(LIBPNG_LOC "inbuilt")
- + ELSE(LIBPNG_CONFIG_FILE)
- + MESSAGE(SEND_ERROR "could not find LIBPNG config file")
- + ENDIF(LIBPNG_CONFIG_FILE)
- +ELSE(NOT ${LIBPNG_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- + SET(LIBPNG_LOC "system")
- + SET(LIBPNG_FOUND ${PNG_FOUND})
- +ENDIF(NOT ${LIBPNG_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
- ## options for other external libraries
- if(BFVFS_FOUND)
- @@ -88,7 +183,7 @@
- option(SMP_WITH_XML "enable XML support" ON)
- endif()
- ##
- -if(LUA_FOUND)
- +if(LUA51_FOUND)
- option(SMP_WITH_LUA "enable Lua support" ON)
- endif()
- ##
- @@ -97,46 +192,74 @@
- endif()
- ##
- if(LIBPNG_FOUND)
- - option(SMP_WITH_LIBPNG "enable SQLite support" ON)
- + option(SMP_WITH_LIBPNG "enable libpng support" ON)
- endif()
- +MESSAGE(STATUS "----------------------------------------------------------------------------")
- +MESSAGE(STATUS "CHECKING FOR OPTIONAL DEPENDECIES")
- +MESSAGE(STATUS "")
- +PRINT_LIBRARY_STATUS("bfVFS" "" "${BFVFS_LOC}" BFVFS_FOUND)
- +PRINT_LIBRARY_STATUS("expat" "" "${EXPAT_LOC}" EXPAT_FOUND)
- +PRINT_LIBRARY_STATUS("lua" "(version >= 5.1)" "${LUA_LOC}" LUA51_FOUND)
- +PRINT_LIBRARY_STATUS("sqlite" "(version >= 3)" "${SQLITE_LOC}" SQLITE_FOUND)
- +PRINT_LIBRARY_STATUS("libpng" "" "${LIBPNG_LOC}" LIBPNG_FOUND)
- +
- +## No of missing libs
- +LIST(LENGTH MISSING_LIBS NUM_LIBS_MISSING)
- +
- +IF(NOT ${SMP_LIBS_FOUND} AND ${NUM_LIBS_MISSING} GREATER 0)
- + MESSAGE(STATUS "")
- + MESSAGE(STATUS "**********")
- + MESSAGE(STATUS "* NOTICE *")
- + MESSAGE(STATUS "**********")
- + FOREACH(MISSING_LIB ${MISSING_LIBS})
- + MESSAGE(STATUS " - library ${MISSING_LIB} missing")
- + ENDFOREACH(MISSING_LIB ${MISSING_LIBS})
- + MESSAGE(STATUS "You can either install the missing libraries or build them and set ")
- + MESSAGE(STATUS "the SMP_LIBS_DIR variable using cmake-gui.")
- + MESSAGE(SEND_ERROR "Please install the missing libraries")
- +ENDIF(NOT ${SMP_LIBS_FOUND} AND ${NUM_LIBS_MISSING} GREATER 0)
- +
- +MESSAGE(STATUS "")
- +MESSAGE(STATUS "----------------------------------------------------------------------------")
- +MESSAGE(STATUS "")
- if(SMP_WITH_BFVFS)
- ## setup variables
- set( SMP_DEFINITIONS ${SMP_DEFINITIONS} -DWITH_VFS ${BFVFS_DEFINITIONS} )
- - set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${BFVFS_INCLUDE_DIRS} )
- - set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${BFVFS_LIBRARY_DIRS} )
- + set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${BFVFS_INCLUDE_DIR} )
- + set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${BFVFS_LIBRARY_DIR} )
- set( SMP_LIBRARIES ${SMP_LIBRARIES} ${BFVFS_LIBRARIES} )
- endif()
- if(SMP_WITH_LUA)
- ## setup variables
- set( SMP_DEFINITIONS ${SMP_DEFINITIONS} -DWITH_LUA ${LUA_DEFINITIONS} )
- - set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${LUA_INCLUDE_DIRS} )
- - set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${LUA_LIBRARY_DIRS} )
- + set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${LUA_INCLUDE_DIR} )
- + set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${LUA_LIBRARY_DIR} )
- set( SMP_LIBRARIES ${SMP_LIBRARIES} ${LUA_LIBRARIES} )
- endif()
- if(SMP_WITH_SQLITE)
- ## setup variables
- set( SMP_DEFINITIONS ${SMP_DEFINITIONS} -DWITH_SQLITE ${SQLITE_DEFINITIONS} )
- - set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${SQLITE_INCLUDE_DIRS} )
- - set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${SQLITE_LIBRARY_DIRS} )
- + set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${SQLITE_INCLUDE_DIR} )
- + set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${SQLITE_LIBRARY_DIR} )
- set( SMP_LIBRARIES ${SMP_LIBRARIES} ${SQLITE_LIBRARIES} )
- endif()
- if(SMP_WITH_XML)
- ## setup variables
- set( SMP_DEFINITIONS ${SMP_DEFINITIONS} -DWITH_XML ${EXPAT_DEFINITIONS} )
- - set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${EXPAT_INCLUDE_DIRS} )
- - set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${EXPAT_LIBRARY_DIRS} )
- + set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${EXPAT_INCLUDE_DIR} )
- + set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${EXPAT_LIBRARY_DIR} )
- set( SMP_LIBRARIES ${SMP_LIBRARIES} ${EXPAT_LIBRARIES} )
- endif()
- if(SMP_WITH_LIBPNG)
- ## setup variables
- set( SMP_DEFINITIONS ${SMP_DEFINITIONS} -DWITH_PNG ${LIBPNG_DEFINITIONS} )
- - set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${LIBPNG_INCLUDE_DIRS} )
- - set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${LIBPNG_LIBRARY_DIRS} )
- + set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${LIBPNG_INCLUDE_DIR} )
- + set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${LIBPNG_LIBRARY_DIR} )
- set( SMP_LIBRARIES ${SMP_LIBRARIES} ${LIBPNG_LIBRARIES} )
- endif()
- diff -r 0f1f3c598179 cmake/modules/FindSqlite.cmake
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/cmake/modules/FindSqlite.cmake Tue Sep 06 12:59:16 2011 +0200
- @@ -0,0 +1,56 @@
- +# - find Sqlite 3
- +# SQLITE_INCLUDE_DIR - Where to find Sqlite 3 header files (directory)
- +# SQLITE_LIBRARIES - Sqlite 3 libraries
- +# SQLITE_LIBRARY_RELEASE - Where the release library is
- +# SQLITE_LIBRARY_DEBUG - Where the debug library is
- +# SQLITE_FOUND - Set to TRUE if we found everything (library, includes and executable)
- +
- +# Copyright (c) 2010 Pau Garcia i Quiles, <[email protected]>
- +#
- +# Redistribution and use is allowed according to the terms of the BSD license.
- +# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
- +#
- +# Generated by CModuler, a CMake Module Generator - http://gitorious.org/cmoduler
- +
- +IF( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARY_RELEASE AND SQLITE_LIBRARY_DEBUG )
- + SET(SQLITE_FIND_QUIETLY TRUE)
- +ENDIF( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARY_RELEASE AND SQLITE_LIBRARY_DEBUG )
- +
- +FIND_PATH( SQLITE_INCLUDE_DIR sqlite3.h )
- +
- +FIND_LIBRARY(SQLITE_LIBRARY_RELEASE NAMES sqlite3 )
- +
- +FIND_LIBRARY(SQLITE_LIBRARY_DEBUG NAMES sqlite3 sqlite3d HINTS /usr/lib/debug/usr/lib/ )
- +
- +IF( SQLITE_LIBRARY_RELEASE OR SQLITE_LIBRARY_DEBUG AND SQLITE_INCLUDE_DIR )
- + SET( SQLITE_FOUND TRUE )
- +ENDIF( SQLITE_LIBRARY_RELEASE OR SQLITE_LIBRARY_DEBUG AND SQLITE_INCLUDE_DIR )
- +
- +IF( SQLITE_LIBRARY_DEBUG AND SQLITE_LIBRARY_RELEASE )
- + # if the generator supports configuration types then set
- + # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
- + IF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
- + SET( SQLITE_LIBRARIES optimized ${SQLITE_LIBRARY_RELEASE} debug ${SQLITE_LIBRARY_DEBUG} )
- + ELSE( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
- + # if there are no configuration types and CMAKE_BUILD_TYPE has no value
- + # then just use the release libraries
- + SET( SQLITE_LIBRARIES ${SQLITE_LIBRARY_RELEASE} )
- + ENDIF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
- +ELSEIF( SQLITE_LIBRARY_RELEASE )
- + SET( SQLITE_LIBRARIES ${SQLITE_LIBRARY_RELEASE} )
- +ELSE( SQLITE_LIBRARY_DEBUG AND SQLITE_LIBRARY_RELEASE )
- + SET( SQLITE_LIBRARIES ${SQLITE_LIBRARY_DEBUG} )
- +ENDIF( SQLITE_LIBRARY_DEBUG AND SQLITE_LIBRARY_RELEASE )
- +
- +IF( SQLITE_FOUND )
- + IF( NOT SQLITE_FIND_QUIETLY )
- + MESSAGE( STATUS "Found Sqlite3 header file in ${SQLITE_INCLUDE_DIR}")
- + MESSAGE( STATUS "Found Sqlite3 libraries: ${SQLITE_LIBRARIES}")
- + ENDIF( NOT SQLITE_FIND_QUIETLY )
- +ELSE(SQLITE_FOUND)
- + IF( SQLITE_FIND_REQUIRED)
- + MESSAGE( FATAL_ERROR "Could not find Sqlite3" )
- + ELSE( SQLITE_FIND_REQUIRED)
- + MESSAGE( STATUS "Optional package Sqlite3 was not found" )
- + ENDIF( SQLITE_FIND_REQUIRED)
- +ENDIF(SQLITE_FOUND)
- diff -r 0f1f3c598179 sgp/utils/sgp_exception.cpp
- --- a/sgp/utils/sgp_exception.cpp Wed Aug 24 00:59:58 2011 +0200
- +++ b/sgp/utils/sgp_exception.cpp Tue Sep 06 12:59:16 2011 +0200
- @@ -7,6 +7,8 @@
- #include <sgp_exception.h>
- +#include <string>
- +#include <sstream>
- #if defined(WITH_VFS)
- # include <vfs/Core/vfs_string.h>
- @@ -121,7 +123,7 @@
- const char* sgp::Exception::what() const throw()
- {
- // cannot return pointer local variable
- - std::stringstream ss;
- + std::stringstream ss;
- ss.str("");
- ss.clear();
- diff -r 0f1f3c598179 sgp/utils/sgp_wstring.cpp
- --- a/sgp/utils/sgp_wstring.cpp Wed Aug 24 00:59:58 2011 +0200
- +++ b/sgp/utils/sgp_wstring.cpp Tue Sep 06 12:59:16 2011 +0200
- @@ -6,6 +6,7 @@
- */
- #include <sgp_wstring.h>
- +#include <stdlib.h>
- #if defined(WITH_VFS)
- # include <vfs/Aspects/vfs_settings.h>
Advertisement
Add Comment
Please, Sign In to add comment