A C++ DAL / ORM code generation framework
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.7 KiB

  1. # This module defines:
  2. # - CTEMPLATE_INCLUDE_DIR - Where to find Ctemplate header files (directory)
  3. # - CTEMPLATE_LIBRARIES - CTemplate libraries
  4. # - CTEMPLATE_LIBRARY_RELEASE - Where the release library is
  5. # - CTEMPLATE_LIBRARY_DEBUG - Where the debug library is
  6. # - CTEMPLATE_FOUND - Set to TRUE if we found everything
  7. # (library, includes and executable)
  8. # Taking into account:
  9. # - CTEMPLATE_PREFIX
  10. #
  11. # Note: this only looks for the nothreads version for linking - alter to suit below..
  12. IF( CTEMPLATE_INCLUDE_DIR AND CTEMPLATE_LIBRARY_RELEASE AND CTEMPLATE_LIBRARY_DEBUG )
  13. SET(CTEMPLATE_FIND_QUIETLY TRUE)
  14. ENDIF( CTEMPLATE_INCLUDE_DIR AND CTEMPLATE_LIBRARY_RELEASE AND CTEMPLATE_LIBRARY_DEBUG )
  15. FIND_PATH(CTEMPLATE_INCLUDE_DIR
  16. template.h
  17. PATHS
  18. ${CTEMPLATE_PREFIX}/include
  19. /usr/include/ctemplate
  20. /usr/local/include/ctemplate
  21. )
  22. FIND_LIBRARY(CTEMPLATE_LIBRARY_RELEASE
  23. NAMES
  24. ctemplate_nothreads
  25. PATHS
  26. ${CTEMPLATE_PREFIX}/lib
  27. /usr/lib
  28. /usr/local/lib
  29. )
  30. FIND_LIBRARY(CTEMPLATE_LIBRARY_DEBUG
  31. NAMES
  32. ctemplate_nothreads
  33. )
  34. IF( CTEMPLATE_LIBRARY_RELEASE OR CTEMPLATE_LIBRARY_DEBUG AND CTEMPLATE_INCLUDE_DIR )
  35. SET( CTEMPLATE_FOUND TRUE )
  36. ENDIF( CTEMPLATE_LIBRARY_RELEASE OR CTEMPLATE_LIBRARY_DEBUG AND CTEMPLATE_INCLUDE_DIR )
  37. IF( CTEMPLATE_LIBRARY_DEBUG AND CTEMPLATE_LIBRARY_RELEASE )
  38. # if the generator supports configuration types then set
  39. # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
  40. IF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
  41. SET( CTEMPLATE_LIBRARIES optimized ${CTEMPLATE_LIBRARY_RELEASE} debug ${CTEMPLATE_LIBRARY_DEBUG} )
  42. ELSE( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
  43. # if there are no configuration types and CMAKE_BUILD_TYPE has no value
  44. # then just use the release libraries
  45. SET( CTEMPLATE_LIBRARIES ${CTEMPLATE_LIBRARY_RELEASE} )
  46. ENDIF( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
  47. ELSEIF( CTEMPLATE_LIBRARY_RELEASE )
  48. SET( CTEMPLATE_LIBRARIES ${CTEMPLATE_LIBRARY_RELEASE} )
  49. ELSE( CTEMPLATE_LIBRARY_DEBUG AND CTEMPLATE_LIBRARY_RELEASE )
  50. SET( CTEMPLATE_LIBRARIES ${CTEMPLATE_LIBRARY_DEBUG} )
  51. ENDIF( CTEMPLATE_LIBRARY_DEBUG AND CTEMPLATE_LIBRARY_RELEASE )
  52. IF( CTEMPLATE_FOUND )
  53. IF( NOT CTEMPLATE_FIND_QUIETLY )
  54. MESSAGE( STATUS "Found ctemplate header file in ${CTEMPLATE_INCLUDE_DIR}")
  55. MESSAGE( STATUS "Found ctemplate libraries: ${CTEMPLATE_LIBRARIES}")
  56. ENDIF( NOT CTEMPLATE_FIND_QUIETLY )
  57. ELSE(CTEMPLATE_FOUND)
  58. IF( CTEMPLATE_FIND_REQUIRED)
  59. MESSAGE( FATAL_ERROR "Could not find ctemplate" )
  60. ELSE( CTEMPLATE_FIND_REQUIRED)
  61. MESSAGE( STATUS "Optional package ctemplate was not found" )
  62. ENDIF( CTEMPLATE_FIND_REQUIRED)
  63. ENDIF(CTEMPLATE_FOUND)