Skip to content

Commit 8d34a70

Browse files
committed
Manage find scripts
1 parent 1f120e0 commit 8d34a70

File tree

7 files changed

+115
-177
lines changed

7 files changed

+115
-177
lines changed

cmake/FindEGL.cmake

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
# EGL::EGL
3+
# EGL_FOUND
4+
# EGL_INCLUDE_DIR
5+
# EGL_LIBRARY
6+
7+
include(FindPackageHandleStandardArgs)
8+
9+
find_path(EGL_INCLUDE_DIR EGL/egl.h
10+
11+
PATHS
12+
$ENV{EGL_DIR}
13+
/usr
14+
/usr/local
15+
/sw
16+
/opt/local
17+
18+
PATH_SUFFIXES
19+
/include
20+
21+
DOC "The directory where EGL/egl.h resides")
22+
23+
find_library(EGL_LIBRARY NAMES EGL
24+
25+
PATHS
26+
$ENV{EGL_DIR}
27+
/usr
28+
/usr/local
29+
/sw
30+
/opt/local
31+
32+
# authors prefered choice for development
33+
34+
PATH_SUFFIXES
35+
/lib
36+
/lib64
37+
/lib/x86_64-linux-gnu
38+
39+
DOC "The EGL library")
40+
41+
add_library(EGL::EGL SHARED IMPORTED)
42+
43+
set_target_properties(EGL::EGL PROPERTIES
44+
INTERFACE_INCLUDE_DIRECTORIES "${EGL_INCLUDE_DIR}"
45+
INTERFACE_LINK_LIBRARIES "${EGL_LIBRARY}"
46+
)
47+
48+
set_property(TARGET EGL::EGL APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
49+
set_target_properties(EGL::EGL PROPERTIES
50+
IMPORTED_LOCATION_RELEASE "${EGL_LIBRARY}"
51+
)
52+
53+
find_package_handle_standard_args(EGL REQUIRED_VARS EGL_INCLUDE_DIR EGL_LIBRARY)
54+
mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY)
55+

cmake/FindFFMPEG.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
# BSD license.
1919
#
2020

21+
include(FindPackageHandleStandardArgs)
22+
2123
if (FFMPEG_LIBRARIES AND FFMPEG_INCLUDE_DIR)
2224
# in cache already
2325
set(FFMPEG_FOUND TRUE)

cmake/FindGLESv2.cmake

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
# GLESv2::GLESv2
3+
# GLESv2_FOUND
4+
# GLESv2_INCLUDE_DIR
5+
# GLESv2_LIBRARY
6+
7+
include(FindPackageHandleStandardArgs)
8+
9+
find_path(GLESv2_INCLUDE_DIR GLES2/gl2.h
10+
11+
PATHS
12+
$ENV{GLESv2_DIR}
13+
/usr
14+
/usr/local
15+
/sw
16+
/opt/local
17+
18+
PATH_SUFFIXES
19+
/include
20+
21+
DOC "The directory where GLESv2/GLESv2.h resides")
22+
23+
find_library(GLESv2_LIBRARY NAMES GLESv2
24+
25+
PATHS
26+
$ENV{GLESv2_DIR}
27+
/usr
28+
/usr/local
29+
/sw
30+
/opt/local
31+
32+
# authors prefered choice for development
33+
34+
PATH_SUFFIXES
35+
/lib
36+
/lib64
37+
/lib/x86_64-linux-gnu
38+
39+
DOC "The GLESv2 library")
40+
41+
add_library(GLESv2::GLESv2 SHARED IMPORTED)
42+
43+
set_target_properties(GLESv2::GLESv2 PROPERTIES
44+
INTERFACE_INCLUDE_DIRECTORIES "${GLESv2_INCLUDE_DIR}"
45+
INTERFACE_LINK_LIBRARIES "${GLESv2_LIBRARY}"
46+
)
47+
48+
set_property(TARGET GLESv2::GLESv2 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
49+
set_target_properties(GLESv2::GLESv2 PROPERTIES
50+
IMPORTED_LOCATION_RELEASE "${GLESv2_LIBRARY}"
51+
)
52+
53+
find_package_handle_standard_args(GLESv2 REQUIRED_VARS GLESv2_INCLUDE_DIR GLESv2_LIBRARY)
54+
mark_as_advanced(GLESv2_INCLUDE_DIR GLESv2_LIBRARY)
55+

cmake/FindGLEW.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# GLEW_BINARY (win32 only)
77

8+
include(FindPackageHandleStandardArgs)
89

910
find_path(GLEW_INCLUDE_DIR GL/glew.h
1011

cmake/FindGLFW.cmake

Lines changed: 0 additions & 153 deletions
This file was deleted.

cmake/FindGLM.cmake

Lines changed: 0 additions & 23 deletions
This file was deleted.

cmake/FindHIDAPI.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# HIDAPI_INCLUDE_DIRS
44
# HIDAPI_LIBRARIES
55

6+
include(FindPackageHandleStandardArgs)
7+
68
find_path(HIDAPI_INCLUDE_DIRS
79
NAMES hidapi/hidapi.h
810
/usr/include
@@ -25,7 +27,6 @@ find_library(HIDAPI_LIBRARIES
2527
DOC "The hidapi library")
2628

2729

28-
include(FindPackageHandleStandardArgs)
2930
find_package_handle_standard_args(HIDAPI REQUIRED_VARS HIDAPI_LIBRARIES HIDAPI_INCLUDE_DIRS)
3031

3132
mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY)

0 commit comments

Comments
 (0)