-
Notifications
You must be signed in to change notification settings - Fork 4
/
Findsmall3d.cmake
97 lines (83 loc) · 2.39 KB
/
Findsmall3d.cmake
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
find_path(
small3d_INCLUDE_DIR
NAMES
small3d
PATHS
include)
find_library(
small3d_LIBRARY
NAMES
small3d
libsmall3d
PATHS
lib)
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(GLFW REQUIRED)
find_package(PNG REQUIRED)
find_package(GLM)
find_package(OGG REQUIRED)
find_package(VORBIS REQUIRED)
find_package(PORTAUDIO REQUIRED)
find_package(Freetype REQUIRED)
if(UNIX OR (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" AND NOT
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10))
find_package(BZip2 REQUIRED)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(small3d REQUIRED_VARS small3d_LIBRARY small3d_INCLUDE_DIR)
set(small3d_LIBRARIES
${small3d_LIBRARY}
${GLEW_LIBRARIES}
${OPENGL_LIBRARIES}
${GLFW_LIBRARIES}
${PNG_LIBRARIES}
${VORBIS_LIBRARIES}
${OGG_LIBRARIES}
${PORTAUDIO_LIBRARIES}
${FREETYPE_LIBRARIES}
)
set(small3d_INCLUDE_DIRS
${small3d_INCLUDE_DIR}
${GLFW_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIR}
${PNG_INCLUDE_DIRS}
${GLM_INCLUDE_DIRS}
${OGG_INCLUDE_DIRS}
${VORBIS_INCLUDE_DIR}
${PORTAUDIO_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS}
)
if(APPLE)
list(APPEND small3d_LIBRARIES "-framework \
AudioUnit -framework AudioToolbox -framework CoreAudio -framework Cocoa \
-framework IOKit -framework CoreVideo")
endif()
if(UNIX OR (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" AND NOT
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10))
set(small3d_INCLUDE_DIRS ${small3d_INCLUDE_DIRS} ${BZIP2_INCLUDE_DIRS})
set(small3d_LIBRARIES ${small3d_LIBRARIES} ${BZIP2_LIBRARIES})
endif()
if(WIN32)
set(small3d_LIBRARIES ${small3d_LIBRARIES} winmm)
endif()
if(UNIX AND NOT APPLE) # Linux
set(small3d_LIBRARIES ${small3d_LIBRARIES} m pthread rt asound X11 dl)
endif()
add_library(small3d::small3d UNKNOWN IMPORTED)
set_target_properties(small3d::small3d
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${small3d_INCLUDE_DIRS}")
set_property(TARGET small3d::small3d
APPEND
PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(small3d::small3d
PROPERTIES IMPORTED_LOCATION_RELEASE "${small3d_LIBRARY}")
set_property(TARGET small3d::small3d
APPEND
PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(small3d::small3d
PROPERTIES IMPORTED_LOCATION_DEBUG "${small3d_LIBRARY}")
set_property(TARGET small3d::small3d
PROPERTY INTERFACE_LINK_LIBRARIES
${small3d_LIBRARIES}
APPEND)