Skip to content

Commit b5d3b2b

Browse files
committed
finish "step1":exercise 2
1 parent 0858bb9 commit b5d3b2b

20 files changed

Lines changed: 1809 additions & 7 deletions

‎Step1/CMakeLists.txt‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,22 @@ Tutorial/Tutorial.cxx)
1515
# TODO11: Add the Tutorial subdirectory to the project
1616

1717
# TODO5: Add a library target called MathFunctions to the project
18-
18+
add_library(MathFunction)
1919
# TODO6: Add the source and header file located in Step1/MathFunctions to the
2020
# MathFunctions target, note that the intended way to include the
2121
# MathFunctions header is:
2222
# #include <MathFunctions.h>
23+
target_sources(MathFunction
24+
PRIVATE
25+
MathFunctions/MathFunctions.cxx
26+
27+
PUBLIC
28+
FILE_SET HEADERS
29+
BASE_DIRS
30+
MathFunctions
31+
FILES
32+
MathFunctions/MathFunctions.h
33+
2334

35+
)
2436
# TODO13: Add the MathFunctions subdirectory to the project

‎Step1/build/CMakeFiles/Makefile.cmake‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ set(CMAKE_MAKEFILE_PRODUCTS
4444
# Dependency information for all targets:
4545
set(CMAKE_DEPEND_INFO_FILES
4646
"CMakeFiles/Tutorial.dir/DependInfo.cmake"
47+
"CMakeFiles/MathFunction.dir/DependInfo.cmake"
4748
)

‎Step1/build/CMakeFiles/Makefile2‎

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ CMAKE_BINARY_DIR = /home/yyz/cmake_tutorial/tutorial/Step1/build
6464

6565
# The main recursive "all" target.
6666
all: CMakeFiles/Tutorial.dir/all
67+
all: CMakeFiles/MathFunction.dir/all
6768
.PHONY : all
6869

6970
# The main recursive "preinstall" target.
@@ -72,6 +73,7 @@ preinstall:
7273

7374
# The main recursive "clean" target.
7475
clean: CMakeFiles/Tutorial.dir/clean
76+
clean: CMakeFiles/MathFunction.dir/clean
7577
.PHONY : clean
7678

7779
#=============================================================================
@@ -81,7 +83,7 @@ clean: CMakeFiles/Tutorial.dir/clean
8183
CMakeFiles/Tutorial.dir/all:
8284
$(MAKE) $(MAKESILENT) -f CMakeFiles/Tutorial.dir/build.make CMakeFiles/Tutorial.dir/depend
8385
$(MAKE) $(MAKESILENT) -f CMakeFiles/Tutorial.dir/build.make CMakeFiles/Tutorial.dir/build
84-
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/yyz/cmake_tutorial/tutorial/Step1/build/CMakeFiles --progress-num=1,2 "Built target Tutorial"
86+
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/yyz/cmake_tutorial/tutorial/Step1/build/CMakeFiles --progress-num=3,4 "Built target Tutorial"
8587
.PHONY : CMakeFiles/Tutorial.dir/all
8688

8789
# Build rule for subdir invocation for target.
@@ -100,6 +102,32 @@ CMakeFiles/Tutorial.dir/clean:
100102
$(MAKE) $(MAKESILENT) -f CMakeFiles/Tutorial.dir/build.make CMakeFiles/Tutorial.dir/clean
101103
.PHONY : CMakeFiles/Tutorial.dir/clean
102104

105+
#=============================================================================
106+
# Target rules for target CMakeFiles/MathFunction.dir
107+
108+
# All Build rule for target.
109+
CMakeFiles/MathFunction.dir/all:
110+
$(MAKE) $(MAKESILENT) -f CMakeFiles/MathFunction.dir/build.make CMakeFiles/MathFunction.dir/depend
111+
$(MAKE) $(MAKESILENT) -f CMakeFiles/MathFunction.dir/build.make CMakeFiles/MathFunction.dir/build
112+
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/yyz/cmake_tutorial/tutorial/Step1/build/CMakeFiles --progress-num=1,2 "Built target MathFunction"
113+
.PHONY : CMakeFiles/MathFunction.dir/all
114+
115+
# Build rule for subdir invocation for target.
116+
CMakeFiles/MathFunction.dir/rule: cmake_check_build_system
117+
$(CMAKE_COMMAND) -E cmake_progress_start /home/yyz/cmake_tutorial/tutorial/Step1/build/CMakeFiles 2
118+
$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/MathFunction.dir/all
119+
$(CMAKE_COMMAND) -E cmake_progress_start /home/yyz/cmake_tutorial/tutorial/Step1/build/CMakeFiles 0
120+
.PHONY : CMakeFiles/MathFunction.dir/rule
121+
122+
# Convenience name for target.
123+
MathFunction: CMakeFiles/MathFunction.dir/rule
124+
.PHONY : MathFunction
125+
126+
# clean rule for target.
127+
CMakeFiles/MathFunction.dir/clean:
128+
$(MAKE) $(MAKESILENT) -f CMakeFiles/MathFunction.dir/build.make CMakeFiles/MathFunction.dir/clean
129+
.PHONY : CMakeFiles/MathFunction.dir/clean
130+
103131
#=============================================================================
104132
# Special targets to cleanup operation of make.
105133

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
# Consider dependencies only in project.
3+
set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF)
4+
5+
# The set of languages for which implicit dependencies are needed:
6+
set(CMAKE_DEPENDS_LANGUAGES
7+
)
8+
9+
# The set of dependency files which are needed:
10+
set(CMAKE_DEPENDS_DEPENDENCY_FILES
11+
"/home/yyz/cmake_tutorial/tutorial/Step1/MathFunctions/MathFunctions.cxx" "CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.o" "gcc" "CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.o.d"
12+
)
13+
14+
# Targets to which this target links.
15+
set(CMAKE_TARGET_LINKED_INFO_FILES
16+
)
17+
18+
# Fortran module output directory.
19+
set(CMAKE_Fortran_TARGET_MODULE_DIR "")
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# CMAKE generated file: DO NOT EDIT!
2+
# Generated by "Unix Makefiles" Generator, CMake Version 3.23
3+
4+
# Delete rule output on recipe failure.
5+
.DELETE_ON_ERROR:
6+
7+
#=============================================================================
8+
# Special targets provided by cmake.
9+
10+
# Disable implicit rules so canonical targets will work.
11+
.SUFFIXES:
12+
13+
# Disable VCS-based implicit rules.
14+
% : %,v
15+
16+
# Disable VCS-based implicit rules.
17+
% : RCS/%
18+
19+
# Disable VCS-based implicit rules.
20+
% : RCS/%,v
21+
22+
# Disable VCS-based implicit rules.
23+
% : SCCS/s.%
24+
25+
# Disable VCS-based implicit rules.
26+
% : s.%
27+
28+
.SUFFIXES: .hpux_make_needs_suffix_list
29+
30+
# Command-line flag to silence nested $(MAKE).
31+
$(VERBOSE)MAKESILENT = -s
32+
33+
#Suppress display of executed commands.
34+
$(VERBOSE).SILENT:
35+
36+
# A target that is always out of date.
37+
cmake_force:
38+
.PHONY : cmake_force
39+
40+
#=============================================================================
41+
# Set environment variables for the build.
42+
43+
# The shell in which to execute make rules.
44+
SHELL = /bin/sh
45+
46+
# The CMake executable.
47+
CMAKE_COMMAND = /opt/cmake/bin/cmake
48+
49+
# The command to remove a file.
50+
RM = /opt/cmake/bin/cmake -E rm -f
51+
52+
# Escaping for special characters.
53+
EQUALS = =
54+
55+
# The top-level source directory on which CMake was run.
56+
CMAKE_SOURCE_DIR = /home/yyz/cmake_tutorial/tutorial/Step1
57+
58+
# The top-level build directory on which CMake was run.
59+
CMAKE_BINARY_DIR = /home/yyz/cmake_tutorial/tutorial/Step1/build
60+
61+
# Include any dependencies generated for this target.
62+
include CMakeFiles/MathFunction.dir/depend.make
63+
# Include any dependencies generated by the compiler for this target.
64+
include CMakeFiles/MathFunction.dir/compiler_depend.make
65+
66+
# Include the progress variables for this target.
67+
include CMakeFiles/MathFunction.dir/progress.make
68+
69+
# Include the compile flags for this target's objects.
70+
include CMakeFiles/MathFunction.dir/flags.make
71+
72+
CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.o: CMakeFiles/MathFunction.dir/flags.make
73+
CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.o: ../MathFunctions/MathFunctions.cxx
74+
CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.o: CMakeFiles/MathFunction.dir/compiler_depend.ts
75+
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/yyz/cmake_tutorial/tutorial/Step1/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.o"
76+
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.o -MF CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.o.d -o CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.o -c /home/yyz/cmake_tutorial/tutorial/Step1/MathFunctions/MathFunctions.cxx
77+
78+
CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.i: cmake_force
79+
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.i"
80+
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/yyz/cmake_tutorial/tutorial/Step1/MathFunctions/MathFunctions.cxx > CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.i
81+
82+
CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.s: cmake_force
83+
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.s"
84+
/usr/bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/yyz/cmake_tutorial/tutorial/Step1/MathFunctions/MathFunctions.cxx -o CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.s
85+
86+
# Object files for target MathFunction
87+
MathFunction_OBJECTS = \
88+
"CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.o"
89+
90+
# External object files for target MathFunction
91+
MathFunction_EXTERNAL_OBJECTS =
92+
93+
libMathFunction.a: CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.o
94+
libMathFunction.a: CMakeFiles/MathFunction.dir/build.make
95+
libMathFunction.a: CMakeFiles/MathFunction.dir/link.txt
96+
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/yyz/cmake_tutorial/tutorial/Step1/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX static library libMathFunction.a"
97+
$(CMAKE_COMMAND) -P CMakeFiles/MathFunction.dir/cmake_clean_target.cmake
98+
$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/MathFunction.dir/link.txt --verbose=$(VERBOSE)
99+
100+
# Rule to build all files generated by this target.
101+
CMakeFiles/MathFunction.dir/build: libMathFunction.a
102+
.PHONY : CMakeFiles/MathFunction.dir/build
103+
104+
CMakeFiles/MathFunction.dir/clean:
105+
$(CMAKE_COMMAND) -P CMakeFiles/MathFunction.dir/cmake_clean.cmake
106+
.PHONY : CMakeFiles/MathFunction.dir/clean
107+
108+
CMakeFiles/MathFunction.dir/depend:
109+
cd /home/yyz/cmake_tutorial/tutorial/Step1/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/yyz/cmake_tutorial/tutorial/Step1 /home/yyz/cmake_tutorial/tutorial/Step1 /home/yyz/cmake_tutorial/tutorial/Step1/build /home/yyz/cmake_tutorial/tutorial/Step1/build /home/yyz/cmake_tutorial/tutorial/Step1/build/CMakeFiles/MathFunction.dir/DependInfo.cmake --color=$(COLOR)
110+
.PHONY : CMakeFiles/MathFunction.dir/depend
111+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
file(REMOVE_RECURSE
2+
"CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.o"
3+
"CMakeFiles/MathFunction.dir/MathFunctions/MathFunctions.cxx.o.d"
4+
"libMathFunction.a"
5+
"libMathFunction.pdb"
6+
)
7+
8+
# Per-language clean rules from dependency scanning.
9+
foreach(lang CXX)
10+
include(CMakeFiles/MathFunction.dir/cmake_clean_${lang}.cmake OPTIONAL)
11+
endforeach()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
file(REMOVE_RECURSE
2+
"libMathFunction.a"
3+
)

0 commit comments

Comments
 (0)