Sim

FindSqlite.cmake

Sim
Sep 6th, 2011
926
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 2.66 KB | None | 0 0
  1. # - find Sqlite 3
  2. # SQLITE_INCLUDE_DIR - Where to find Sqlite 3 header files (directory)
  3. # SQLITE_LIBRARIES - Sqlite 3 libraries
  4. # SQLITE_LIBRARY_RELEASE - Where the release library is
  5. # SQLITE_LIBRARY_DEBUG - Where the debug library is
  6. # SQLITE_FOUND - Set to TRUE if we found everything (library, includes and executable)
  7.  
  8. # Copyright (c) 2010 Pau Garcia i Quiles, <[email protected]>
  9. #
  10. # Redistribution and use is allowed according to the terms of the BSD license.
  11. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  12. #
  13. # Generated by CModuler, a CMake Module Generator - http://gitorious.org/cmoduler
  14.  
  15. IF( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARY_RELEASE AND SQLITE_LIBRARY_DEBUG )
  16.     SET(SQLITE_FIND_QUIETLY TRUE)
  17. ENDIF( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARY_RELEASE AND SQLITE_LIBRARY_DEBUG )
  18.  
  19. FIND_PATH( SQLITE_INCLUDE_DIR sqlite3.h  )
  20.  
  21. FIND_LIBRARY(SQLITE_LIBRARY_RELEASE NAMES sqlite3 )
  22.  
  23. FIND_LIBRARY(SQLITE_LIBRARY_DEBUG NAMES sqlite3 sqlite3d  HINTS /usr/lib/debug/usr/lib/ )
  24.  
  25. IF( SQLITE_LIBRARY_RELEASE OR SQLITE_LIBRARY_DEBUG AND SQLITE_INCLUDE_DIR )
  26.         SET( SQLITE_FOUND TRUE )
  27. ENDIF( SQLITE_LIBRARY_RELEASE OR SQLITE_LIBRARY_DEBUG AND SQLITE_INCLUDE_DIR )
  28.  
  29. IF( SQLITE_LIBRARY_DEBUG AND SQLITE_LIBRARY_RELEASE )
  30.         # if the generator supports configuration types then set
  31.         # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
  32.         IF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
  33.                 SET( SQLITE_LIBRARIES optimized ${SQLITE_LIBRARY_RELEASE} debug ${SQLITE_LIBRARY_DEBUG} )
  34.         ELSE( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
  35.     # if there are no configuration types and CMAKE_BUILD_TYPE has no value
  36.     # then just use the release libraries
  37.                 SET( SQLITE_LIBRARIES ${SQLITE_LIBRARY_RELEASE} )
  38.         ENDIF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
  39. ELSEIF( SQLITE_LIBRARY_RELEASE )
  40.         SET( SQLITE_LIBRARIES ${SQLITE_LIBRARY_RELEASE} )
  41. ELSE( SQLITE_LIBRARY_DEBUG AND SQLITE_LIBRARY_RELEASE )
  42.         SET( SQLITE_LIBRARIES ${SQLITE_LIBRARY_DEBUG} )
  43. ENDIF( SQLITE_LIBRARY_DEBUG AND SQLITE_LIBRARY_RELEASE )
  44.  
  45. IF( SQLITE_FOUND )
  46.         IF( NOT SQLITE_FIND_QUIETLY )
  47.                 MESSAGE( STATUS "Found Sqlite3 header file in ${SQLITE_INCLUDE_DIR}")
  48.                 MESSAGE( STATUS "Found Sqlite3 libraries: ${SQLITE_LIBRARIES}")
  49.         ENDIF( NOT SQLITE_FIND_QUIETLY )
  50. ELSE(SQLITE_FOUND)
  51.         IF( SQLITE_FIND_REQUIRED)
  52.                 MESSAGE( FATAL_ERROR "Could not find Sqlite3" )
  53.         ELSE( SQLITE_FIND_REQUIRED)
  54.                 MESSAGE( STATUS "Optional package Sqlite3 was not found" )
  55.         ENDIF( SQLITE_FIND_REQUIRED)
  56. ENDIF(SQLITE_FOUND)
Advertisement
Add Comment
Please, Sign In to add comment