FindOGRE.cmake in v1-9
Posted: Mon Feb 03, 2014 3:44 am
In FindOGRE.cmake in 1-9 the piece of code that does the library finding is wrapped in this logic:
What is the purpose of that? It seems either broken or incomplete.
What I would like to be able to do is have CMake find a copy of Ogre that I have built but not installed. This is what I thought that the variables OGRE_BUILD and OGRE_SOURCE are for, at least that worked in 1.8. OGRE_SOURCE so it can find the headers and OGRE_BUILD so it can find the built libraries. If I remove the if clause (and add macosx to the search path) then it is able to find them.
Code: Select all
if (NOT OGRE_SOURCE) # If using ogre sources, use the target names instead of library files to link.
find_library(OGRE_LIBRARY_REL NAMES ${OGRE_LIBRARY_NAMES} HINTS ${OGRE_LIB_SEARCH_PATH} ${OGRE_PKGC_LIBRARY_DIRS} ${OGRE_FRAMEWORK_SEARCH_PATH} PATH_SUFFIXES "" "Release" "RelWithDebInfo" "MinSizeRel")
find_library(OGRE_LIBRARY_DBG NAMES ${OGRE_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIB_SEARCH_PATH} ${OGRE_PKGC_LIBRARY_DIRS} ${OGRE_FRAMEWORK_SEARCH_PATH} PATH_SUFFIXES "" "Debug")
else()
if( NOT OGRE_LIBRARIES OR OGRE_LIBRARIES STREQUAL "" )
message( FATAL_ERROR "When using Ogre from sources, please specify target names in OGRE_LIBRARIES!" )
else()
message( "Using Ogre source instead of binary libraries - skipping library files search." )
endif()
endif()
What I would like to be able to do is have CMake find a copy of Ogre that I have built but not installed. This is what I thought that the variables OGRE_BUILD and OGRE_SOURCE are for, at least that worked in 1.8. OGRE_SOURCE so it can find the headers and OGRE_BUILD so it can find the built libraries. If I remove the if clause (and add macosx to the search path) then it is able to find them.