Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
szawrowski committed Jul 31, 2024
0 parents commit a8b88b6
Show file tree
Hide file tree
Showing 6 changed files with 792 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Set line ending conversion for all text files
* text=auto eol=lf

# Prevent conversion for .cmd files
*.cmd text eol=crlf
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Build output directories
/bin
/build
/cmake-build-debug
/cmake-build-release
/out
/target

# Personal IDE config files
.idea
.vs
.vscode
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@echo off

setlocal enabledelayedexpansion

@REM Check if an argument is provided and validate it
if "%~1"=="" (
@REM If no arguments are provided, set build type to Debug
set "build_type=Debug"
set "install=false"
) else (
@REM Convert the argument to lowercase
set "build_type=%~1"
set "build_type=!build_type:~0,1!!build_type:~1!"

@REM Check if the provided argument is either Release or Debug
if /I "!build_type!"=="release" (
set "build_type=Release"
) else if /I "!build_type!"=="debug" (
set "build_type=Debug"
) else if /I "!build_type!"=="install" (
set "install=true"
) else (
echo Error: Invalid build type '%~1'.
echo Please specify either 'Release' or 'Debug'.
exit /b 1
)
)

@REM Set build directory
set "build_dir=build\%build_type%"

if /I "!install!"=="true" (
@REM Build type message
echo Installation...

cmake -S . -B %build_dir% -DLIB_INSTALL=ON
cmake --install %build_dir%
) else (
@REM Build type message
echo Build type: %build_type%

@REM Run cmake with the appropriate build type
cmake -S . -B %build_dir% -G "Ninja" -DCMAKE_BUILD_TYPE=%build_type% -DDEVELOPMENT=ON

@REM Build the targets
cmake --build %build_dir% --parallel 16
)

endlocal
44 changes: 44 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash

# Check if an argument is provided and validate it
if [[ "$#" -eq 1 ]]; then
# Convert the argument to lowercase
build_type=$(echo "$1" | tr '[:upper:]' '[:lower:]')

# Check if the provided argument is either Release or Debug
if [ $build_type == "release" ]; then
build_type="Release"
elif [ $build_type == "debug" ]; then
build_type="Debug"
elif [ $build_type == "install" ]; then
install="true"
else
echo "Error: Invalid build type '$build_type'."
echo "Please specify either 'Release' or 'Debug'."
exit 1
fi
elif [ "$#" -eq 0 ]; then
# If no arguments are provided, set build type to Debug
build_type="Debug"
install="false"
fi

# Set build directory
build_dir="build/$build_type/"

if [ $install == "true" ]; then
# Build type message
echo "Installation..."

cmake -S . -B $build_dir -DLIB_INSTALL=ON
cmake --install $build_dir
else
# Build type message
echo "Build type: $build_type"

# Run cmake with the appropriate build type
cmake -S . -B $build_dir -G "Ninja" -DCMAKE_BUILD_TYPE=$build_type -DDEVELOPMENT=ON

# Build the targets
cmake --build $build_dir --parallel 16
fi
8 changes: 8 additions & 0 deletions cmake/CaitlynTestConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@PACKAGE_INIT@

set(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../..")

set_and_check(PACKAGE_INCLUDE_INSTALL_DIR "${PACKAGE_PREFIX_DIR}/include")
set_and_check(PACKAGE_CMAKE_INSTALL_DIR "${PACKAGE_PREFIX_DIR}/lib/cmake/caitlyn-test")

include("${PACKAGE_CMAKE_INSTALL_DIR}/CaitlynTestTargets.cmake")

0 comments on commit a8b88b6

Please sign in to comment.