Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Folder simplification build structure (#6)
* Updating file structure and adding basic build config

* Updating file structure and adding basic build config
  • Loading branch information
grf14003 committed Oct 19, 2019
1 parent d1e63f2 commit 03d6f5e
Show file tree
Hide file tree
Showing 16 changed files with 77 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
@@ -1 +1,7 @@
.vs/*

# Excluding the build and executable folders
breadcrumbs/build/*
!breadcrumbs/build/.blank
breadcrumbs/bin/*
!breadcrumbs/bin/.blank
4 changes: 4 additions & 0 deletions breadcrumbs/CMakeConfig.h.in
@@ -0,0 +1,4 @@
// the configured options and settings for Tutorial

#define Tutorial_VERSION_MAJOR @Bfs_VERSION_MAJOR@
#define Tutorial_VERSION_MINOR @Bfs_VERSION_MINOR@
40 changes: 40 additions & 0 deletions breadcrumbs/CMakeLists.txt
@@ -0,0 +1,40 @@
# This file controls the build process. When you save it, VS figures out what types of executables that it builds.
# Then, you can switch the executable that you want to run at the top from the drop down and hit run to build and
# run it.
#

cmake_minimum_required (VERSION 2.6)

message("Starting CMAKE")
project (Breadcrumbs)
# The version number.
set (Bfs_VERSION_MAJOR 1)
set (Bfs_VERSION_MINOR 0)

# Setting paths
message("Setting paths...")
set(CMAKE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/src) # Code directory
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
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: ${INCLUDES_DIRECTORY}")

# Configure a header file to pass some of the CMake settings to the source code
configure_file (
"${PROJECT_SOURCE_DIR}/CMakeConfig.h.in"
"${CMAKE_INCLUDE_PATH}/CMakeConfig.h"
)

# Adding public includes to include search path
include_directories("${CMAKE_INCLUDE_PATH}")
# Adding private include files from source tree
include_directories("${CMAKE_SOURCE_DIR}")

# Adding executables
add_executable(Breadcrumbs ${CMAKE_SOURCE_DIR}/Breadcrumbs.cpp)
16 changes: 16 additions & 0 deletions breadcrumbs/CMakeSettings.json
@@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "basic_build",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\build\\${name}",
"installRoot": "${projectDir}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"variables": []
}
]
}
Empty file removed breadcrumbs/bfs/io_proc/.blank
Empty file.
Empty file removed breadcrumbs/bfs/lib/.blank
Empty file.
Empty file removed breadcrumbs/bfs/out_proc/.blank
Empty file.
Empty file removed breadcrumbs/bfs/scripts/.blank
Empty file.
File renamed without changes.
Empty file removed breadcrumbs/in_procs/.blank
Empty file.
4 changes: 4 additions & 0 deletions breadcrumbs/include/CMakeConfig.h
@@ -0,0 +1,4 @@
// the configured options and settings for Tutorial

#define Tutorial_VERSION_MAJOR 1
#define Tutorial_VERSION_MINOR 0
Empty file removed breadcrumbs/out_procs/.blank
Empty file.
7 changes: 7 additions & 0 deletions breadcrumbs/src/Breadcrumbs.cpp
@@ -0,0 +1,7 @@
#include <stdio.h>


int main() {
printf("Hello world!\n");
return 0;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 03d6f5e

Please sign in to comment.