Refactor: Rename ide/ directory to cmake/ for better clarity (#4539)

This PR renames the trunk/ide/ directory to trunk/cmake/ to better
reflect its actual purpose. The directory contains CMake build
configuration files used by multiple IDEs (CLion, VSCode), not
IDE-specific files.

* Directory rename: trunk/ide/ → trunk/cmake/
* Build output location: trunk/ide/vscode-build/ → trunk/cmake/build/
* CMakeLists.txt: Moved from trunk/ide/srs_clion/CMakeLists.txt to
trunk/cmake/CMakeLists.txt
This commit is contained in:
Haibo Chen(陈海博)
2025-10-24 08:38:48 +08:00
committed by GitHub
parent 2fb216e86d
commit 8f1578e0e3
7 changed files with 15 additions and 21 deletions

View File

@@ -41,4 +41,4 @@
**/usr/** **/usr/**
**/.github/** **/.github/**
**/gdb/** **/gdb/**
**/ide/** **/cmake/**

8
.gitignore vendored
View File

@@ -35,12 +35,6 @@
*.exe *.exe
cmake-build-debug cmake-build-debug
/trunk/ide/srs_clion/CMakeCache.txt
/trunk/ide/srs_clion/CMakeFiles
/trunk/ide/srs_clion/Makefile
/trunk/ide/srs_clion/cmake_install.cmake
/trunk/ide/srs_clion/srs
/trunk/ide/srs_clion/Testing/
/trunk/ide/vscode-build
/build/ /build/
/trunk/cmake/build

14
.vscode/README.md vendored
View File

@@ -17,26 +17,26 @@ Run commmand to configure the project by pressing `Command+Shift+P`, then type `
then select `Clang` as the toolchain. Or run the command manually in terminal: then select `Clang` as the toolchain. Or run the command manually in terminal:
```bash ```bash
cmake -S $HOME/git/srs/trunk/ide/srs_clion -B $HOME/git/srs/trunk/ide/vscode-build cmake -S $HOME/git/srs/trunk/cmake -B $HOME/git/srs/trunk/cmake/build
``` ```
> Note: Sometimes it may fail to configure when building libsrtp. Just retry, and it will succeed. > Note: Sometimes it may fail to configure when building libsrtp. Just retry, and it will succeed.
> Note: Make sure you have `xcode` installed, and run `xcode-select --install` to setup the toolchains. > Note: Make sure you have `xcode` installed, and run `xcode-select --install` to setup the toolchains.
> Note: The `settings.json` is used to configure the cmake. It will use `$HOME/git/srs/trunk/ide/srs_clion/CMakeLists.txt` > Note: The `settings.json` is used to configure the cmake. It will use `$HOME/git/srs/trunk/cmake/CMakeLists.txt`
> and `$HOME/git/srs/trunk/ide/vscode-build` as the source file and build directory. > and `$HOME/git/srs/trunk/cmake/build` as the source file and build directory.
Click the `Run > Run Without Debugging` or `Run > Start Debugging` from menu to start or Click the `Run > Run Without Debugging` or `Run > Start Debugging` from menu to start or
debug the server. It will invoke the `build` task defined in `tasks.json`, or you can run debug the server. It will invoke the `build` task defined in `tasks.json`, or you can run
it manually: it manually:
```bash ```bash
cmake --build $HOME/git/srs/trunk/ide/vscode-build cmake --build $HOME/git/srs/trunk/cmake/build
``` ```
> Note: The `launch.json` is used for running and debugging. The build will output the binary to > Note: The `launch.json` is used for running and debugging. The build will output the binary to
> `$HOME/git/srs/trunk/ide/vscode-build/srs`. > `$HOME/git/srs/trunk/cmake/build/srs`.
## macOS: SRS UTest ## macOS: SRS UTest
@@ -51,7 +51,7 @@ Run commmand to configure the project by pressing `Command+Shift+P`, then type `
then select `Clang` as the toolchain. Or run the command manually in terminal: then select `Clang` as the toolchain. Or run the command manually in terminal:
```bash ```bash
cmake -S $HOME/git/srs/trunk/ide/srs_clion -B $HOME/git/srs/trunk/ide/vscode-build cmake -S $HOME/git/srs/trunk/cmake -B $HOME/git/srs/trunk/cmake/build
``` ```
> Note: Sometimes it may fail to configure when building libsrtp. Just retry, and it will succeed. > Note: Sometimes it may fail to configure when building libsrtp. Just retry, and it will succeed.
@@ -60,7 +60,7 @@ Afterwards, build the utest by pressing `Command+Shift+P`, then type `CMake: Bui
build command. It will invoke the `build` task defined in `tasks.json`, or you can run it manually: build command. It will invoke the `build` task defined in `tasks.json`, or you can run it manually:
```bash ```bash
cmake --build $HOME/git/srs/trunk/ide/vscode-build cmake --build $HOME/git/srs/trunk/cmake/build
``` ```
Then you will discover all the unit testcases from the `View > Testing` panel. You can Then you will discover all the unit testcases from the `View > Testing` panel. You can

2
.vscode/launch.json vendored
View File

@@ -5,7 +5,7 @@
"name": "Launch SRS", "name": "Launch SRS",
"type": "cppdbg", "type": "cppdbg",
"request": "launch", "request": "launch",
"program": "${workspaceFolder}/trunk/ide/vscode-build/srs", "program": "${workspaceFolder}/trunk/cmake/build/srs",
"args": ["-c", "conf/console.conf"], "args": ["-c", "conf/console.conf"],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${workspaceFolder}/trunk", "cwd": "${workspaceFolder}/trunk",

View File

@@ -1,11 +1,11 @@
{ {
"cmake.sourceDirectory": "${workspaceFolder}/trunk/ide/srs_clion", "cmake.sourceDirectory": "${workspaceFolder}/trunk/cmake",
"cmake.buildDirectory": "${workspaceFolder}/trunk/ide/vscode-build", "cmake.buildDirectory": "${workspaceFolder}/trunk/cmake/build",
"cmake.configureOnOpen": false, "cmake.configureOnOpen": false,
"cmake.ctest.testExplorerIntegrationEnabled": false, "cmake.ctest.testExplorerIntegrationEnabled": false,
"testMate.cpp.test.advancedExecutables": [ "testMate.cpp.test.advancedExecutables": [
"{build,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*", "{build,Build,BUILD,out,Out,OUT}/**/*{test,Test,TEST}*",
"${workspaceFolder}/trunk/ide/vscode-build/**/*{utest,test,Test,TEST}*" "${workspaceFolder}/trunk/cmake/build/**/*{utest,test,Test,TEST}*"
], ],
"files.associations": { "files.associations": {
"vector": "cpp", "vector": "cpp",

2
.vscode/tasks.json vendored
View File

@@ -4,7 +4,7 @@
{ {
"label": "build", "label": "build",
"type": "shell", "type": "shell",
"command": "cmake --build ${workspaceFolder}/trunk/ide/vscode-build", "command": "cmake --build ${workspaceFolder}/trunk/cmake/build",
"group": { "group": {
"kind": "build", "kind": "build",
"isDefault": true "isDefault": true

View File

@@ -11,7 +11,7 @@ set (CMAKE_CXX_STANDARD 11)
########################################################### ###########################################################
execute_process( execute_process(
COMMAND bash -c "cd ${PROJECT_SOURCE_DIR}/../../ && pwd" COMMAND bash -c "cd ${PROJECT_SOURCE_DIR}/../ && pwd"
OUTPUT_VARIABLE SRS_DIR OUTPUT_VARIABLE SRS_DIR
) )
string(STRIP ${SRS_DIR} SRS_DIR) string(STRIP ${SRS_DIR} SRS_DIR)