Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit 1202893

Browse files
authored
Merge pull request #37 from cyanray/dev/cyanray
调整目录结构
2 parents 69e7c8d + 86c3a47 commit 1202893

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+58
-64
lines changed

CMakeLists.txt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required (VERSION 3.1)
22

3-
project (mirai-cpp VERSION 0.4.4)
3+
project (mirai-cpp VERSION 1.2.0)
44

55
set(CMAKE_CXX_STANDARD 11)
66

@@ -23,13 +23,9 @@ aux_source_directory(./src SRCS)
2323

2424
add_library(${PROJECT_NAME} ${LIBRARY_TYPE} ${SRCS})
2525
target_include_directories(${PROJECT_NAME} PUBLIC
26-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
26+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mirai>
2727
$<INSTALL_INTERFACE:include>
2828
)
29-
target_include_directories(${PROJECT_NAME} PUBLIC
30-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/mirai-third-party>
31-
$<INSTALL_INTERFACE:third-party>
32-
)
3329

3430
if(BUILD_SHARED_LIBS)
3531
if(WIN32)
@@ -41,7 +37,7 @@ endif()
4137

4238

4339

44-
option(MIRAI_CPP_BUILD_EXAMPLES "Build examples" ON)
40+
option(MIRAI_CPP_BUILD_EXAMPLES "Build examples" OFF)
4541
if(MIRAI_CPP_BUILD_EXAMPLES)
4642
add_subdirectory(examples)
4743
endif(MIRAI_CPP_BUILD_EXAMPLES)
@@ -66,11 +62,6 @@ if(MIRAI_CPP_INSTALL)
6662
DESTINATION ${CMAKE_INSTALL_PREFIX}
6763
)
6864

69-
install(
70-
DIRECTORY mirai-third-party
71-
DESTINATION ${CMAKE_INSTALL_PREFIX}
72-
)
73-
7465
install(
7566
TARGETS ${PROJECT_NAME}
7667
EXPORT ${PROJECT_NAME}Targets

examples/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ endif(MSVC)
1010
macro(api_exe target)
1111
add_executable(${target} ${target}.cpp)
1212
target_link_libraries(${target} mirai-cpp)
13+
# gcc 要连接 pthread
14+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
15+
target_link_libraries(${target} pthread)
16+
endif()
1317
endmacro()
1418

1519
api_exe(RepeatMessage)

include/mirai.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
#pragma once
2-
#ifndef mirai_cpp__mirai_h_H_
3-
#define mirai_cpp__mirai_h_H_
4-
5-
#include "defs/defs.hpp"
6-
#include "events/events.hpp"
7-
#include "mirai_bot.hpp"
8-
9-
#endif // !mirai_cpp__mirai_h_H_
1+
#include <mirai/mirai.h>
File renamed without changes.

include/defs/friend.hpp renamed to include/mirai/defs/friend.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef mirai_cpp_defs_friend_hpp_H_
33
#define mirai_cpp_defs_friend_hpp_H_
44

5-
#include <nlohmann/json.hpp>
5+
#include "third-party/nlohmann/json.hpp"
66
#include "qq_types.hpp"
77
#include "serializable.hpp"
88

include/defs/group.hpp renamed to include/mirai/defs/group.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef mirai_cpp_defs_group_hpp_H_
33
#define mirai_cpp_defs_group_hpp_H_
44

5-
#include <nlohmann/json.hpp>
5+
#include "third-party/nlohmann/json.hpp"
66
#include "qq_types.hpp"
77
#include "serializable.hpp"
88

include/defs/group_config.hpp renamed to include/mirai/defs/group_config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef mirai_cpp_defs_group_config_hpp_H_
33
#define mirai_cpp_defs_group_config_hpp_H_
44

5-
#include <nlohmann/json.hpp>
5+
#include "third-party/nlohmann/json.hpp"
66
#include "serializable.hpp"
77

88
namespace Cyan

include/defs/group_member.hpp renamed to include/mirai/defs/group_member.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef mirai_cpp_defs_group_member_hpp_H_
33
#define mirai_cpp_defs_group_member_hpp_H_
44

5-
#include <nlohmann/json.hpp>
5+
#include "third-party/nlohmann/json.hpp"
66
#include "qq_types.hpp"
77
#include "serializable.hpp"
88
#include "group.hpp"

include/defs/group_member_info.hpp renamed to include/mirai/defs/group_member_info.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#define mirai_cpp_defs_group_member_info_hpp_H_
44

55
#include <string>
6-
#include <nlohmann/json.hpp>
6+
#include "third-party/nlohmann/json.hpp"
77
#include "serializable.hpp"
88

99

include/defs/message_chain.hpp renamed to include/mirai/defs/message_chain.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef mirai_cpp_defs_message_chain_hpp_H_
33
#define mirai_cpp_defs_message_chain_hpp_H_
44

5-
#include <nlohmann/json.hpp>
5+
#include "third-party/nlohmann/json.hpp"
66
#include <sstream>
77
#include <vector>
88
#include <memory>

0 commit comments

Comments
 (0)