Better README and new build number system
This commit is contained in:
parent
49c0ea4e3b
commit
35b9466060
9 changed files with 69 additions and 27 deletions
|
|
@ -15,7 +15,7 @@ cmake_minimum_required(VERSION 3.18)
|
|||
project(${PROJ_NAME} LANGUAGES C CXX)
|
||||
set(CMAKE_BUILD_TYPE Debug)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
file(STRINGS "./tools/build.nr" BUILD_NUMBER)
|
||||
file(STRINGS "./build.nr" BUILD_NUMBER)
|
||||
#-----------------------------------------------------------------------------------------
|
||||
|
||||
message("** Building ${PROJ_NAME} ${MAJOR_VER}.${MINOR_VER}.${BUILD_NUMBER}")
|
||||
|
|
@ -66,28 +66,6 @@ if (UNIX)
|
|||
endif (UNIX)
|
||||
#-----------------------------------------------------------------------------------------
|
||||
|
||||
#BuildNumber Target
|
||||
#-----------------------------------------------------------------------------------------
|
||||
if (WIN32)
|
||||
add_custom_command ( OUTPUT ./tools/build.nr
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools/inc_bnr.exe
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tools/
|
||||
)
|
||||
endif (WIN32)
|
||||
if (UNIX)
|
||||
add_custom_command ( OUTPUT ./tools/build.nr
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools/inc_bnr
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tools/
|
||||
)
|
||||
endif (UNIX)
|
||||
|
||||
add_custom_target(
|
||||
IncBnr ALL
|
||||
DEPENDS ./tools/build.nr
|
||||
)
|
||||
#-----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#Finalize
|
||||
#-----------------------------------------------------------------------------------------
|
||||
add_custom_command(TARGET ${OMNIA_STD_LIB} POST_BUILD
|
||||
|
|
|
|||
35
README.md
35
README.md
|
|
@ -1,7 +1,10 @@
|
|||
|
||||
# OmniaFramework
|
||||
|
||||
Compile instructions on Windows
|
||||
A collection of C++ classes and tools that I have created over the years
|
||||
|
||||
|
||||
## Build instructions - Windows
|
||||
**Step 1:**
|
||||
download MSYS2 from https://www.msys2.org/ and install it
|
||||
|
||||
|
|
@ -9,7 +12,7 @@ download MSYS2 from https://www.msys2.org/ and install it
|
|||
run MSYS2, and in the terminal run:
|
||||
```
|
||||
pacman -Syuu
|
||||
pacman -S --needed base-devel mingw-w64-ucrt-x86_64-clang mingw-w64-ucrt-x86_64-gdb mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-sfml mingw-w64-ucrt-x86_64-make mingw-w64-ucrt-x86_64-boost
|
||||
pacman -S --needed base-devel mingw-w64-ucrt-x86_64-clang mingw-w64-ucrt-x86_64-gdb mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-make mingw-w64-ucrt-x86_64-boost
|
||||
```
|
||||
|
||||
**Step 3:**
|
||||
|
|
@ -20,3 +23,31 @@ execute this command:
|
|||
```
|
||||
./compile
|
||||
```
|
||||
## Build instructions - Linux (Arch)
|
||||
**Step 1:**
|
||||
open a terminal and run:
|
||||
```
|
||||
sudo pacman -Syuu
|
||||
sudo pacman -S --needed base-devel clang gdb cmake make boost
|
||||
```
|
||||
|
||||
**Step 2:**
|
||||
open a terminal inside the root directory of the project and run this command:
|
||||
```
|
||||
./compile
|
||||
```
|
||||
## Build instructions - Linux (Ubuntu)
|
||||
**Step 1:**
|
||||
open a terminal and run:
|
||||
```
|
||||
sudo apt update && sudo apt upgrade
|
||||
sudo apt install clang gdb make cmake libboost-all-dev
|
||||
```
|
||||
|
||||
**Step 2:**
|
||||
open a terminal inside the root directory of the project and run this command:
|
||||
```
|
||||
./compile
|
||||
```
|
||||
|
||||
#### For other Linux distros, install the dependencies using your package manager.
|
||||
1
build.nr
Normal file
1
build.nr
Normal file
|
|
@ -0,0 +1 @@
|
|||
1796
|
||||
34
compile
34
compile
|
|
@ -7,9 +7,43 @@ if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
|||
cd bin
|
||||
make
|
||||
cd ..
|
||||
if [ $? -eq 0 ]; then
|
||||
mkdir -p ./Release/lib
|
||||
|
||||
cp ./bin/libostd.so ./Release/lib
|
||||
|
||||
mkdir -p ./Release/include/ostd/vendor
|
||||
find ./src/ostd -maxdepth 1 -name "*.hpp" -exec cp {} ./Release/include/ostd \;
|
||||
find ./src/ostd/vendor -maxdepth 1 -name "*.hpp" -exec cp {} ./Release/include/ostd/vendor \;
|
||||
cp -r ./licences ./Release
|
||||
|
||||
typeset -i build_number=$(cat build.nr)
|
||||
((build_number++))
|
||||
truncate -s 0 build.nr
|
||||
echo $build_number >> build.nr
|
||||
fi
|
||||
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
|
||||
cmake -B bin -S ./ -G "MinGW Makefiles"
|
||||
cd bin
|
||||
mingw32-make.exe
|
||||
cd ..
|
||||
if [ $? -eq 0 ]; then
|
||||
mkdir -p ./Release/lib
|
||||
|
||||
cp ./bin/libostd.dll ./Release/lib
|
||||
|
||||
cp C:/msys64/ucrt64/bin/libgcc_s_seh-1.dll ./Release/lib
|
||||
cp C:/msys64/ucrt64/bin/libstdc++-6.dll ./Release/lib
|
||||
cp C:/msys64/ucrt64/bin/libwinpthread-1.dll ./Release/lib
|
||||
|
||||
mkdir -p ./Release/include/ostd/vendor
|
||||
find ./src/ostd -maxdepth 1 -name "*.hpp" -exec cp {} ./Release/include/ostd \;
|
||||
find ./src/ostd/vendor -maxdepth 1 -name "*.hpp" -exec cp {} ./Release/include/ostd/vendor \;
|
||||
cp -r ./licences ./Release
|
||||
|
||||
typeset -i build_number=$(cat build.nr)
|
||||
((build_number++))
|
||||
truncate -s 0 build.nr
|
||||
echo $build_number >> build.nr
|
||||
fi
|
||||
fi
|
||||
|
|
@ -31,7 +31,6 @@ namespace ostd
|
|||
inline bool compareByOID(const BaseObject& other) const { return m_oid == other.m_oid; }
|
||||
|
||||
inline static BaseObject& InvalidRef(void) { return BaseObject::s_invalid_obj; }
|
||||
// inline static BaseObject InvalidInst(void) { return BaseObject::s_invalid_obj; }
|
||||
|
||||
inline void setTypeName(const StringEditor& tn) { m_typeName = tn.str(); }
|
||||
inline String getTypeName(void) const { return m_typeName; }
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +0,0 @@
|
|||
1789
|
||||
BIN
tools/inc_bnr
BIN
tools/inc_bnr
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue