From 1f76f375312f8c015f74e7de7603e841bbe161c7 Mon Sep 17 00:00:00 2001 From: k1ll Date: Mon, 19 Mar 2012 14:25:33 +0100 Subject: [PATCH 1/2] Adds search for plugins in OGRE dirs with version suffix and a workaround for a strange problem with set to FindOgre.cmake. --- cmake/FindOGRE.cmake | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cmake/FindOGRE.cmake b/cmake/FindOGRE.cmake index 78d0ef24e2..5e6453eea1 100644 --- a/cmake/FindOGRE.cmake +++ b/cmake/FindOGRE.cmake @@ -405,8 +405,16 @@ macro(ogre_find_plugin PLUGIN HEADER) set(OGRE_${PLUGIN}_LIBRARY_NAMES "${PLUGIN}${OGRE_LIB_SUFFIX}") get_debug_names(OGRE_${PLUGIN}_LIBRARY_NAMES) set(OGRE_${PLUGIN}_LIBRARY_FWK ${OGRE_LIBRARY_FWK}) + # Search for release plugins in OGRE dir with version suffix + find_library(OGRE_${PLUGIN}_LIBRARY_REL NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES} + HINTS ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE-${OGRE_VERSION} opt release release/opt relwithdebinfo relwithdebinfo/opt minsizerel minsizerel/opt) + # Search for release plugins in OGRE dir without version suffix find_library(OGRE_${PLUGIN}_LIBRARY_REL NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE opt release release/opt relwithdebinfo relwithdebinfo/opt minsizerel minsizerel/opt) + # Search for debug plugins in OGRE dir with version suffix + find_library(OGRE_${PLUGIN}_LIBRARY_DBG NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES_DBG} + HINTS ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE-${OGRE_VERSION} opt debug debug/opt) + # Search for debug plugins in OGRE dir without version suffix find_library(OGRE_${PLUGIN}_LIBRARY_DBG NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE opt debug debug/opt) make_library_set(OGRE_${PLUGIN}_LIBRARY) @@ -441,9 +449,13 @@ macro(ogre_find_plugin PLUGIN HEADER) PATH_SUFFIXES "" bin bin/debug debug) elseif (UNIX) get_filename_component(OGRE_PLUGIN_DIR_TMP ${OGRE_${PLUGIN}_LIBRARY_REL} PATH) - set(OGRE_PLUGIN_DIR_REL ${OGRE_PLUGIN_DIR_TMP} CACHE STRING "Ogre plugin dir (release)") + # For some reason this fails + #set(OGRE_PLUGIN_DIR_REL ${OGRE_PLUGIN_DIR_TMP} CACHE STRING "Ogre plugin dir (release)") + set(OGRE_PLUGIN_DIR_REL ${OGRE_PLUGIN_DIR_TMP}) get_filename_component(OGRE_PLUGIN_DIR_TMP ${OGRE_${PLUGIN}_LIBRARY_DBG} PATH) - set(OGRE_PLUGIN_DIR_DBG ${OGRE_PLUGIN_DIR_TMP} CACHE STRING "Ogre plugin dir (debug)") + # Same here + #set(OGRE_PLUGIN_DIR_DBG ${OGRE_PLUGIN_DIR_TMP} CACHE STRING "Ogre plugin dir (debug)") + set(OGRE_PLUGIN_DIR_DBG ${OGRE_PLUGIN_DIR_TMP}) endif () endif () From 5abaf1fee24d68830f3f57f1182f09acd07882d5 Mon Sep 17 00:00:00 2001 From: k1ll Date: Mon, 19 Mar 2012 15:04:55 +0100 Subject: [PATCH 2/2] Check if searching OGRE dir with version suffix failed. I'm not sure if this is the right way to do it though. --- cmake/FindOGRE.cmake | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cmake/FindOGRE.cmake b/cmake/FindOGRE.cmake index 5e6453eea1..fb4a090c6e 100644 --- a/cmake/FindOGRE.cmake +++ b/cmake/FindOGRE.cmake @@ -408,15 +408,19 @@ macro(ogre_find_plugin PLUGIN HEADER) # Search for release plugins in OGRE dir with version suffix find_library(OGRE_${PLUGIN}_LIBRARY_REL NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE-${OGRE_VERSION} opt release release/opt relwithdebinfo relwithdebinfo/opt minsizerel minsizerel/opt) - # Search for release plugins in OGRE dir without version suffix - find_library(OGRE_${PLUGIN}_LIBRARY_REL NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES} - HINTS ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE opt release release/opt relwithdebinfo relwithdebinfo/opt minsizerel minsizerel/opt) + if(NOT EXISTS "${OGRE_${PLUGIN}_LIBRARY_REL}") + # Search for release plugins in OGRE dir without version suffix + find_library(OGRE_${PLUGIN}_LIBRARY_REL NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES} + HINTS ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE opt release release/opt relwithdebinfo relwithdebinfo/opt minsizerel minsizerel/opt) + endif() # Search for debug plugins in OGRE dir with version suffix find_library(OGRE_${PLUGIN}_LIBRARY_DBG NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE-${OGRE_VERSION} opt debug debug/opt) - # Search for debug plugins in OGRE dir without version suffix - find_library(OGRE_${PLUGIN}_LIBRARY_DBG NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES_DBG} - HINTS ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE opt debug debug/opt) + if(NOT EXISTS "${OGRE_${PLUGIN}_LIBRARY_DBG}") + # Search for debug plugins in OGRE dir without version suffix + find_library(OGRE_${PLUGIN}_LIBRARY_DBG NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES_DBG} + HINTS ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE opt debug debug/opt) + endif() make_library_set(OGRE_${PLUGIN}_LIBRARY) if (OGRE_${PLUGIN}_LIBRARY OR OGRE_${PLUGIN}_INCLUDE_DIR)