forked from edson-a-soares/gof_design_patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
27 lines (20 loc) · 1.28 KB
/
CMakeLists.txt
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
SET(MODULE_NAME "FactoryMethod")
SET(MODULE_DIRECTORY "FactoryMethod")
set(CMAKE_C_COMPILER /usr/bin/gcc)
set(CMAKE_CXX_COMPILER /usr/bin/g++)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# It defines the custom directory structure.
set(PROJECT_SOURCE_DIR ${CMAKE_HOME_DIRECTORY}/${MODULE_DIRECTORY}/src)
set(PROJECT_INCLUDE_DIR ${CMAKE_HOME_DIRECTORY}/${MODULE_DIRECTORY}/include)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/${MODULE_DIRECTORY}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/${MODULE_DIRECTORY}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/${MODULE_DIRECTORY}/bin)
file(GLOB FACTORY_METHOD_SOURCE_FILES_TOP "${PROJECT_SOURCE_DIR}/${MODULE_DIRECTORY}/*.cpp")
file(GLOB_RECURSE FACTORY_METHOD_SOURCE_FILES_NESTED ${PROJECT_SOURCE_DIR}/${MODULE_DIRECTORY}/*.cpp)
set(FACTORY_METHOD_SOURCE_FILES ${FACTORY_METHOD_SOURCE_FILES_TOP} ${FACTORY_METHOD_SOURCE_FILES_NESTED})
include_directories("${PROJECT_INCLUDE_DIR}")
include_directories("${PROJECT_SOURCE_DIR}")
add_library(${MODULE_NAME} SHARED ${FACTORY_METHOD_SOURCE_FILES})
target_include_directories(${MODULE_NAME} PUBLIC ${PROJECT_INCLUDE_DIR})
add_executable(FactoryMethodPattern ${PROJECT_SOURCE_DIR}/main.cpp)
target_link_libraries(FactoryMethodPattern ${MODULE_NAME})