Commit 11de1492 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'FindOpenSceneGraph-debug'

192e5520

 FindOpenSceneGraph: Fix find in Debug
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !2341
parents 0aab5980 192e5520
...@@ -47,6 +47,8 @@ ...@@ -47,6 +47,8 @@
# standard install paths. # standard install paths.
# Explicit -DVAR=value arguments should still be able to override everything. # Explicit -DVAR=value arguments should still be able to override everything.
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
HINTS HINTS
ENV OPENTHREADS_INCLUDE_DIR ENV OPENTHREADS_INCLUDE_DIR
...@@ -62,7 +64,7 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread ...@@ -62,7 +64,7 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
) )
find_library(OPENTHREADS_LIBRARY find_library(OPENTHREADS_LIBRARY_RELEASE
NAMES OpenThreads OpenThreadsWin32 NAMES OpenThreads OpenThreadsWin32
HINTS HINTS
ENV OPENTHREADS_LIBRARY_DIR ENV OPENTHREADS_LIBRARY_DIR
...@@ -93,13 +95,7 @@ find_library(OPENTHREADS_LIBRARY_DEBUG ...@@ -93,13 +95,7 @@ find_library(OPENTHREADS_LIBRARY_DEBUG
PATH_SUFFIXES lib PATH_SUFFIXES lib
) )
if(OPENTHREADS_LIBRARY_DEBUG) select_library_configurations(OPENTHREADS)
set(OPENTHREADS_LIBRARIES
optimized ${OPENTHREADS_LIBRARY}
debug ${OPENTHREADS_LIBRARY_DEBUG})
else()
set(OPENTHREADS_LIBRARIES ${OPENTHREADS_LIBRARY})
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenThreads DEFAULT_MSG FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenThreads DEFAULT_MSG
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
# libraries and nodekits. Please see FindOpenSceneGraph.cmake for full # libraries and nodekits. Please see FindOpenSceneGraph.cmake for full
# documentation. # documentation.
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
# #
# OSG_FIND_PATH # OSG_FIND_PATH
# #
...@@ -39,7 +41,7 @@ endfunction() ...@@ -39,7 +41,7 @@ endfunction()
function(OSG_FIND_LIBRARY module library) function(OSG_FIND_LIBRARY module library)
string(TOUPPER ${module} module_uc) string(TOUPPER ${module} module_uc)
find_library(${module_uc}_LIBRARY find_library(${module_uc}_LIBRARY_RELEASE
NAMES ${library} NAMES ${library}
HINTS HINTS
ENV ${module_uc}_DIR ENV ${module_uc}_DIR
...@@ -63,18 +65,12 @@ function(OSG_FIND_LIBRARY module library) ...@@ -63,18 +65,12 @@ function(OSG_FIND_LIBRARY module library)
PATH_SUFFIXES lib PATH_SUFFIXES lib
) )
if(NOT ${module_uc}_LIBRARY_DEBUG) select_library_configurations(${module_uc})
# They don't have a debug library
set(${module_uc}_LIBRARY_DEBUG ${${module_uc}_LIBRARY} PARENT_SCOPE) # the variables set by select_library_configurations go out of scope
set(${module_uc}_LIBRARIES ${${module_uc}_LIBRARY} PARENT_SCOPE) # here, so we need to set them again
else() set(${module_uc}_LIBRARY ${${module_uc}_LIBRARY} PARENT_SCOPE)
# They really have a FOO_LIBRARY_DEBUG set(${module_uc}_LIBRARIES ${${module_uc}_LIBRARIES} PARENT_SCOPE)
set(${module_uc}_LIBRARIES
optimized ${${module_uc}_LIBRARY}
debug ${${module_uc}_LIBRARY_DEBUG}
PARENT_SCOPE
)
endif()
endfunction() endfunction()
# #
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment