-
Notifications
You must be signed in to change notification settings - Fork 10
/
CMakeLists.txt
27 lines (20 loc) · 1.2 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 "Mediator")
SET(MODULE_DIRECTORY "Mediator")
set(CMAKE_C_COMPILER /usr/bin/gcc)
set(CMAKE_CXX_COMPILER /usr/bin/g++)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# including source code
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 MEDIATOR_SOURCE_FILES_TOP "${PROJECT_SOURCE_DIR}/${MODULE_DIRECTORY}/*.cpp")
file(GLOB_RECURSE MEDIATOR_SOURCE_FILES_NESTED ${PROJECT_SOURCE_DIR}/${MODULE_DIRECTORY}/*.cpp)
set(MEDIATOR_SOURCE_FILES ${MEDIATOR_SOURCE_FILES_TOP} ${MEDIATOR_SOURCE_FILES_NESTED})
include_directories("${PROJECT_INCLUDE_DIR}")
include_directories("${PROJECT_SOURCE_DIR}")
add_library(${MODULE_NAME} SHARED ${MEDIATOR_SOURCE_FILES})
target_include_directories(${MODULE_NAME} PUBLIC ${PROJECT_INCLUDE_DIR})
add_executable(MediatorPattern ${PROJECT_SOURCE_DIR}/main.cpp)
target_link_libraries(MediatorPattern ${MODULE_NAME})