Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
c536d703
O
obs-studio
项目概览
尘离序散
/
obs-studio
与 Fork 源项目一致
从无法访问的项目Fork
通知
30
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
obs-studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c536d703
编写于
12月 30, 2013
作者:
P
Palana
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add support for static system GLEW to cmake
上级
22c617dd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
83 addition
and
6 deletion
+83
-6
cmake/FindGLEW.cmake
cmake/FindGLEW.cmake
+63
-0
libobs-opengl/CMakeLists.txt
libobs-opengl/CMakeLists.txt
+20
-6
未找到文件。
cmake/FindGLEW.cmake
0 → 100644
浏览文件 @
c536d703
find_package
(
PkgConfig
)
pkg_check_modules
(
PC_GLEW QUIET glew
)
set
(
GLEW_STANDARD_DEFINITIONS
${
PC_GLEW_DEFINITIONS
}
CACHE STRING
"GLEW required CFLAGS"
)
set
(
GLEW_STATIC_DEFINITIONS
${
PC_GLEW_STATIC_DEFINITIONS
}
CACHE STRING
"GLEW static required CFLAGS"
)
find_path
(
GLEW_STANDARD_INCLUDE_DIR GL/glew.h
HINTS
${
PC_GLEW_INCLUDEDIR
}
${
PC_GLEW_INCLUDE_DIRS
}
)
find_path
(
GLEW_STATIC_INCLUDE_DIR GL/glew.h
HINTS
${
PC_GLEW_STATIC_INCLUDEDIR
}
${
PC_GLEW_STATIC_INCLUDE_DIRS
}
)
find_library
(
GLEW_STANDARD_LIBRARY
NAMES
${
PC_GLEW_LIBRARIES
}
GLEW glew32 glew glew32s
HINTS
${
PC_GLEW_LIBDIR
}
${
PC_GLEW_LIBRARY_DIRS
}
PATH_SUFFIXES lib64
)
set
(
lib_suffixes
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
${
CMAKE_STATIC_LIBRARY_SUFFIX
}
${
CMAKE_DYNAMIC_LIBRARY_SUFFIX
}
${
CMAKE_SHARED_OBJECT_SUFFIX
}
)
find_library
(
GLEW_STATIC_LIBRARY
NAMES
${
PC_GLEW_STATIC_LIBRARIES
}
GLEW glew32 glew glew32s
HINTS
${
PC_GLEW_STATIC_LIBDIR
}
${
PC_GLEW_STATIC_LIBRARY_DIRS
}
PATH_SUFFIXES lib64
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
${
lib_suffixes
}
)
unset
(
lib_suffixes
)
if
(
GLEW_FIND_COMPONENTS AND
GLEW_FIND_COMPONENTS STREQUAL
"static"
)
set
(
GLEW_DEFINITION
${
GLEW_STATIC_DEFINITIONS
}
)
set
(
GLEW_INCLUDE_DIR
${
GLEW_STATIC_INCLUDE_DIR
}
)
set
(
GLEW_LIBRARY
${
GLEW_STATIC_LIBRARY
}
)
else
()
set
(
GLEW_DEFINITION
${
GLEW_STANDARD_DEFINITIONS
}
)
set
(
GLEW_INCLUDE_DIR
${
GLEW_STANDARD_INCLUDE_DIR
}
)
set
(
GLEW_LIBRARY
${
GLEW_STANDARD_LIBRARY
}
)
endif
()
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
GLEW STANDARD_MESSAGE
GLEW_INCLUDE_DIR GLEW_LIBRARY
)
if
(
GLEW_FOUND
)
set
(
GLEW_DEFINITIONS
${
GLEW_DEFINITION
}
)
set
(
GLEW_INCLUDE_DIRS
${
GLEW_INCLUDE_DIR
}
)
set
(
GLEW_LIBRARIES
${
GLEW_LIBRARY
}
)
endif
()
mark_as_advanced
(
GLEW_STANDARD_DEFINITIONS
GLEW_STANDARD_INCLUDE_DIR
GLEW_STANDARD_LIBRARY
GLEW_STATIC_DEFINITIONS
GLEW_STATIC_INCLUDE_DIR
GLEW_STATIC_LIBRARY
)
libobs-opengl/CMakeLists.txt
浏览文件 @
c536d703
...
...
@@ -17,7 +17,10 @@ elseif(APPLE AND UNIX)
else
()
endif
()
option
(
USE_STATIC_GLEW
"Build using bundled GLEW"
${
WIN32
}
)
option
(
USE_BUNDLED_GLEW
"Build using bundled GLEW"
${
WIN32
}
)
option
(
USE_STATIC_GLEW
"Link GLEW statically (ignored with USE_BUNDLED_GLEW)"
false
)
include_directories
(
SYSTEM
${
obs_SOURCE_DIR
}
/libobs
)
...
...
@@ -26,14 +29,25 @@ include_directories(${OPENGL_INCLUDE_DIRS})
add_definitions
(
-DGLEW_NO_GLU
)
if
(
NOT USE_STATIC_GLEW
)
find_package
(
GLEW REQUIRED
)
include_directories
(
${
GLEW_INCLUDE_DIRS
}
)
set
(
GLEW_SRC
)
else
()
if
(
USE_BUNDLED_GLEW
)
include_directories
(
SYSTEM glew/include
)
add_definitions
(
-DGLEW_STATIC
)
set
(
GLEW_SRC glew/src/glew.c
)
else
()
if
(
USE_STATIC_GLEW
)
set
(
lib_prefixes
${
CMAKE_FIND_LIBRARY_PREFIXES
}
)
set
(
CMAKE_FIND_LIBRARY_PREFIXES
${
CMAKE_STATIC_LIBRARY_PREFIX
}
${
CMAKE_DYNAMIC_LIBRARY_PREFIX
}
${
CMAKE_SHARED_OBJECT_PREFIX
}
)
set
(
glew_static
"static"
)
endif
()
find_package
(
GLEW REQUIRED
${
glew_static
}
)
include_directories
(
${
GLEW_INCLUDE_DIRS
}
)
if
(
USE_STATIC_GLEW
)
unset
(
glew_static
)
set
(
CMAKE_FIND_LIBRARY_PREFIXES
${
lib_prefixes
}
)
unset
(
lib_prefixes
)
endif
()
endif
()
add_library
(
libobs-opengl MODULE
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录