依赖包组合成一个包
parent
dbbad9be1e
commit
f645cff22c
|
@ -14,10 +14,10 @@
|
|||
<list default="true" id="0facce0d-c642-4d80-b2fb-daf5f3e68dff" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/CMakeLists.txt" beforeDir="false" afterPath="$PROJECT_DIR$/CMakeLists.txt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/cmake-build-debug/CMakeCache.txt" beforeDir="false" afterPath="$PROJECT_DIR$/cmake-build-debug/CMakeCache.txt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/TcpClient.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/TcpClient.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/net/TcpClient.h" beforeDir="false" afterPath="$PROJECT_DIR$/src/net/TcpClient.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/test/CMakeLists.txt" beforeDir="false" afterPath="$PROJECT_DIR$/test/CMakeLists.txt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/test/src/tcpclient_test.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/test/src/tcpclient_test.cpp" afterDir="false" />
|
||||
</list>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
@ -118,6 +118,8 @@
|
|||
<workItem from="1587183781038" duration="13107000" />
|
||||
<workItem from="1587266163206" duration="2365000" />
|
||||
<workItem from="1587349363612" duration="16126000" />
|
||||
<workItem from="1587473284944" duration="44000" />
|
||||
<workItem from="1587473352763" duration="6395000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
cmake_minimum_required(VERSION 3.11)
|
||||
project(General)
|
||||
|
||||
set(MINGW_PATH $ENV{MINGW_TOOLCHAIN})
|
||||
message("path is " ${MINGW_PATH})
|
||||
message( "libevent path " ${CONAN_LIBEVENT_ROOT})
|
||||
message( "current compiler " ${CMAKE_CXX_COMPILER_ID})
|
||||
|
||||
|
@ -24,8 +25,12 @@ include_directories(third/include)
|
|||
aux_source_directory(src DIRSRCS)
|
||||
aux_source_directory(src/pattern PaternSrc)
|
||||
|
||||
|
||||
add_library(General ${DIRSRCS} ${PaternSrc} src/pattern/signleton.h src/pattern/Observer.h src/pattern/stratergy.h src/pattern/adapter.h src/encrypt/base64.cpp src/encrypt/base64.h src/encrypt/aes.cpp src/encrypt/aes.h src/encrypt/rsa.cpp
|
||||
src/math/BigInt.hpp src/net/TcpClient.cpp src/net/TcpClient.h src/net/PackageReceiver.cpp src/net/PackageReceiver.h)
|
||||
set_target_properties(General PROPERTIES LINKER_LANGUAGE CXX)
|
||||
target_link_libraries(General -Wl,--whole-archive third/lib/libevent.a third/lib/libevent_core.a)
|
||||
|
||||
set(COPYITEM inc)
|
||||
file(GLOB INCLUDES ${PROJECT_SOURCE_DIR}/inc/*)
|
||||
file(COPY ${INCLUDES} DESTINATION ${LIBRARY_OUTPUT_PATH}/inc
|
||||
|
@ -54,9 +59,6 @@ message( "copy net ")
|
|||
file(GLOB NET ${PROJECT_SOURCE_DIR}/src/net/*.h)
|
||||
file(COPY ${NET} DESTINATION ${LIBRARY_OUTPUT_PATH}/inc/
|
||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_WRITE GROUP_READ WORLD_READ)
|
||||
link_libraries(third/lib/libevent.a)
|
||||
link_libraries(third/lib/libevent_core.a)
|
||||
|
||||
IF (WIN32)
|
||||
|
||||
ELSEIF (UNIX)
|
||||
|
|
|
@ -238,6 +238,9 @@ CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
|
|||
//Value Computed by CMake
|
||||
General_BINARY_DIR:STATIC=D:/project/c++/generallib/cmake-build-debug
|
||||
|
||||
//Dependencies for the target
|
||||
General_LIB_DEPENDS:STATIC=general;-Wl,--whole-archive;general;third/lib/libevent.a;general;third/lib/libevent_core.a;
|
||||
|
||||
//Value Computed by CMake
|
||||
General_SOURCE_DIR:STATIC=D:/project/c++/generallib
|
||||
|
||||
|
|
|
@ -179,3 +179,7 @@ int TcpClientLibevent::SetObserver(TcpClientLibevent::TcpClientObserver *ob) {
|
|||
int TcpClientLibevent::Dispatch() {
|
||||
return event_base_dispatch(mBase);;
|
||||
}
|
||||
|
||||
TcpClientLibevent::~TcpClientLibevent() {
|
||||
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ public:
|
|||
|
||||
};
|
||||
TcpClientLibevent(std::string addrinfo,int port, TcpClientObserver *p);
|
||||
~TcpClientLibevent();
|
||||
int ConnectServer();
|
||||
bool Connected();
|
||||
int Dispatch();
|
||||
|
|
|
@ -8,4 +8,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../obj/inc/third/include)
|
|||
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/../obj/)
|
||||
link_libraries(libGeneral.a)
|
||||
link_libraries(ws2_32)
|
||||
link_libraries(${CMAKE_CURRENT_SOURCE_DIR}/../third/lib/libevent.a)
|
||||
link_libraries(${CMAKE_CURRENT_SOURCE_DIR}/../third/lib/libevent_core.a)
|
||||
link_libraries(ws2_32)
|
||||
add_executable(tcptest src/tcpclient_test.cpp)
|
Loading…
Reference in New Issue