Sim

cmake_find_libs.patch

Sim
Sep 6th, 2011
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 17.82 KB | None | 0 0
  1. diff -r 0f1f3c598179 .hgignore
  2. --- a/.hgignore Wed Aug 24 00:59:58 2011 +0200
  3. +++ b/.hgignore Tue Sep 06 12:59:16 2011 +0200
  4. @@ -4,3 +4,4 @@
  5.  *.lib
  6.  *.a
  7.  *.dll
  8. +CMakeLists.txt.user
  9. diff -r 0f1f3c598179 CMakeLists.txt
  10. --- a/CMakeLists.txt    Wed Aug 24 00:59:58 2011 +0200
  11. +++ b/CMakeLists.txt    Tue Sep 06 12:59:16 2011 +0200
  12. @@ -1,9 +1,9 @@
  13.  cmake_minimum_required(VERSION 2.6)
  14.  
  15.  ##
  16. -## set project name
  17. +## Project name
  18.  ##
  19. -project(ja2smp)
  20. +PROJECT(ja2smp)
  21.  
  22.  ##
  23.  ## basic directories
  24. @@ -11,14 +11,10 @@
  25.  set(SMP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
  26.  set(SMP_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
  27.  
  28. -##
  29. -## external libraries (e.g, SDL, etc.)
  30. -##
  31. -## defines variables : SMP_DEFINITIONS, SMP_INCLUDE_DIRS, SMP_LIBRARY_DIRS, SMP_LIBRARIES
  32. +# ==================================================================================================
  33. +# Dependencies | defines variables : SMP_DEFINITIONS, SMP_INCLUDE_DIRS, SMP_LIBRARY_DIRS, SMP_LIBRARIES
  34.  include( ExternalLibraries.cmake )
  35.  
  36. -#set(BUILD_SHARED_LIBS ON)
  37. -
  38.  #if(NOT LIBRARY_OUTPUT_PATH)
  39.    set(LIBRARY_OUTPUT_PATH    ${SMP_BINARY_DIR}/lib)
  40.  #endif()
  41. @@ -32,9 +28,8 @@
  42.  
  43.  set(SMP_DEFINITIONS ${SMP_DEFINITIONS} -DJA2)
  44.  
  45. -##
  46. -## Language
  47. -##
  48. +# ==================================================================================================
  49. +# Language
  50.  
  51.  ## supported languages
  52.  set(SMP_LANGUAGES "Dutch" "English" "French" "German" "Italian" "Polish" "Russian" "Russian Gold")
  53. @@ -71,6 +66,7 @@
  54.         set(_current_language ${lang})
  55.     endif()
  56.  endforeach()
  57. +# --------------------------------------------------------------------------------------------------
  58.  
  59.  ## MSVC compatibility settings
  60.  if(MSVC)
  61. diff -r 0f1f3c598179 ExternalLibraries.cmake
  62. --- a/ExternalLibraries.cmake   Wed Aug 24 00:59:58 2011 +0200
  63. +++ b/ExternalLibraries.cmake   Tue Sep 06 12:59:16 2011 +0200
  64. @@ -1,83 +1,178 @@
  65. +# ==================================================================================================
  66. +# Macros
  67.  
  68. -## find SDL
  69. -find_package( SDL REQUIRED )
  70. -if(NOT SDL_FOUND)
  71. +SET(PRINT_COMPILE_LENGTH "40")
  72. +MACRO(FILL_WITH_DOTS VAR)
  73. +    STRING(LENGTH ${${VAR}} NAME_LENGTH)
  74. +    MATH(EXPR DOT_LENGTH "${PRINT_COMPILE_LENGTH} - ${NAME_LENGTH}")
  75. +    IF(${DOT_LENGTH} LESS 0)
  76. +        SET(DOT_LENGTH 0)
  77. +    ENDIF(${DOT_LENGTH} LESS 0)
  78. +    FOREACH(COUNT RANGE ${DOT_LENGTH})
  79. +        SET(${VAR} "${${VAR}}.")
  80. +    ENDFOREACH(COUNT)
  81. +ENDMACRO(FILL_WITH_DOTS)
  82. +
  83. +MACRO(PRINT_LIBRARY_STATUS NAME VERSIONHINT LOCATION)
  84. +    SET(LIB_MESSAGE "${NAME} library found")
  85. +    FILL_WITH_DOTS(LIB_MESSAGE)
  86. +    IF(${ARGN})
  87. +        MESSAGE(STATUS " ${LIB_MESSAGE} YES (${LOCATION})")
  88. +    ELSE(${ARGN})
  89. +        MESSAGE(STATUS " ${LIB_MESSAGE} NO")
  90. +    ENDIF(${ARGN})
  91. +ENDMACRO(PRINT_LIBRARY_STATUS)
  92. +
  93. +# ==================================================================================================
  94. +# Required dependencies
  95. +
  96. +FIND_PACKAGE( SDL REQUIRED )
  97. +
  98. +IF(NOT SDL_FOUND)
  99.    ## if SDL was not found regularly (e.g. by reading the SDLDIR environment variable)
  100.    ## ask user for the path to the local SDL installation
  101. -  set(SDL_PATH "" CACHE PATH "Provide path to SDL")
  102. -  if(NOT SDL_PATH)
  103. -    message(FATAL_ERROR "no SDL path")
  104. -  endif()
  105. +  SET(SDL_PATH "" CACHE PATH "Provide path to SDL")
  106. +  IF(NOT SDL_PATH)
  107. +    message(FATAL_ERROR "Path to SDL was not provided")
  108. +  ENDIF(NOT SDL_PATH)
  109.  
  110.    ## set given path as SDLDIR environment variable and search again
  111. -  set( ENV{SDLDIR} ${SDL_PATH} )
  112. +  SET( ENV{SDLDIR} ${SDL_PATH} )
  113.    find_package( SDL REQUIRED )
  114. -  
  115. -  mark_as_advanced(SDL_INCLUDE_DIR)
  116. -  mark_as_advanced(SDL_LIBRARY)
  117. -  mark_as_advanced(SDLMAIN_LIBRARY)
  118. -endif()
  119. +ENDIF(NOT SDL_FOUND)
  120.  
  121.  ## setup variables
  122.  set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${SDL_INCLUDE_DIR} )
  123.  set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${SDL_LIB} )
  124.  set( SMP_LIBRARIES    ${SMP_LIBRARIES}    ${SDL_LIBRARY} )
  125.  
  126. -##
  127. -## ask for libraries path and find their config files
  128. -##
  129. +MARK_AS_ADVANCED(SDL_INCLUDE_DIR)
  130. +MARK_AS_ADVANCED(SDL_LIBRARY)
  131. +MARK_AS_ADVANCED(SDLMAIN_LIBRARY)
  132. +
  133. +# ==================================================================================================
  134. +# Optional dependencies
  135. +
  136. +SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
  137. +
  138. +FIND_PACKAGE( Lua51 )
  139. +FIND_PACKAGE( EXPAT )
  140. +FIND_PACKAGE( PNG )
  141. +FIND_PACKAGE( Sqlite )
  142. +#TODO: FIND_PACKAGE( bfVFS )
  143. +
  144. +# **** DELETE THIS **** #
  145. +SET(LUA51_FOUND OFF)
  146. +SET(EXPAT_FOUND OFF)
  147. +SET(PNG_FOUND OFF)
  148. +SET(SQLITE_FOUND OFF)
  149. +SET(BFVFS_FOUND OFF)
  150. +
  151. +## First check if the libraries are available in the system
  152. +## If not, use the SMP libraries
  153. +IF(NOT LUA51_FOUND)
  154. +  SET( MISSING_LIBS ${MISSING_LIBS} "lua")
  155. +ENDIF(NOT LUA51_FOUND)
  156. +
  157. +IF(NOT EXPAT_FOUND)
  158. +  SET( MISSING_LIBS ${MISSING_LIBS} "expat")
  159. +ENDIF(NOT EXPAT_FOUND)
  160. +
  161. +IF(NOT PNG_FOUND)
  162. +  SET( MISSING_LIBS ${MISSING_LIBS} "libpng")
  163. +ENDIF(NOT PNG_FOUND)
  164. +
  165. +IF(NOT SQLITE_FOUND)
  166. +  SET( MISSING_LIBS ${MISSING_LIBS} "sqlite")
  167. +ENDIF(NOT SQLITE_FOUND)
  168. +
  169. +IF(NOT BFVFS_FOUND)
  170. +  SET( MISSING_LIBS ${MISSING_LIBS} "bfvfs")
  171. +ENDIF(NOT BFVFS_FOUND)
  172.  
  173.  ## get Path to SMP libraries
  174. -set(SMP_LIBS_DIR "SMP_LIBS_DIR_NOT_FOUND" CACHE PATH "Path to the external SMP libraries")
  175. -string(COMPARE NOTEQUAL ${SMP_LIBS_DIR} "SMP_LIBS_DIR_NOT_FOUND" SMP_LIBS_FOUND)
  176. -if(NOT ${SMP_LIBS_FOUND})
  177. -  message(FATAL_ERROR "No path to external libraries given")
  178. -endif()
  179. +SET(SMP_LIBS_DIR "SMP_LIBS_DIR_NOT_FOUND" CACHE PATH "Path to the external SMP libraries")
  180. +STRING(COMPARE NOTEQUAL ${SMP_LIBS_DIR} "SMP_LIBS_DIR_NOT_FOUND" SMP_LIBS_FOUND)
  181.  
  182.  ## find bfVFS
  183. -find_file(BFVFS_CONFIG_FILE "BFVFSConfig.cmake" PATHS ${SMP_LIBS_DIR})
  184. -mark_as_advanced(BFVFS_CONFIG_FILE)
  185. -if(BFVFS_CONFIG_FILE)
  186. -  include( ${BFVFS_CONFIG_FILE} )
  187. -else()
  188. -  message("could not find bfVFS config file")
  189. -endif()
  190. +LIST(FIND MISSING_LIBS "bfvfs" BFVFS_MISSING)
  191. +IF(NOT ${BFVFS_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  192. +  FIND_FILE(BFVFS_CONFIG_FILE "BFVFSConfig.cmake" PATHS ${SMP_LIBS_DIR})
  193. +  MARK_AS_ADVANCED(BFVFS_CONFIG_FILE)
  194. +  IF(BFVFS_CONFIG_FILE)
  195. +    INCLUDE( ${BFVFS_CONFIG_FILE} )
  196. +    SET(BFVFS_LOC "inbuilt")
  197. +  ELSE(BFVFS_CONFIG_FILE)
  198. +    MESSAGE(SEND_ERROR "could not find bfVFS config file")
  199. +  ENDIF(BFVFS_CONFIG_FILE)
  200. +ELSEIF(NOT ${BFVFS_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  201. +  SET(BFVFS_LOC "system")
  202. +ENDIF(NOT ${BFVFS_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  203.  
  204. -## find LUA
  205. -find_file(LUA_CONFIG_FILE "LuaConfig.cmake" PATHS ${SMP_LIBS_DIR})
  206. -mark_as_advanced(LUA_CONFIG_FILE)
  207. -if(LUA_CONFIG_FILE)
  208. -  include( ${LUA_CONFIG_FILE} )
  209. -else()
  210. -  message("could not find LUA config file")
  211. -endif()
  212. +## find Lua
  213. +LIST(FIND MISSING_LIBS "lua" LUA_MISSING)
  214. +IF(NOT ${LUA_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  215. +  FIND_FILE(LUA_CONFIG_FILE "LuaConfig.cmake" PATHS ${SMP_LIBS_DIR})
  216. +  MARK_AS_ADVANCED(LUA_CONFIG_FILE)
  217. +  IF(LUA_CONFIG_FILE)
  218. +    INCLUDE( ${LUA_CONFIG_FILE} )
  219. +    SET(LUA_LOC "inbuilt")
  220. +  ELSE(LUA_CONFIG_FILE)
  221. +    MESSAGE(SEND_ERROR "could not find Lua config file")
  222. +  ENDIF(LUA_CONFIG_FILE)
  223. +ELSE(NOT ${LUA_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  224. +  SET(LUA_LOC "system")
  225. +ENDIF(NOT ${LUA_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  226.  
  227. -## find SQLITE  
  228. -find_file(SQLITE_CONFIG_FILE "SQLiteConfig.cmake" PATHS ${SMP_LIBS_DIR})
  229. -mark_as_advanced(SQLITE_CONFIG_FILE)
  230. -if(SQLITE_CONFIG_FILE)
  231. -  include( ${SQLITE_CONFIG_FILE} )
  232. -else()
  233. -  message("could not find SQLITE config file")
  234. -endif()
  235. +## find SQLite
  236. +LIST(FIND MISSING_LIBS "sqlite" SQLITE_MISSING)
  237. +IF(NOT ${SQLITE_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  238. +  FIND_FILE(SQLITE_CONFIG_FILE "SQLiteConfig.cmake" PATHS ${SMP_LIBS_DIR})
  239. +  MARK_AS_ADVANCED(SQLITE_CONFIG_FILE)
  240. +  IF(SQLITE_CONFIG_FILE)
  241. +    INCLUDE( ${SQLITE_CONFIG_FILE} )
  242. +    SET(SQLITE_LOC "inbuilt")
  243. +  ELSE(SQLITE_CONFIG_FILE)
  244. +    MESSAGE(SEND_ERROR "could not find SQLITE config file")
  245. +  ENDIF(SQLITE_CONFIG_FILE)
  246. +ELSE(NOT ${SQLITE_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  247. +  SET(SQLITE_LOC "system")
  248. +  # TODO: move this
  249. +  MARK_AS_ADVANCED(SQLITE_INCLUDE_DIR)
  250. +  MARK_AS_ADVANCED(SQLITE_LIBRARY_DEBUG)
  251. +  MARK_AS_ADVANCED(SQLITE_LIBRARY_RELEASE)
  252. +ENDIF(NOT ${SQLITE_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  253.  
  254. -## find EXPAT XML
  255. -find_file(EXPAT_CONFIG_FILE "ExpatConfig.cmake" PATHS ${SMP_LIBS_DIR})
  256. -mark_as_advanced(EXPAT_CONFIG_FILE)
  257. -if(EXPAT_CONFIG_FILE)
  258. -  include( ${EXPAT_CONFIG_FILE} )
  259. -else()
  260. -  message("could not find Expat config file")
  261. -endif()
  262. +## find EXPAT
  263. +LIST(FIND MISSING_LIBS "expat" EXPAT_MISSING)
  264. +IF(NOT ${EXPAT_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  265. +  FIND_FILE(EXPAT_CONFIG_FILE "ExpatConfig.cmake" PATHS ${SMP_LIBS_DIR})
  266. +  MARK_AS_ADVANCED(EXPAT_CONFIG_FILE)
  267. +  IF(EXPAT_CONFIG_FILE)
  268. +    INCLUDE( ${EXPAT_CONFIG_FILE} )
  269. +    SET(EXPAT_LOC "inbuilt")
  270. +  ELSE(EXPAT_CONFIG_FILE)
  271. +    MESSAGE(SEND_ERROR "could not find EXPAT config file")
  272. +  ENDIF(EXPAT_CONFIG_FILE)
  273. +ELSE(NOT ${EXPAT_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  274. +  SET(EXPAT_LOC "system")
  275. +ENDIF(NOT ${EXPAT_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  276.  
  277.  ## find LIBPNG
  278. -find_file(LIBPNG_CONFIG_FILE "LibpngConfig.cmake" PATHS ${SMP_LIBS_DIR})
  279. -mark_as_advanced(LIBPNG_CONFIG_FILE)
  280. -if(LIBPNG_CONFIG_FILE)
  281. -  include( ${LIBPNG_CONFIG_FILE} )
  282. -else()
  283. -  message("could not find Libpng config file")
  284. -endif()
  285. +LIST(FIND MISSING_LIBS "libpng" LIBPNG_MISSING)
  286. +IF(NOT ${LIBPNG_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  287. +  FIND_FILE(LIBPNG_CONFIG_FILE "LibpngConfig.cmake" PATHS ${SMP_LIBS_DIR})
  288. +  MARK_AS_ADVANCED(LIBPNG_CONFIG_FILE)
  289. +  IF(LIBPNG_CONFIG_FILE)
  290. +    INCLUDE( ${LIBPNG_CONFIG_FILE} )
  291. +    SET(LIBPNG_LOC "inbuilt")
  292. +  ELSE(LIBPNG_CONFIG_FILE)
  293. +    MESSAGE(SEND_ERROR "could not find LIBPNG config file")
  294. +  ENDIF(LIBPNG_CONFIG_FILE)
  295. +ELSE(NOT ${LIBPNG_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  296. +  SET(LIBPNG_LOC "system")
  297. +  SET(LIBPNG_FOUND ${PNG_FOUND})
  298. +ENDIF(NOT ${LIBPNG_MISSING} EQUAL -1 AND ${SMP_LIBS_FOUND})
  299.  
  300.  ## options for other external libraries
  301.  if(BFVFS_FOUND)
  302. @@ -88,7 +183,7 @@
  303.    option(SMP_WITH_XML "enable XML support" ON)
  304.  endif()
  305.  ##
  306. -if(LUA_FOUND)
  307. +if(LUA51_FOUND)
  308.    option(SMP_WITH_LUA "enable Lua support" ON)
  309.  endif()
  310.  ##
  311. @@ -97,46 +192,74 @@
  312.  endif()
  313.  ##
  314.  if(LIBPNG_FOUND)
  315. -  option(SMP_WITH_LIBPNG "enable SQLite support" ON)
  316. +  option(SMP_WITH_LIBPNG "enable libpng support" ON)
  317.  endif()
  318.  
  319. +MESSAGE(STATUS "----------------------------------------------------------------------------")
  320. +MESSAGE(STATUS "CHECKING FOR OPTIONAL DEPENDECIES")
  321. +MESSAGE(STATUS "")
  322. +PRINT_LIBRARY_STATUS("bfVFS"  "" "${BFVFS_LOC}" BFVFS_FOUND)
  323. +PRINT_LIBRARY_STATUS("expat"  "" "${EXPAT_LOC}" EXPAT_FOUND)
  324. +PRINT_LIBRARY_STATUS("lua"    "(version >= 5.1)" "${LUA_LOC}" LUA51_FOUND)
  325. +PRINT_LIBRARY_STATUS("sqlite" "(version >= 3)" "${SQLITE_LOC}" SQLITE_FOUND)
  326. +PRINT_LIBRARY_STATUS("libpng" "" "${LIBPNG_LOC}" LIBPNG_FOUND)
  327. +
  328. +## No of missing libs
  329. +LIST(LENGTH MISSING_LIBS NUM_LIBS_MISSING)
  330. +
  331. +IF(NOT ${SMP_LIBS_FOUND} AND ${NUM_LIBS_MISSING} GREATER 0)
  332. +  MESSAGE(STATUS "")
  333. +  MESSAGE(STATUS "**********")
  334. +  MESSAGE(STATUS "* NOTICE *")
  335. +  MESSAGE(STATUS "**********")
  336. +  FOREACH(MISSING_LIB ${MISSING_LIBS})
  337. +    MESSAGE(STATUS " - library ${MISSING_LIB} missing")
  338. +  ENDFOREACH(MISSING_LIB ${MISSING_LIBS})
  339. +  MESSAGE(STATUS "You can either install the missing libraries or build them and set ")
  340. +  MESSAGE(STATUS "the SMP_LIBS_DIR variable using cmake-gui.")
  341. +  MESSAGE(SEND_ERROR "Please install the missing libraries")
  342. +ENDIF(NOT ${SMP_LIBS_FOUND} AND ${NUM_LIBS_MISSING} GREATER 0)
  343. +
  344. +MESSAGE(STATUS "")
  345. +MESSAGE(STATUS "----------------------------------------------------------------------------")
  346. +MESSAGE(STATUS "")
  347.  
  348.  if(SMP_WITH_BFVFS)
  349.      ## setup variables
  350.      set( SMP_DEFINITIONS  ${SMP_DEFINITIONS}  -DWITH_VFS ${BFVFS_DEFINITIONS} )
  351. -    set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${BFVFS_INCLUDE_DIRS} )
  352. -    set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${BFVFS_LIBRARY_DIRS} )
  353. +    set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${BFVFS_INCLUDE_DIR} )
  354. +    set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${BFVFS_LIBRARY_DIR} )
  355.      set( SMP_LIBRARIES    ${SMP_LIBRARIES}    ${BFVFS_LIBRARIES} )
  356.  endif()
  357.  
  358.  if(SMP_WITH_LUA)
  359.      ## setup variables
  360.      set( SMP_DEFINITIONS  ${SMP_DEFINITIONS}  -DWITH_LUA ${LUA_DEFINITIONS} )
  361. -    set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${LUA_INCLUDE_DIRS} )
  362. -    set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${LUA_LIBRARY_DIRS} )
  363. +    set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${LUA_INCLUDE_DIR} )
  364. +    set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${LUA_LIBRARY_DIR} )
  365.      set( SMP_LIBRARIES    ${SMP_LIBRARIES}    ${LUA_LIBRARIES} )
  366.  endif()
  367.  
  368.  if(SMP_WITH_SQLITE)
  369.      ## setup variables
  370.      set( SMP_DEFINITIONS  ${SMP_DEFINITIONS}  -DWITH_SQLITE ${SQLITE_DEFINITIONS} )
  371. -    set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${SQLITE_INCLUDE_DIRS} )
  372. -    set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${SQLITE_LIBRARY_DIRS} )
  373. +    set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${SQLITE_INCLUDE_DIR} )
  374. +    set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${SQLITE_LIBRARY_DIR} )
  375.      set( SMP_LIBRARIES    ${SMP_LIBRARIES}    ${SQLITE_LIBRARIES} )
  376.  endif()
  377.  
  378.  if(SMP_WITH_XML)
  379.      ## setup variables
  380.      set( SMP_DEFINITIONS  ${SMP_DEFINITIONS}  -DWITH_XML ${EXPAT_DEFINITIONS} )
  381. -    set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${EXPAT_INCLUDE_DIRS} )
  382. -    set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${EXPAT_LIBRARY_DIRS} )
  383. +    set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${EXPAT_INCLUDE_DIR} )
  384. +    set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${EXPAT_LIBRARY_DIR} )
  385.      set( SMP_LIBRARIES    ${SMP_LIBRARIES}    ${EXPAT_LIBRARIES} )
  386.  endif()
  387.  
  388.  if(SMP_WITH_LIBPNG)
  389.      ## setup variables
  390.      set( SMP_DEFINITIONS  ${SMP_DEFINITIONS}  -DWITH_PNG ${LIBPNG_DEFINITIONS} )
  391. -    set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${LIBPNG_INCLUDE_DIRS} )
  392. -    set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${LIBPNG_LIBRARY_DIRS} )
  393. +    set( SMP_INCLUDE_DIRS ${SMP_INCLUDE_DIRS} ${LIBPNG_INCLUDE_DIR} )
  394. +    set( SMP_LIBRARY_DIRS ${SMP_LIBRARY_DIRS} ${LIBPNG_LIBRARY_DIR} )
  395.      set( SMP_LIBRARIES    ${SMP_LIBRARIES}    ${LIBPNG_LIBRARIES} )
  396.  endif()
  397. diff -r 0f1f3c598179 cmake/modules/FindSqlite.cmake
  398. --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
  399. +++ b/cmake/modules/FindSqlite.cmake    Tue Sep 06 12:59:16 2011 +0200
  400. @@ -0,0 +1,56 @@
  401. +# - find Sqlite 3
  402. +# SQLITE_INCLUDE_DIR - Where to find Sqlite 3 header files (directory)
  403. +# SQLITE_LIBRARIES - Sqlite 3 libraries
  404. +# SQLITE_LIBRARY_RELEASE - Where the release library is
  405. +# SQLITE_LIBRARY_DEBUG - Where the debug library is
  406. +# SQLITE_FOUND - Set to TRUE if we found everything (library, includes and executable)
  407. +
  408. +# Copyright (c) 2010 Pau Garcia i Quiles, <[email protected]>
  409. +#
  410. +# Redistribution and use is allowed according to the terms of the BSD license.
  411. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  412. +#
  413. +# Generated by CModuler, a CMake Module Generator - http://gitorious.org/cmoduler
  414. +
  415. +IF( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARY_RELEASE AND SQLITE_LIBRARY_DEBUG )
  416. +    SET(SQLITE_FIND_QUIETLY TRUE)
  417. +ENDIF( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARY_RELEASE AND SQLITE_LIBRARY_DEBUG )
  418. +
  419. +FIND_PATH( SQLITE_INCLUDE_DIR sqlite3.h  )
  420. +
  421. +FIND_LIBRARY(SQLITE_LIBRARY_RELEASE NAMES sqlite3 )
  422. +
  423. +FIND_LIBRARY(SQLITE_LIBRARY_DEBUG NAMES sqlite3 sqlite3d  HINTS /usr/lib/debug/usr/lib/ )
  424. +
  425. +IF( SQLITE_LIBRARY_RELEASE OR SQLITE_LIBRARY_DEBUG AND SQLITE_INCLUDE_DIR )
  426. +        SET( SQLITE_FOUND TRUE )
  427. +ENDIF( SQLITE_LIBRARY_RELEASE OR SQLITE_LIBRARY_DEBUG AND SQLITE_INCLUDE_DIR )
  428. +
  429. +IF( SQLITE_LIBRARY_DEBUG AND SQLITE_LIBRARY_RELEASE )
  430. +        # if the generator supports configuration types then set
  431. +        # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
  432. +        IF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
  433. +                SET( SQLITE_LIBRARIES optimized ${SQLITE_LIBRARY_RELEASE} debug ${SQLITE_LIBRARY_DEBUG} )
  434. +        ELSE( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
  435. +    # if there are no configuration types and CMAKE_BUILD_TYPE has no value
  436. +    # then just use the release libraries
  437. +                SET( SQLITE_LIBRARIES ${SQLITE_LIBRARY_RELEASE} )
  438. +        ENDIF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
  439. +ELSEIF( SQLITE_LIBRARY_RELEASE )
  440. +        SET( SQLITE_LIBRARIES ${SQLITE_LIBRARY_RELEASE} )
  441. +ELSE( SQLITE_LIBRARY_DEBUG AND SQLITE_LIBRARY_RELEASE )
  442. +        SET( SQLITE_LIBRARIES ${SQLITE_LIBRARY_DEBUG} )
  443. +ENDIF( SQLITE_LIBRARY_DEBUG AND SQLITE_LIBRARY_RELEASE )
  444. +
  445. +IF( SQLITE_FOUND )
  446. +        IF( NOT SQLITE_FIND_QUIETLY )
  447. +                MESSAGE( STATUS "Found Sqlite3 header file in ${SQLITE_INCLUDE_DIR}")
  448. +                MESSAGE( STATUS "Found Sqlite3 libraries: ${SQLITE_LIBRARIES}")
  449. +        ENDIF( NOT SQLITE_FIND_QUIETLY )
  450. +ELSE(SQLITE_FOUND)
  451. +        IF( SQLITE_FIND_REQUIRED)
  452. +                MESSAGE( FATAL_ERROR "Could not find Sqlite3" )
  453. +        ELSE( SQLITE_FIND_REQUIRED)
  454. +                MESSAGE( STATUS "Optional package Sqlite3 was not found" )
  455. +        ENDIF( SQLITE_FIND_REQUIRED)
  456. +ENDIF(SQLITE_FOUND)
  457. diff -r 0f1f3c598179 sgp/utils/sgp_exception.cpp
  458. --- a/sgp/utils/sgp_exception.cpp   Wed Aug 24 00:59:58 2011 +0200
  459. +++ b/sgp/utils/sgp_exception.cpp   Tue Sep 06 12:59:16 2011 +0200
  460. @@ -7,6 +7,8 @@
  461.  
  462.  
  463.  #include <sgp_exception.h>
  464. +#include <string>
  465. +#include <sstream>
  466.  
  467.  #if defined(WITH_VFS)
  468.  #  include <vfs/Core/vfs_string.h>
  469. @@ -121,7 +123,7 @@
  470.  const char* sgp::Exception::what() const throw()
  471.  {
  472.     // cannot return pointer local variable
  473. -   std::stringstream ss;
  474. +        std::stringstream ss;
  475.     ss.str("");
  476.     ss.clear();
  477.  
  478. diff -r 0f1f3c598179 sgp/utils/sgp_wstring.cpp
  479. --- a/sgp/utils/sgp_wstring.cpp Wed Aug 24 00:59:58 2011 +0200
  480. +++ b/sgp/utils/sgp_wstring.cpp Tue Sep 06 12:59:16 2011 +0200
  481. @@ -6,6 +6,7 @@
  482.   */
  483.  
  484.  #include <sgp_wstring.h>
  485. +#include <stdlib.h>
  486.  
  487.  #if defined(WITH_VFS)
  488.  #  include <vfs/Aspects/vfs_settings.h>
Advertisement
Add Comment
Please, Sign In to add comment