Skip to content

Commit

Permalink
Moving algorithm and io proc implementations to separate directory
Browse files Browse the repository at this point in the history
  • Loading branch information
grf14003 committed Feb 11, 2020
1 parent e62001b commit 6a9e7bd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions breadcrumbs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cmake_minimum_required (VERSION 2.6)

message("Starting CMAKE")
project (Breadcrumbs)
string(TOLOWER ${PROJECT_NAME} ROOT_FOLDER_DIRNAME)
# The version number.
set (Bfs_VERSION_MAJOR 1)
set (Bfs_VERSION_MINOR 0)
Expand All @@ -18,12 +19,21 @@ set(CMAKE_BINARY_DIR ${PROJECT_SOURCE_DIR}/build) # Object files and such (.o)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) # Compiled executables for execution and test (.exe)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) # Compiled libraries (.lib and .dll)
set(CMAKE_INCLUDE_PATH ${PROJECT_SOURCE_DIR}/include) # Publicly accessible header files
set(IMPL_ALGO_PATH ${PROJECT_SOURCE_DIR}/${ROOT_FOLDER_DIRNAME}/algos) # BFS Implemenation algo source file path
set(IMPL_IO_PROCS_PATH ${PROJECT_SOURCE_DIR}/${ROOT_FOLDER_DIRNAME}/io_procs)
set(IMPL_INCLUDE_PATH ${PROJECT_SOURCE_DIR}/${ROOT_FOLDER_DIRNAME}/include)

message("Root directory: ${PROJECT_SOURCE_DIR}")
message("Source directory: ${CMAKE_SOURCE_DIR}")
message("Build directory: ${CMAKE_BINARY_DIR}")
message("Executable directory: ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
message("Library directory: ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
message("Header file directory: ${INCLUSDES_DIRECTORY}")
message("")

message("Implementation algo directory: ${IMPL_ALGO_PATH}")
message("Implementation io_procs directory: ${IMPL_IO_PROCS_PATH}")
message("Implementation include directory: ${IMPL_INCLUDE_PATH}")
message("")

# Including all tools
file(GLOB TOOL_INCLUDES CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/tools/*")
Expand All @@ -33,7 +43,6 @@ foreach(X IN LISTS TOOL_INCLUDES)
add_subdirectory(${X})
endforeach()


# Configure a header file to pass some of the CMake settings to the source code
set (Bfs_ALGORITHM_SERVER_PORT \"27634\")

Expand All @@ -47,22 +56,29 @@ include_directories("${CMAKE_INCLUDE_PATH}")
# Adding private include files from source tree
include_directories("${CMAKE_SOURCE_DIR}")

# Adding implementation include
include_directories("${IMPL_INCLUDE_PATH}")

# puts all .cpp files inside src to the SOURCES variable
# TODO: replace this with a script for collecting cpp files
file(GLOB_RECURSE ALGOS CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/algos/*.cpp")
file(GLOB_RECURSE IO_PROCS CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/io_procs/*.cpp")
file(GLOB_RECURSE COMMS CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/comms/*.cpp")
file(GLOB_RECURSE CONFIG CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/config/*.cpp")
file(GLOB_RECURSE LOG CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/logging/*.cpp")
file(GLOB_RECURSE LOGGING CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/logging/*.cpp")

# Temp
file(GLOB EXECS CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/main/*.cpp")

# Compiling BFS implementation source files
file(GLOB_RECURSE IMPL_SRC CONFIGURE_DEPENDS "${ROOT_FOLDER_DIRNAME}/*.cpp")

# Adding executables
# This is fine for now, but we may want to switch to a more manual versio so we can
# configure which files are included in which exe's
foreach(X IN LISTS EXECS)
get_filename_component(N ${X} NAME_WE)
message(STATUS "Generating Executable: ${N}.exe Main File: ${X}"})
add_executable(${N} ${X} ${ALGOS} ${IO_PROCS} ${COMMS} ${CONFIG} ${LOG})
add_executable(${N} ${IMPL_SRC} ${X} ${ALGOS} ${IO_PROCS} ${COMMS} ${CONFIG} ${LOGGING})
target_link_libraries(${N} tinyxml2)
endforeach()
File renamed without changes.
File renamed without changes.

0 comments on commit 6a9e7bd

Please sign in to comment.