init
This commit is contained in:
commit
c7bc5cfa1c
9
.gitmodules
vendored
Normal file
9
.gitmodules
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
[submodule "thrid_party/rapidjson"]
|
||||
path = thrid_party/rapidjson
|
||||
url = https://github.com/Tencent/rapidjson.git
|
||||
[submodule "thrid_party/imgui"]
|
||||
path = thrid_party/imgui
|
||||
url = http://www.nanako.site:9004/Nanako/imgui.git
|
||||
[submodule "thrid_party/restclient-cpp"]
|
||||
path = thrid_party/restclient-cpp
|
||||
url = https://github.com/mrtazz/restclient-cpp.git
|
21
CMakeLists.txt
Normal file
21
CMakeLists.txt
Normal file
@ -0,0 +1,21 @@
|
||||
cmake_minimum_required(VERSION 3.29)
|
||||
project(arona_baidu)
|
||||
|
||||
include(retrieve_files.cmake)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
# find libcurl
|
||||
pkg_check_modules(CURL REQUIRED libcurl)
|
||||
# find openssl
|
||||
pkg_check_modules(OPENSSL REQUIRED openssl)
|
||||
# find rapidjson
|
||||
pkg_check_modules(RAPIDJSON REQUIRED rapidjson)
|
||||
|
||||
add_subdirectory(thrid_party/imgui)
|
||||
add_subdirectory(thrid_party/restclient-cpp)
|
||||
|
||||
set(ALL_FILES "")
|
||||
retrieve_files(${CMAKE_CURRENT_SOURCE_DIR}/src ALL_FILES)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${ALL_FILES})
|
||||
target_link_libraries(${PROJECT_NAME} imgui)
|
55
retrieve_files.cmake
Normal file
55
retrieve_files.cmake
Normal file
@ -0,0 +1,55 @@
|
||||
|
||||
function(retrieve_files path out_files)
|
||||
message(STATUS "Retrieving files in ${path}")
|
||||
|
||||
# 递归查找文件夹下的 .h .hpp. ini 文件保存到 HEAD_FILES
|
||||
file(GLOB_RECURSE HEAD_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CONFIGURE_DEPENDS ${path}/*.h ${path}/*.hpp ${path}/*.ini)
|
||||
|
||||
# 递归查找文件夹下的 *.cpp *.c 文件保存到 SRC_FILES
|
||||
file(GLOB_RECURSE SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CONFIGURE_DEPENDS ${path}/*.cpp ${path}*.c ${path}*.ixx)
|
||||
|
||||
# 将 HEDADER_FILES 和 SRC_FILES 保存到 ALL_FILES 变量
|
||||
set(ALL_FILES ${HEAD_FILES} ${SRC_FILES})
|
||||
|
||||
set(RESULT "")
|
||||
|
||||
# 对 ALL_FILES 变量里面的所有文件分类(保留资源管理器的目录结构)
|
||||
foreach(fileItem ${ALL_FILES})
|
||||
# Get the directory of the source file
|
||||
get_filename_component(PARENT_DIR "${fileItem}" DIRECTORY)
|
||||
|
||||
# 用于检查平台的条件
|
||||
if(PARENT_DIR STREQUAL "windows")
|
||||
if(WIN32)
|
||||
set(RESULT "${RESULT};${fileItem}")
|
||||
else()
|
||||
continue()
|
||||
endif()
|
||||
elseif(PARENT_DIR STREQUAL "linux")
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(RESULT "${RESULT};${fileItem}")
|
||||
else()
|
||||
continue()
|
||||
endif()
|
||||
elseif(PARENT_DIR STREQUAL "mac")
|
||||
if(APPLE)
|
||||
set(RESULT "${RESULT};${fileItem}")
|
||||
else()
|
||||
continue()
|
||||
endif()
|
||||
else()
|
||||
# 如果文件夹名称不是平台,则始终包含
|
||||
set(RESULT "${RESULT};${fileItem}")
|
||||
endif()
|
||||
|
||||
# Remove common directory prefix to make the group
|
||||
string(REPLACE "${path}" "" GROUP "${PARENT_DIR}")
|
||||
# Make sure we are using windows slashes
|
||||
string(REPLACE "/" "\\" GROUP "${GROUP}")
|
||||
# Group into "Source Files" and "Header Files"
|
||||
set(GROUP "${GROUP}")
|
||||
source_group("${GROUP}" FILES "${fileItem}")
|
||||
endforeach()
|
||||
|
||||
set(${out_files} ${RESULT} PARENT_SCOPE)
|
||||
endfunction()
|
25
src/main.cpp
Normal file
25
src/main.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
#include "imgui_main.h"
|
||||
|
||||
std::string get_window_title() {
|
||||
return "arona_imgui";
|
||||
}
|
||||
|
||||
// 配置imgui, 比如加载字体, 启用多视口等
|
||||
void configure_imgui(ImGuiIO& io) {
|
||||
|
||||
}
|
||||
|
||||
// 执行一些数据更新代码在这里
|
||||
void tick_imgui(float delta_time) {
|
||||
|
||||
}
|
||||
|
||||
// 执行imgui绘制(在tick_imgui之后执行)
|
||||
void draw_imgui(float delta_time) {
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
run_imgui();
|
||||
return 0;
|
||||
}
|
1
thrid_party/imgui
Submodule
1
thrid_party/imgui
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 083d97856eff615f793b2e60cf450b6fb2ee36a9
|
1
thrid_party/rapidjson
Submodule
1
thrid_party/rapidjson
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit ab1842a2dae061284c0a62dca1cc6d5e7e37e346
|
1
thrid_party/restclient-cpp
Submodule
1
thrid_party/restclient-cpp
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit fdf722bbab55d0838200dfbf2c3a2815741c8a7e
|
Loading…
x
Reference in New Issue
Block a user