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.

FindThirdPartyCEGUI.cmake 3.4KB

3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # ---------------------------------
  2. # Finds CEGUI toolkit
  3. #
  4. # Sets CEGUI_FOUND
  5. # Sets CEGUI_LIBRARIES
  6. # Sets CEGUI_LIBRARY_DIRS
  7. # Sets CEGUI_LDFLAGS
  8. # Sets CEGUI_LDFLAGS_OTHERS
  9. # Sets CEGUI_INCLUDE_DIRS
  10. # Sets CEGUI_CFLAGS
  11. # Sets CEGUI_CFLAGS_OTHERS
  12. # ---------------------------------
  13. GET_PROPERTY(OV_PRINTED GLOBAL PROPERTY OV_TRIED_ThirdPartyCEGUI)
  14. IF(OV_DISABLE_OGRE)
  15. OV_PRINT(OV_PRINTED " SKIPPED Ogre3D/OIS (CEGUI), disabled, no 3D ...")
  16. RETURN()
  17. ENDIF(OV_DISABLE_OGRE)
  18. IF(WIN32)
  19. FIND_PATH(PATH_CEGUI cegui/include/CEGUI.h PATHS ${LIST_DEPENDENCIES_PATH} PATH_SUFFIXES cegui)
  20. IF(PATH_CEGUI)
  21. SET(CEGUI_FOUND TRUE)
  22. SET(OgreCEGUIRenderer_FOUND TRUE)
  23. SET(CEGUI_INCLUDE_DIRS ${PATH_CEGUI}/cegui/include)
  24. STRING(REGEX MATCH "vc120.*" MSVC_VER120 ${MSVC_SERVICE_PACK})
  25. IF(MSVC_VER120)
  26. SET(CEGUI_LIBRARIES_DEBUG CEGUIBase-0_d CEGUIOgreRenderer-0_d)
  27. SET(CEGUI_LIBRARIES_RELEASE CEGUIBase-0 CEGUIOgreRenderer-0)
  28. ELSE(MSVC_VER120)
  29. SET(CEGUI_LIBRARIES_DEBUG CEGUIBase_d CEGUIOgreRenderer_d)
  30. SET(CEGUI_LIBRARIES_RELEASE CEGUIBase CEGUIOgreRenderer)
  31. ENDIF(MSVC_VER120)
  32. SET(CEGUI_LIBRARY_DIRS ${PATH_CEGUI}/lib)
  33. ENDIF(PATH_CEGUI)
  34. ENDIF(WIN32)
  35. IF(UNIX)
  36. # Assumes FindThirdPartyCEGUI_Check.cmake has been run
  37. ENDIF(UNIX)
  38. IF(CEGUI_FOUND AND OgreCEGUIRenderer_FOUND)
  39. OV_PRINT(OV_PRINTED " Found CEGUI/OgreCEGUIRenderer...")
  40. INCLUDE_DIRECTORIES(${CEGUI_INCLUDE_DIRS} ${OgreCEGUIRenderer_INCLUDE_DIRS})
  41. ADD_DEFINITIONS(${CEGUI_CFLAGS} ${OgreCEGUIRenderer_CFLAGS})
  42. ADD_DEFINITIONS(${CEGUI_CFLAGS_OTHERS} ${OgreCEGUIRenderer_CFLAGS_OTHERS})
  43. # LINK_DIRECTORIES(${CEGUI_LIBRARY_DIRS} ${OgreCEGUIRenderer_LIBRARY_DIRS})
  44. IF(UNIX)
  45. FOREACH(CEGUI_LIB ${CEGUI_LIBRARIES} ${OgreCEGUIRenderer_LIBRARIES})
  46. SET(CEGUI_LIB1 "CEGUI_LIB1-NOTFOUND")
  47. FIND_LIBRARY(CEGUI_LIB1 NAMES ${CEGUI_LIB} PATHS ${CEGUI_LIBRARY_DIRS} ${CEGUI_LIBDIR} NO_DEFAULT_PATH)
  48. FIND_LIBRARY(CEGUI_LIB1 NAMES ${CEGUI_LIB})
  49. IF(CEGUI_LIB1)
  50. OV_PRINT(OV_PRINTED " [ OK ] Third party lib ${CEGUI_LIB1}")
  51. TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${CEGUI_LIB1})
  52. ELSE(CEGUI_LIB1)
  53. OV_PRINT(OV_PRINTED " [FAILED] Third party lib ${CEGUI_LIB}")
  54. ENDIF(CEGUI_LIB1)
  55. ENDFOREACH(CEGUI_LIB)
  56. ENDIF(UNIX)
  57. IF(WIN32)
  58. FOREACH(CEGUI_LIB ${CEGUI_LIBRARIES_DEBUG})
  59. SET(CEGUI_LIB1 "CEGUI_LIB1-NOTFOUND")
  60. FIND_LIBRARY(CEGUI_LIB1 NAMES ${CEGUI_LIB} PATHS ${CEGUI_LIBRARY_DIRS} ${CEGUI_LIBDIR} NO_DEFAULT_PATH)
  61. FIND_LIBRARY(CEGUI_LIB1 NAMES ${CEGUI_LIB})
  62. IF(CEGUI_LIB1)
  63. OV_PRINT(OV_PRINTED " [ OK ] Third party lib ${CEGUI_LIB1}")
  64. TARGET_LINK_LIBRARIES(${PROJECT_NAME} debug ${CEGUI_LIB1})
  65. ELSE(CEGUI_LIB1)
  66. OV_PRINT(OV_PRINTED " [FAILED] Third party lib ${CEGUI_LIB}")
  67. ENDIF(CEGUI_LIB1)
  68. ENDFOREACH(CEGUI_LIB)
  69. FOREACH(CEGUI_LIB ${CEGUI_LIBRARIES_RELEASE})
  70. SET(CEGUI_LIB1 "CEGUI_LIB1-NOTFOUND")
  71. FIND_LIBRARY(CEGUI_LIB1 NAMES ${CEGUI_LIB} PATHS ${CEGUI_LIBRARY_DIRS} ${CEGUI_LIBDIR} NO_DEFAULT_PATH)
  72. FIND_LIBRARY(CEGUI_LIB1 NAMES ${CEGUI_LIB})
  73. IF(CEGUI_LIB1)
  74. OV_PRINT(OV_PRINTED " [ OK ] Third party lib ${CEGUI_LIB1}")
  75. TARGET_LINK_LIBRARIES(${PROJECT_NAME} optimized ${CEGUI_LIB1})
  76. ELSE(CEGUI_LIB1)
  77. OV_PRINT(OV_PRINTED " [FAILED] Third party lib ${CEGUI_LIB}")
  78. ENDIF(CEGUI_LIB1)
  79. ENDFOREACH(CEGUI_LIB)
  80. ENDIF(WIN32)
  81. ELSE(CEGUI_FOUND AND OgreCEGUIRenderer_FOUND)
  82. OV_PRINT(OV_PRINTED " FAILED to find CEGUI/OgreCEGUIRenderer...")
  83. ENDIF(CEGUI_FOUND AND OgreCEGUIRenderer_FOUND)
  84. SET_PROPERTY(GLOBAL PROPERTY OV_TRIED_ThirdPartyCEGUI "Yes")