-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
31 lines (23 loc) · 921 Bytes
/
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
cmake_minimum_required(VERSION 3.10)
project(SingleLinkedList)
set(CMAKE_CXX_STANDARD 17)
if(CMAKE_SYSTEM_NAME MATCHES "^MINGW")
set(SYSTEM_LIBS -lstdc++)
else ()
set(SYSTEM_LIBS)
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}/JMC")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Werror -Wno-unused-parameter -Wno-implicit-fallthrough")
endif()
set(INCLUDE_DIR inc)
set(SOURCE_DIR src)
set(FILES_SINGLE_LIST "${INCLUDE_DIR}/SingleLinkedList.h")
set(FILES_TESTS "${INCLUDE_DIR}/tests.h" "${SOURCE_DIR}/tests.cpp")
set(FILES_MAIN "${SOURCE_DIR}/main.cpp")
source_group("SingleLinkedList" FILES ${FILES_SINGLE_LIST})
source_group("Tests" FILES ${FILES_TESTS})
source_group("Source" FILES ${FILES_MAIN})
add_executable("list" ${FILES_MAIN} ${FILES_TESTS} ${FILES_SINGLE_LIST})
target_link_libraries("list" ${SYSTEM_LIBS})