blob: 58354b7167f8abb239b6869e581b3d0b5d2d9bbd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
function(_GetDebugOptimizedLib libraries)
set(debug_found 0)
set(optimized_found 0)
set(default ${libraries})
unset(_out_libraries)
foreach(path ${libraries})
if (${path} STREQUAL "debug")
set(debug_found 1)
elseif (${path} STREQUAL "optimized")
set(optimized_found 1)
elseif(debug_found)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(_out_libraries ${_out_libraries} ${path})
endif()
set(debug_found 0)
elseif(optimized_found)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(_out_libraries ${_out_libraries} ${path})
endif()
set(optimized_found 0)
endif()
endforeach()
if(_out_libraries STREQUAL "")
set(_out_libraries "${default}" PARENT_SCOPE)
else()
set(_out_libraries ${_out_libraries} PARENT_SCOPE)
message(STATUS "Choosing ${_out_libraries}")
endif()
endfunction()
if(NOT TARGET OpenThreads::OpenThreads)
add_library(OpenThreads::OpenThreads INTERFACE IMPORTED)
_GetDebugOptimizedLib("${OPENTHREADS_LIBRARY}")
set_target_properties(OpenThreads::OpenThreads PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPENTHREADS_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${_out_libraries}")
endif()
if(NOT TARGET OpenSceneGraph::Core)
add_library(OpenSceneGraph::Core INTERFACE IMPORTED)
_GetDebugOptimizedLib("${OPENSCENEGRAPH_LIBRARIES}")
set_target_properties(OpenSceneGraph::Core PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPENSCENEGRAPH_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${_out_libraries}")
endif()
if(NOT TARGET OpenSceneGraph::Viewer)
add_library(OpenSceneGraph::Viewer INTERFACE IMPORTED)
_GetDebugOptimizedLib("${OSGVIEWER_LIBRARY}")
set_target_properties(OpenSceneGraph::Viewer PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OSGVIEWER_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${_out_libraries}")
endif()
unset(_out_libraries)
target_link_libraries(OpenSceneGraph::Core INTERFACE OpenThreads::OpenThreads)
|