2020-04-24 01:25:09 +00:00
|
|
|
cmake_minimum_required(VERSION 3.11)
|
2020-09-30 03:43:43 +00:00
|
|
|
enable_language(CXX)
|
2020-04-24 01:25:09 +00:00
|
|
|
project(General)
|
2021-03-10 14:21:52 +00:00
|
|
|
|
2020-04-24 01:25:09 +00:00
|
|
|
message( "current compiler " ${CMAKE_CXX_COMPILER_ID})
|
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
# using Clang
|
|
|
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
2020-05-06 10:09:59 +00:00
|
|
|
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)
|
|
|
|
|
2020-04-24 01:25:09 +00:00
|
|
|
# using GCC
|
|
|
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
|
|
|
|
# using Intel C++
|
|
|
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|
|
|
# using Visual Studio C++
|
|
|
|
endif()
|
|
|
|
|
|
|
|
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/obj)
|
2021-03-10 14:21:52 +00:00
|
|
|
message( "LIBRARY_OUTPUT_PATH " ${LIBRARY_OUTPUT_PATH})
|
2020-04-24 01:25:09 +00:00
|
|
|
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)
|
2021-03-19 09:31:22 +00:00
|
|
|
aux_source_directory(src/function FunctionSrc)
|
|
|
|
aux_source_directory(src/algorithm AlgorithmSrc)
|
|
|
|
aux_source_directory(src/encrypt EncryptSrc)
|
2020-04-24 01:25:09 +00:00
|
|
|
|
2021-12-06 08:33:51 +00:00
|
|
|
message("source file is " ${DIRSRCS} ${PaternSrc} ${EncryptSrc} ${FunctionSrc} ${AlgorithmSrc})
|
2020-04-24 01:25:09 +00:00
|
|
|
|
2021-12-06 08:33:51 +00:00
|
|
|
add_library(General OBJECT ${DIRSRCS} ${PaternSrc} ${EncryptSrc} ${FunctionSrc} ${AlgorithmSrc} )
|