update CMakeLists.txt

master
fengqiangguo 2023-08-08 22:10:55 +08:00
parent 56aba5ed1c
commit 00c235a128
5 changed files with 22 additions and 11 deletions

View File

@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
project(SimpleFactory) project(SimpleFactory)
set(SRC_LIST main.cpp) set(SRC_LIST main.cpp)
add_executable(app1 ${SRC_LIST}) get_filename_component(FOLDER_NAME ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
set(EXECUTABLE_OUTPUT_PATH ${OUTPUT_PATH}/bin/) get_filename_component(FOLDER_NAME ${FOLDER_NAME} NAME)
set(EXECUTABLE_OUTPUT_PATH ${OUTPUT_DIR}/${FOLDER_NAME}/)
add_executable(app1 ${SRC_LIST})

View File

@ -1,4 +1,8 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
project(FactoryMethod) project(FactoryMethod)
add_executable(app2 main.cpp)
set(EXECUTABLE_OUTPUT_PATH ${OUTPUT_PATH}/bin/)
get_filename_component(FOLDER_NAME ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
get_filename_component(FOLDER_NAME ${FOLDER_NAME} NAME)
set(EXECUTABLE_OUTPUT_PATH ${OUTPUT_DIR}/${FOLDER_NAME}/)
add_executable(app2 main.cpp)

View File

@ -7,8 +7,9 @@ project(AbstractFatory)
set(SRC_LIST main.cpp) set(SRC_LIST main.cpp)
add_executable(app ${SRC_LIST}) add_executable(app3 ${SRC_LIST})
# makefile # makefile
set(WORK_DIR ../) get_filename_component(FOLDER_NAME ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
set(EXECUTABLE_OUTPUT_PATH ${WORK_DIR}) get_filename_component(FOLDER_NAME ${FOLDER_NAME} NAME)
set(EXECUTABLE_OUTPUT_PATH ${OUTPUT_DIR}/${FOLDER_NAME})

View File

@ -1,12 +1,13 @@
cmake_minimum_required(VERSION 3.15) cmake_minimum_required(VERSION 3.15)
project(Iterator) project(Iterator)
set(WORK_DIR ../) get_filename_component(FOLDER_NAME ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
set(EXECUTABLE_OUTPUT_PATH ${WORK_DIR}/bin) get_filename_component(FOLDER_NAME ${FOLDER_NAME} NAME)
set(EXECUTABLE_OUTPUT_PATH ${OUTPUT_DIR}/${FOLDER_NAME})
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
# cppSRC_LIST # cppSRC_LIST
# CMAKE_CURRENT_SOURCE_DIRCMakeLists.txt # CMAKE_CURRENT_SOURCE_DIRCMakeLists.txt
file(GLOB SRC_LIST ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) file(GLOB SRC_LIST ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
add_executable(app ${SRC_LIST}) add_executable(app17 ${SRC_LIST})

View File

@ -1,7 +1,10 @@
cmake_minimum_required(VERSION 3.15) cmake_minimum_required(VERSION 3.15)
project(cplusplus_design_pattern) project(cplusplus_design_pattern)
set(OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) set(OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bin/)
message(STATUS "output dir : ${OUTPUT_DIR}")
add_subdirectory(01.SimpleFactory/2.Code/) add_subdirectory(01.SimpleFactory/2.Code/)
add_subdirectory(02.FactoryMethod/2.Code/) add_subdirectory(02.FactoryMethod/2.Code/)
add_subdirectory(03.AbstractFactory/2.Code/)
add_subdirectory(17.IteratorPattern/2.Code/)