forked from gwaldron/osgearth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathosgEarthConfig.cmake.in
80 lines (60 loc) · 2.31 KB
/
osgEarthConfig.cmake.in
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
set(OSGEARTH_VERSION @OSGEARTH_VERSION@)
@PACKAGE_INIT@
set(XPREFIX OSGEARTH)
if (osgEarth_USE_STATIC_LIBS)
set(XPREFIX ${XPREFIX}_STATIC)
endif()
set(osgEarth_DEFINITIONS ${${XPREFIX}_CFLAGS})
find_path(osgEarth_INCLUDE_DIR
NAMES osgEarth/rtree.h
HINTS ${${XPREFIX}_INCLUDE_DIRS}
)
set(PACKAGE_LIBS "")
find_library(osgEarth_LIBRARY
NAMES osgEarth
HINTS ${${XPREFIX}_LIBRARY_DIRS}
)
find_library(osgEarth_LIBRARY_DEBUG
NAMES osgEarthd
HINTS ${${XPREFIX}_LIBRARY_DIRS}
)
set(osgEarth_LIBRARIES ${osgEarth_LIBRARY})
set(osgEarth_LIBRARIES_DEBUG ${osgEarth_LIBRARY_DEBUG})
set(osgEarth_LIBRARY_DIRS ${${XPREFIX}_LIBRARY_DIRS})
set(osgEarth_LIBRARY_DIR ${osgEarth_LIBRARY_DIRS})
set(osgEarth_INCLUDE_DIRS ${osgEarth_INCLUDE_DIR})
set(osgEarth_LDFLAGS ${${XPREFIX}_LDFLAGS})
include(FindPackageHandleStandardArgs)
if(${osgEarth_LIBRARY})
list(APPEND PACKAGE_LIBS ${osgEarth_LIBRARY})
endif()
if({$osgEarth_LIBRARY_DEBUG})
list(APPEND PACKAGE_LIBS ${osgEarth_LIBRARY_DEBUG})
endif()
find_package_handle_standard_args(osgEarth DEFAULT_MSG
${PACKAGE_LIBS}
osgEarth_INCLUDE_DIR
)
if (osgEarth_FOUND)
string (REPLACE ";" " " osgEarth_LDFLAGS "${osgEarth_LDFLAGS}")
# import the osgEarth library
add_library(osgEarth UNKNOWN IMPORTED)
set_target_properties(osgEarth
PROPERTIES
IMPORTED_LOCATION "${osgEarth_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${osgEarth_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${osgEarth_LDFLAGS}"
INTERFACE_COMPILE_OPTIONS "${osgEarth_DEFINITIONS}")
# include OSG as a public-facing dependency:
include(CMakeFindDependencyMacro)
find_dependency(OpenSceneGraph REQUIRED COMPONENTS osg osgDB osgGA osgUtil osgViewer OpenThreads)
include_directories(${OPENSCENEGRAPH_INCLUDE_DIR})
target_link_libraries(osgEarth INTERFACE ${OPENSCENEGRAPH_LIBRARIES})
endif()
message(STATUS "osgEarth_FOUND: ${osgEarth_FOUND}")
message(STATUS "osgEarth_INCLUDE_DIRS: ${osgEarth_INCLUDE_DIRS}")
message(STATUS "osgEarth_LIBRARIES: ${osgEarth_LIBRARIES}")
message(STATUS "osgEarth_LIBRARIES_DEBUG: ${osgEarth_LIBRARIES_DEBUG}")
message(STATUS "osgEarth_LDFLAGS: ${osgEarth_LDFLAGS}")
message(STATUS "osgEarth_DEFINITIONS: ${osgEarth_DEFINITIONS}")
check_required_components(osgEarth)