Skip to content

Commit

Permalink
What I did
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaelan Hansson - Desktop committed Aug 24, 2022
1 parent b124e25 commit 90813af
Show file tree
Hide file tree
Showing 22 changed files with 291 additions and 92 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
project(Class1)


include(GNUInstallDirs)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})



add_subdirectory(src)
add_subdirectory(src2)
add_subdirectory(src3)
add_subdirectory(src4)
18 changes: 18 additions & 0 deletions Plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@





1. Compiling and Linking
2. Creating Varaibles and Arrays, C++ symbology
3. structs, functions, and classes
4. Templates
5. Control Flow (loops etc)
6. ???







92 changes: 0 additions & 92 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_executable( TheExecutable main.cpp)
14 changes: 14 additions & 0 deletions src/Compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

mkdir ../build
mkdir ../build/bin


#Don't Use These, These are for intermediate steps
clang++ -E main.cpp > main.ipp
clang++ -S main.cpp

#These are the usual routines for compiling
clang++ -c main.cpp
clang++ -o TheExecutable main.o

57 changes: 57 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Integrated Makefile for the MONACO software system.
# Uses file "Makefile.arch" for system specific declarations
#
# Last modified April 28, 2004

SHELL = /bin/sh

# Necessary directories
# MONACOHOME should be an environment variable indicating the top
# of the monaco distribution tree.
BASEDIR=$(PWD)

BINDIR = $(BASEDIR)/../buid/bin
SRCDIR = $(BASEDIR)

CC=clang
CXX=clang++



PROGNAME = TheExecutable



# Targets...

default : TheExecutable

TARGETS = main.cpp
OBJS = $(TARGETS:.cpp=.o)
# Make the monaco executable and all utilities
#all : monaco oxford util

#-lboost;

%.o: %.cpp
$(CXX) -c -o $@ $<


TheExecutable : $(OBJS)
$(CXX) -o $(PROGNAME) $(OBJS) -lm;
rm $(SRCDIR)/*.o


# Cleanup options

# Remove object files from directories related to monaco executable
clean :



# Remove all object files, libraries and executables from entire directory tree
# Basically resets to the original monaco distribution state
distclean : clean
cd $(BINDIR); /bin/rm -f *

# DO NOT DELETE
13 changes: 13 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

#include <iostream>



int main()
{

int TestNumber = 98765432;

std::cout << "Hello, Oh Cruel World\n";
std::cout << "The Number is: " << TestNumber << std::endl;
}
4 changes: 4 additions & 0 deletions src2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
add_executable( TheSecondExecutable main.cpp testfunction.cpp)

target_include_directories(TheSecondExecutable INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}> )
13 changes: 13 additions & 0 deletions src2/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

#include <iostream>
#include "testfunction.hpp"


int main()
{

double TestNumber = 98.765432;

std::cout << "Hello, Oh Cruel World\n";
std::cout << "The Number is: " << TestFunction(TestNumber) << std::endl;
}
10 changes: 10 additions & 0 deletions src2/testfunction.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@



#include "testfunction.hpp"


double TestFunction(double a)
{
return a * a;
}
8 changes: 8 additions & 0 deletions src2/testfunction.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef MPIC_TESTFUNCTION
#define MPIC_TESTFUNCTION


double TestFunction(double a);


#endif /* MPIC_TESTFUNCTION */
6 changes: 6 additions & 0 deletions src3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

add_subdirectory(library)

add_executable( TheThirdExecutable main.cpp )

target_link_libraries(TheThirdExecutable PUBLIC TheLibrary)
4 changes: 4 additions & 0 deletions src3/library/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
add_library( TheLibrary testfunction.cpp)

target_include_directories(TheLibrary INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}> )
10 changes: 10 additions & 0 deletions src3/library/testfunction.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@



#include "testfunction.hpp"


double TestFunction(double a)
{
return a * a;
}
12 changes: 12 additions & 0 deletions src3/library/testfunction.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#ifndef MPIC_TESTFUNCTION
#define MPIC_TESTFUNCTION



double TestFunction(double a);


#endif /* MPIC_TESTFUNCTION */



13 changes: 13 additions & 0 deletions src3/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

#include <iostream>
#include "testfunction.hpp"


int main()
{

double TestNumber = 98.765432;

std::cout << "Hello, Oh Cruel World\n";
std::cout << "The Number is: " << TestFunction(TestNumber) << std::endl;
}
30 changes: 30 additions & 0 deletions src4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

add_subdirectory(library)


find_package(nlohmann_json QUIET)
if(nlohmann_json_FOUND)
message("json is found at ${Eigen3_DIR}")
else()

include(FetchContent)

FetchContent_Declare(
json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG master
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE)

FetchContent_MakeAvailable(json)

endif()



add_custom_target( CopyFile ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_LIST_DIR}/input.json ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/input.json)


add_executable( TheFouthExecutable main.cpp )

target_link_libraries(TheFouthExecutable PUBLIC TheSecondLibrary nlohmann_json::nlohmann_json)
17 changes: 17 additions & 0 deletions src4/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"data": 1.234,
"Energy Exchange": [
{
"Method": "VHS",
"Species 1": "Xe",
"Species 2": "Xe"
},
{
"Angle Constant 1": -2.02,
"Angle Constant 2": 0.0045,
"Method": "YHCross",
"Species 1": "Xe",
"Species 2": "Xe+"
}
]
}
4 changes: 4 additions & 0 deletions src4/library/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
add_library( TheSecondLibrary testfunction.cpp)

target_include_directories(TheSecondLibrary INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}> )
10 changes: 10 additions & 0 deletions src4/library/testfunction.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@



#include "testfunction.hpp"


double TestFunction(double a)
{
return a * a;
}
10 changes: 10 additions & 0 deletions src4/library/testfunction.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef MPIC_TESTFUNCTION
#define MPIC_TESTFUNCTION


double TestFunction(double a);




#endif /* MPIC_TESTFUNCTION */
Loading

0 comments on commit 90813af

Please sign in to comment.