42 lines
1.8 KiB
CMake
42 lines
1.8 KiB
CMake
cmake_minimum_required(VERSION 3.11)
|
|
project(General)
|
|
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/obj)
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
INCLUDE_DIRECTORIES (./)
|
|
INCLUDE_DIRECTORIES (inc)
|
|
INCLUDE_DIRECTORIES (encrypt)
|
|
INCLUDE_DIRECTORIES (pattern)
|
|
|
|
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)
|
|
set(COPYITEM inc)
|
|
file(GLOB INCLUDES ${PROJECT_SOURCE_DIR}/inc/*)
|
|
file(COPY ${INCLUDES} DESTINATION ${LIBRARY_OUTPUT_PATH}/inc
|
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_WRITE GROUP_READ WORLD_READ)
|
|
message(status ${INCLUDES})
|
|
|
|
file(GLOB PatternINCLUDES ${PROJECT_SOURCE_DIR}/src/pattern/*.h)
|
|
file(COPY ${PatternINCLUDES} DESTINATION ${LIBRARY_OUTPUT_PATH}/inc
|
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_WRITE GROUP_READ WORLD_READ)
|
|
message( "copy pattern library" ${PatternINCLUDES})
|
|
file(GLOB EncryptINCLUDES ${PROJECT_SOURCE_DIR}/src/encrypt/*.h)
|
|
file(COPY ${EncryptINCLUDES} DESTINATION ${LIBRARY_OUTPUT_PATH}/inc
|
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_WRITE GROUP_READ WORLD_READ)
|
|
file(GLOB MathINCLUDES ${PROJECT_SOURCE_DIR}/src/math/*.hpp)
|
|
message( "copy math library" ${MathINCLUDES})
|
|
file(COPY ${MathINCLUDES} DESTINATION ${LIBRARY_OUTPUT_PATH}/inc/
|
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_WRITE GROUP_READ WORLD_READ)
|
|
file(GLOB EIGENLIBS ${PROJECT_SOURCE_DIR}/src/math/eigin/*)
|
|
message( "copy eigen library" ${EIGENLIBS})
|
|
|
|
add_custom_command(
|
|
TARGET General PRE_BUILD
|
|
COMMAND cp -r
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/math/Eigen
|
|
${CMAKE_CURRENT_SOURCE_DIR}/obj/inc/
|
|
)
|
|
|