Remove Makefile, add CMakeLists.txt.

master
fengqiangguo 2023-08-06 10:44:10 +08:00
parent b16f9f73f0
commit 4128c5a0fe
2 changed files with 4 additions and 29 deletions

View File

@ -0,0 +1,4 @@
cmake_minimum_required(VERSION 3.10)
project(SimpleFactory)
set(SRC_LIST main.cpp)
add_executable(app ${SRC_LIST})

View File

@ -1,29 +0,0 @@
DIR_INC = ./
DIR_SRC = ./
DIR_OBJ = ./obj
DIR_BIN = ./bin
SRC = $(wildcard ${DIR_SRC}/*.cpp)
OBJ = $(patsubst %.cpp,${DIR_OBJ}/%.o,$(notdir ${SRC}))
TARGET = main
BIN_TARGET = ${DIR_BIN}/${TARGET}
CC = g++
CFLAGS = -g -Wall -I${DIR_INC}
${BIN_TARGET}:${OBJ}
mkdir -p $(DIR_BIN)
$(CC) $(OBJ) -o $@
${DIR_OBJ}/%.o:${DIR_SRC}/%.cpp
mkdir -p $(DIR_OBJ)
$(CC) $(CFLAGS) -c $< -o $@
.PHONY:clean
clean:
rm -rf bin obj
rm -rf ./main