generallib/general/CMakeLists.txt

40 lines
1.6 KiB
CMake

cmake_minimum_required(VERSION 3.11)
enable_language(CXX)
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})
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# using Clang
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options(-Wall)
add_compile_options(-Wsign-compare)
add_compile_options(-Werror)
add_compile_options(-Wno-unused-function)
add_compile_options(-Wno-misleading-indentation)
add_compile_options(-Wno-format-overflow)
# using GCC
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# using Intel C++
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_compile_options("/std:c++17")
# using Visual Studio C++
endif()
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/obj)
set(CMAKE_CXX_STANDARD 11)
INCLUDE_DIRECTORIES (./)
INCLUDE_DIRECTORIES (inc)
INCLUDE_DIRECTORIES (encrypt)
INCLUDE_DIRECTORIES (pattern)
include_directories(third/include)
aux_source_directory(src DIRSRCS)
aux_source_directory(src/pattern PaternSrc)
add_library(General OBJECT ${DIRSRCS} ${PaternSrc} src/pattern/signleton.hpp src/pattern/cmd.hpp src/pattern/Observer.hpp src/pattern/stratergy.hpp "src/pattern/adapter.hpp" 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 src/function/Timer.cpp src/function/btree.cpp src/function/btree.h src/algorithm/sorter.hpp)