-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
35 lines (29 loc) · 1.2 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
cmake_minimum_required(VERSION 3.16.6)
set(PROJECT_VERSION_MAJOR 0)
set(PROJECT_VERSION_MINOR 11)
set(PROJECT_VERSION_PATCH 1) # delete endsWith strs when master merge dev
project(CS203_DSAA_template
DESCRIPTION "Template for Algorithm Based on C++11 and Modern CMake"
HOMEPAGE_URL "https://github.com/Certseeds/CS203_DSAA_template"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_VERBOSE_MAKEFILE ON)
string(TIMESTAMP time_str "%Y/%m/%d %H:%M:%S")
MESSAGE(STATUS "Compiler In \n ${time_str}")
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CMakeLists.txt)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/include)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/algorithm)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/basic)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/third_party)
enable_testing()
file(GLOB USER_LIBS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lab_*) # regex to find libs, more flexibility
foreach (elementName IN LISTS USER_LIBS_PATH)
if (EXISTS ${elementName}/CMakeLists.txt)
add_subdirectory(${elementName})
else()
MESSAGE("${elementName} is empty")
endif ()
endforeach ()
unset(USER_LIBS_PATH)