generallib/general/CMakeLists.txt

42 lines
1.4 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.11)
2020-09-30 03:43:43 +00:00
enable_language(CXX)
project(General)
2021-03-10 14:21:52 +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")
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")
# using Visual Studio C++
2021-12-15 08:19:59 +00:00
add_compile_options(/D_CRT_SECURE_NO_WARNINGS_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS)
endif()
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/obj)
2021-03-10 14:21:52 +00:00
message( "LIBRARY_OUTPUT_PATH " ${LIBRARY_OUTPUT_PATH})
set(CMAKE_CXX_STANDARD 11)
INCLUDE_DIRECTORIES (./)
INCLUDE_DIRECTORIES (inc)
INCLUDE_DIRECTORIES (encrypt)
INCLUDE_DIRECTORIES (pattern)
2021-12-15 08:19:59 +00:00
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)
2021-12-06 08:33:51 +00:00
message("source file is " ${DIRSRCS} ${PaternSrc} ${EncryptSrc} ${FunctionSrc} ${AlgorithmSrc})
2021-12-06 08:33:51 +00:00
add_library(General OBJECT ${DIRSRCS} ${PaternSrc} ${EncryptSrc} ${FunctionSrc} ${AlgorithmSrc} )