This repository was archived by the owner on Jul 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
48 lines (38 loc) · 1.31 KB
/
CMakeLists.txt
File metadata and controls
48 lines (38 loc) · 1.31 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
cmake_minimum_required( VERSION 3.10 )
project( ModernCPPDesignPatterns )
set( old_way_prefix ${CMAKE_CURRENT_LIST_DIR}/old )
set( old_sources
${old_way_prefix}/Shape.cpp
${old_way_prefix}/Shape.hpp
${old_way_prefix}/Rectangle.cpp
${old_way_prefix}/Rectangle.hpp
${old_way_prefix}/Square.cpp
${old_way_prefix}/Square.hpp
${old_way_prefix}/Circle.cpp
${old_way_prefix}/Circle.hpp
${old_way_prefix}/RandomShapeFactory.cpp
${old_way_prefix}/RandomShapeFactory.hpp
${old_way_prefix}/main.cpp
)
set( utils_prefix ${CMAKE_CURRENT_LIST_DIR}/util )
set( utils_sources
${utils_prefix}/Random.cpp
${utils_prefix}/Random.hpp
)
set( CMAKE_CXX_STANDARD 17 )
add_executable( OldWay ${old_sources} ${utils_sources} )
target_include_directories( OldWay PRIVATE ${utils_prefix} )
set( new_way_prefix ${CMAKE_CURRENT_LIST_DIR}/new )
set( new_sources
${new_way_prefix}/Rectangle.cpp
${new_way_prefix}/Rectangle.hpp
${new_way_prefix}/Square.cpp
${new_way_prefix}/Square.hpp
${new_way_prefix}/Circle.cpp
${new_way_prefix}/Circle.hpp
${new_way_prefix}/RandomShapeGenerator.cpp
${new_way_prefix}/RandomShapeGenerator.hpp
${new_way_prefix}/main.cpp
)
add_executable( NewWay ${new_sources} ${utils_sources} )
target_include_directories( NewWay PRIVATE ${utils_prefix} )