Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
af08b58d
Unverified
Commit
af08b58d
authored
Feb 17, 2022
by
mtdxc
Committed by
GitHub
Feb 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmake项目分组 (#1431)
重要项目(toolkit和mediakit)增加目录显示
parent
304c898a
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
43 行增加
和
0 行删除
+43
-0
CMakeLists.txt
+36
-0
api/tests/CMakeLists.txt
+3
-0
tests/CMakeLists.txt
+4
-0
没有找到文件。
CMakeLists.txt
查看文件 @
af08b58d
...
...
@@ -80,6 +80,37 @@ option(ENABLE_WEBRTC "Enable WebRTC" true)
option
(
ENABLE_PLAYER
"Enable Player"
true
)
option
(
ENABLE_MSVC_MT
"Enable MSVC Mt/Mtd lib"
true
)
option
(
ENABLE_API_STATIC_LIB
"Enable mk_api static lib"
false
)
option
(
USE_SOLUTION_FOLDERS
"Enable solution dir supported"
ON
)
# ----------------------------------------------------------------------------
# Solution folders:
# ----------------------------------------------------------------------------
if
(
USE_SOLUTION_FOLDERS
)
set_property
(
GLOBAL PROPERTY USE_FOLDERS ON
)
set_property
(
GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER
"CMakeTargets"
)
endif
()
function
(
set_file_group prefix
)
message
(
STATUS
"set_file_group "
${
prefix
}
" "
${
ARGC
}
)
foreach
(
FILE IN LISTS ARGN 1
)
# Get the directory of the source file
get_filename_component
(
PARENT_DIR
"
${
FILE
}
"
DIRECTORY
)
# Remove common directory prefix to make the group
string
(
REPLACE
"
${
prefix
}
"
""
GROUP
"
${
PARENT_DIR
}
"
)
# Make sure we are using windows slashes
string
(
REPLACE
"/"
"
\\
"
GROUP
"
${
GROUP
}
"
)
# Group into "Source Files" and "Header Files"
#if ("${FILE}" MATCHES ".*\\.cpp")
# set(GROUP "Source Files${GROUP}")
#elseif("${FILE}" MATCHES ".*\\.h")
# set(GROUP "Header Files${GROUP}")
#endif()
#message(STATUS ${GROUP} " : " ${FILE})
source_group
(
"
${
GROUP
}
"
FILES
"
${
FILE
}
"
)
endforeach
()
endfunction
()
if
(
MSVC AND ENABLE_MSVC_MT
)
set
(
CompilerFlags
...
...
@@ -264,6 +295,11 @@ else ()
add_definitions
(
-DWIN32_LEAN_AND_MEAN -DMP4V2_NO_STDINT_DEFS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS
)
endif
()
if
(
USE_SOLUTION_FOLDERS
AND
(
NOT GROUP_BY_EXPLORER
))
# 在 IDE 中对文件进行分组,源文件和头文件分开
set_file_group
(
${
ToolKit_Root
}
${
ToolKit_src_list
}
)
set_file_group
(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src"
${
MediaKit_src_list
}
)
endif
()
#添加库
add_library
(
zltoolkit STATIC
${
ToolKit_src_list
}
)
add_library
(
zlmediakit STATIC
${
MediaKit_src_list
}
)
...
...
api/tests/CMakeLists.txt
查看文件 @
af08b58d
...
...
@@ -4,6 +4,9 @@ foreach(TEST_SRC ${TEST_SRC_LIST})
message
(
STATUS
"add c api tester:
${
TEST_EXE_NAME
}
"
)
set
(
exe_name api_tester_
${
TEST_EXE_NAME
}
)
add_executable
(
${
exe_name
}
${
TEST_SRC
}
)
if
(
USE_SOLUTION_FOLDERS
)
SET_PROPERTY
(
TARGET
${
exe_name
}
PROPERTY FOLDER
"api_test"
)
endif
()
if
(
MSVC
)
set_target_properties
(
${
exe_name
}
PROPERTIES COMPILE_FLAGS
${
VS_FALGS
}
)
...
...
tests/CMakeLists.txt
查看文件 @
af08b58d
...
...
@@ -14,6 +14,10 @@ foreach (TEST_SRC ${TEST_SRC_LIST})
message
(
STATUS
"add test:
${
TEST_EXE_NAME
}
"
)
add_executable
(
${
TEST_EXE_NAME
}
${
TEST_SRC
}
)
if
(
USE_SOLUTION_FOLDERS
)
SET_PROPERTY
(
TARGET
${
TEST_EXE_NAME
}
PROPERTY FOLDER
"test"
)
endif
()
if
(
MSVC
)
set_target_properties
(
${
TEST_EXE_NAME
}
PROPERTIES COMPILE_FLAGS
${
VS_FALGS
}
)
endif
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论