feat: add oatpp as dependency
- Add oatpp, oatpp-swagger as deps in CMakeLists - Add module auto-installer
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
!/include
|
||||
!/src
|
||||
!/tests
|
||||
!/utils
|
||||
|
||||
# Include files
|
||||
!/.gitignore
|
||||
|
||||
@@ -4,6 +4,8 @@ project(magic_scrolls)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
find_package(SQLite3 REQUIRED)
|
||||
find_package(oatpp 1.4.0 REQUIRED)
|
||||
find_package(oatpp-swagger 1.4.0 REQUIRED)
|
||||
|
||||
file(GLOB_RECURSE sources
|
||||
"${CMAKE_SOURCE_DIR}/src/*.cpp")
|
||||
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
BUILD_TYPE=$1
|
||||
|
||||
if [ -z "$BUILD_TYPE" ]; then
|
||||
BUILD_TYPE="Debug"
|
||||
fi
|
||||
|
||||
rm -rf tmp
|
||||
mkdir tmp
|
||||
cd tmp
|
||||
|
||||
function install_module () {
|
||||
|
||||
BUILD_TYPE=$1
|
||||
MODULE_NAME=$2
|
||||
NPROC=$(nproc)
|
||||
|
||||
if [ -z "$NPROC" ]; then
|
||||
NPROC = 1
|
||||
fi
|
||||
|
||||
echo "-> [ ] Installing '$MODULE_NAME' ($BUILD_TYPE)..."
|
||||
|
||||
git clone --depth=1 https://github.com/oatpp/$MODULE_NAME
|
||||
|
||||
cd $MODULE_NAME
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOATPP_BUILD_TESTS=OFF -DOATPP_SQLITE_AMALGAMATION=ON ..
|
||||
make install -j $NPROC
|
||||
|
||||
cd ../..
|
||||
|
||||
echo "-> [x] Module '$MODULE_NAME' installed!"
|
||||
|
||||
}
|
||||
|
||||
install_module $BUILD_TYPE oatpp
|
||||
install_module $BUILD_TYPE oatpp-swagger
|
||||
|
||||
cd ..
|
||||
rm -rf tmp
|
||||
Reference in New Issue
Block a user