update CMakeLists.txt
parent
56aba5ed1c
commit
00c235a128
|
@ -1,5 +1,7 @@
|
|||
cmake_minimum_required(VERSION 3.10)
|
||||
project(SimpleFactory)
|
||||
set(SRC_LIST main.cpp)
|
||||
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(app1 ${SRC_LIST})
|
||||
set(EXECUTABLE_OUTPUT_PATH ${OUTPUT_PATH}/bin/)
|
|
@ -1,4 +1,8 @@
|
|||
cmake_minimum_required(VERSION 3.10)
|
||||
project(FactoryMethod)
|
||||
|
||||
|
||||
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)
|
||||
set(EXECUTABLE_OUTPUT_PATH ${OUTPUT_PATH}/bin/)
|
|
@ -7,8 +7,9 @@ project(AbstractFatory)
|
|||
|
||||
|
||||
set(SRC_LIST main.cpp)
|
||||
add_executable(app ${SRC_LIST})
|
||||
add_executable(app3 ${SRC_LIST})
|
||||
|
||||
# 指定可执行文件的输出路径,相对路径是相对makefile文件位置的路径
|
||||
set(WORK_DIR ../)
|
||||
set(EXECUTABLE_OUTPUT_PATH ${WORK_DIR})
|
||||
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})
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
cmake_minimum_required(VERSION 3.15)
|
||||
project(Iterator)
|
||||
|
||||
set(WORK_DIR ../)
|
||||
set(EXECUTABLE_OUTPUT_PATH ${WORK_DIR}/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})
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
# 搜索指定路径下的cpp文件,组成一个列表,结果保存至SRC_LIST变量
|
||||
# CMAKE_CURRENT_SOURCE_DIR是CMakeLists.txt文件所在的路径
|
||||
file(GLOB SRC_LIST ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||
add_executable(app ${SRC_LIST})
|
||||
add_executable(app17 ${SRC_LIST})
|
|
@ -1,7 +1,10 @@
|
|||
cmake_minimum_required(VERSION 3.15)
|
||||
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(02.FactoryMethod/2.Code/)
|
||||
add_subdirectory(03.AbstractFactory/2.Code/)
|
||||
add_subdirectory(17.IteratorPattern/2.Code/)
|
||||
|
|
Loading…
Reference in New Issue