Changeset 2586 for code/branches/buildsystem2/cmake
- Timestamp:
- Jan 12, 2009, 2:34:05 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem2/cmake/FindOGRE.cmake
r2585 r2586 51 51 SET(CMAKE_FIND_LIBRARY_SUFFIXES .dll) 52 52 ENDIF(WIN32) 53 SET(CMAKE_FIND_LIBRARY_PREFIXES_STORED ${CMAKE_FIND_LIBRARY_PREFIXES}) 54 SET(CMAKE_FIND_LIBRARY_PREFIXES "") 55 53 56 SET(OGRE_RENDER_SYSTEM_FOUND FALSE) 54 57 FOREACH(_plugin ${OGRE_PLUGINS}) 55 58 FIND_LIBRARY(OGRE_PLUGIN_${_plugin}_OPTIMIZED 56 59 NAMES ${_plugin} 57 PATHS $ENV{OGRE_HOME} 60 PATHS $ENV{OGRE_HOME} /usr/local /usr 58 61 PATH_SUFFIXES lib lib/OGRE bin bin/Release bin/release Release release 59 62 ) … … 65 68 # We only need at least one render system. Check at the end 66 69 IF(NOT ${_plugin} MATCHES "RenderSystem") 67 SET(OGRE_PLUGIN_${_plugin}_FIND_REQUIRED TRUE) 68 ELSE(NOT ${_plugin} MATCHES "RenderSystem") 69 SET(OGRE_PLUGIN_${_plugin}_FIND_REQUIRED FALSE) 70 IF(NOT OGRE_PLUGIN_${_plugin}_OPTIMIZED) 71 MESSAGE(FATAL_ERROR "Could not find OGRE plugin named ${_plugin}") 72 ENDIF(NOT OGRE_PLUGIN_${_plugin}_OPTIMIZED) 73 ELSEIF(OGRE_PLUGIN_${_plugin}_OPTIMIZED) 70 74 SET(OGRE_RENDER_SYSTEM_FOUND TRUE) 71 75 ENDIF(NOT ${_plugin} MATCHES "RenderSystem") 72 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OGRE_PLUGIN_${_plugin}73 "Could not find OGRE plugin named ${_plugin}"74 OGRE_PLUGIN_${_plugin}_OPTIMIZED75 )76 76 77 # If debug version is not available, release will do as well 78 IF(NOT OGRE_PLUGIN_${_plugin}_DEBUG) 79 SET(OGRE_PLUGIN_${_plugin}_DEBUG ${OGRE_PLUGIN_${_plugin}_OPTIMIZED} CACHE STRING "") 80 ENDIF(NOT OGRE_PLUGIN_${_plugin}_DEBUG) 81 MARK_AS_ADVANCED(OGRE_PLUGIN_${_plugin}_OPTIMIZED OGRE_PLUGIN_${_plugin}_DEBUG) 77 IF(OGRE_PLUGIN_${_plugin}_OPTIMIZED) 78 # If debug version is not available, release will do as well 79 IF(NOT OGRE_PLUGIN_${_plugin}_DEBUG) 80 SET(OGRE_PLUGIN_${_plugin}_DEBUG ${OGRE_PLUGIN_${_plugin}_OPTIMIZED} CACHE STRING "") 81 ENDIF(NOT OGRE_PLUGIN_${_plugin}_DEBUG) 82 MARK_AS_ADVANCED(OGRE_PLUGIN_${_plugin}_OPTIMIZED OGRE_PLUGIN_${_plugin}_DEBUG) 82 83 83 ### Set variables to configure orxonox.ini correctly afterwards in bin/ ###84 # Check and set the folders85 GET_FILENAME_COMPONENT(_release_folder ${OGRE_PLUGIN_${_plugin}_OPTIMIZED} PATH)86 IF(OGRE_PLUGINS_FOLDER_RELEASE AND NOT OGRE_PLUGINS_FOLDER_RELEASE STREQUAL _release_folder)87 MESSAGE(FATAL_ERROR "Ogre release plugins have to be in the same folder!")88 ENDIF(OGRE_PLUGINS_FOLDER_RELEASE AND NOT OGRE_PLUGINS_FOLDER_RELEASE STREQUAL _release_folder)89 SET(OGRE_PLUGINS_FOLDER_RELEASE ${_release_folder})90 GET_FILENAME_COMPONENT(_debug_folder ${OGRE_PLUGIN_${_plugin}_DEBUG} PATH)91 IF(OGRE_PLUGINS_FOLDER_DEBUG AND NOT OGRE_PLUGINS_FOLDER_DEBUG STREQUAL _debug_folder)92 MESSAGE(FATAL_ERROR "Ogre debug plugins have to be in the same folder!")93 ENDIF(OGRE_PLUGINS_FOLDER_DEBUG AND NOT OGRE_PLUGINS_FOLDER_DEBUG STREQUAL _debug_folder)94 SET(OGRE_PLUGINS_FOLDER_DEBUG ${_debug_folder})84 ### Set variables to configure orxonox.ini correctly afterwards in bin/ ### 85 # Check and set the folders 86 GET_FILENAME_COMPONENT(_release_folder ${OGRE_PLUGIN_${_plugin}_OPTIMIZED} PATH) 87 IF(OGRE_PLUGINS_FOLDER_RELEASE AND NOT OGRE_PLUGINS_FOLDER_RELEASE STREQUAL _release_folder) 88 MESSAGE(FATAL_ERROR "Ogre release plugins have to be in the same folder!") 89 ENDIF(OGRE_PLUGINS_FOLDER_RELEASE AND NOT OGRE_PLUGINS_FOLDER_RELEASE STREQUAL _release_folder) 90 SET(OGRE_PLUGINS_FOLDER_RELEASE ${_release_folder}) 91 GET_FILENAME_COMPONENT(_debug_folder ${OGRE_PLUGIN_${_plugin}_DEBUG} PATH) 92 IF(OGRE_PLUGINS_FOLDER_DEBUG AND NOT OGRE_PLUGINS_FOLDER_DEBUG STREQUAL _debug_folder) 93 MESSAGE(FATAL_ERROR "Ogre debug plugins have to be in the same folder!") 94 ENDIF(OGRE_PLUGINS_FOLDER_DEBUG AND NOT OGRE_PLUGINS_FOLDER_DEBUG STREQUAL _debug_folder) 95 SET(OGRE_PLUGINS_FOLDER_DEBUG ${_debug_folder}) 95 96 96 # Create a list with the plugins for relase and debug configurations 97 LIST(APPEND OGRE_PLUGINS_RELEASE ${_plugin}) 98 IF(OGRE_PLUGIN_${_plugin}_DEBUG) 99 LIST(APPEND OGRE_PLUGINS_DEBUG ${_plugin}${LIBRARY_DEBUG_POSTFIX}) 100 ELSE(OGRE_PLUGIN_${_plugin}_DEBUG) 101 LIST(APPEND OGRE_PLUGINS_DEBUG ${_plugin}) 102 ENDIF(OGRE_PLUGIN_${_plugin}_DEBUG) 97 # Create a list with the plugins for relase and debug configurations 98 LIST(APPEND OGRE_PLUGINS_RELEASE ${_plugin}) 99 IF(OGRE_PLUGIN_${_plugin}_DEBUG) 100 LIST(APPEND OGRE_PLUGINS_DEBUG ${_plugin}${LIBRARY_DEBUG_POSTFIX}) 101 ELSE(OGRE_PLUGIN_${_plugin}_DEBUG) 102 LIST(APPEND OGRE_PLUGINS_DEBUG ${_plugin}) 103 ENDIF(OGRE_PLUGIN_${_plugin}_DEBUG) 104 ENDIF(OGRE_PLUGIN_${_plugin}_OPTIMIZED) 103 105 ENDFOREACH(_plugin) 104 106 IF(NOT OGRE_RENDER_SYSTEM_FOUND) … … 109 111 SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_STORED}) 110 112 ENDIF(WIN32) 113 SET(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES_STORED}) 111 114 112 115 # List has to be comma separated for orxonox.ini
Note: See TracChangeset
for help on using the changeset viewer.