ZRColaWS: Integrate Oat++ building
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
ad57071515
commit
450c18198a
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -16,3 +16,9 @@
|
|||||||
[submodule "Updater"]
|
[submodule "Updater"]
|
||||||
path = Updater
|
path = Updater
|
||||||
url = https://github.com/Amebis/Updater.git
|
url = https://github.com/Amebis/Updater.git
|
||||||
|
[submodule "lib/oatpp"]
|
||||||
|
path = lib/oatpp
|
||||||
|
url = https://github.com/oatpp/oatpp.git
|
||||||
|
[submodule "lib/oatpp-swagger"]
|
||||||
|
path = lib/oatpp-swagger
|
||||||
|
url = https://github.com/oatpp/oatpp-swagger.git
|
||||||
|
@ -60,11 +60,7 @@ The `/ls` flag can be appended to the commands above to reduce NMAKE's verbosity
|
|||||||
|
|
||||||
### Building Environment Requirements
|
### Building Environment Requirements
|
||||||
- Linux
|
- Linux
|
||||||
- _gcc_, _make_
|
- _gcc_, _gcc-c++_, _make_, _cmake_, _libatomic_
|
||||||
- [Oat++ 1.3.0](https://oatpp.io/)
|
|
||||||
|
|
||||||
### Oat++
|
|
||||||
ZRCola webservice is using Oat++ library. You have to compile the oatpp and oatpp-swagger libraries and install them to `/usr/local`.
|
|
||||||
|
|
||||||
### Building
|
### Building
|
||||||
Use `make -C ZRColaWS all` to build the project.
|
Use `make -C ZRColaWS all` to build the project.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
CPPFLAGS := $(CPPFLAGS) -I../lib/libZRCola/include -I../lib/stdex/include -I/usr/local/include/oatpp-1.3.0/oatpp -I/usr/local/include/oatpp-1.3.0/oatpp-swagger
|
CPPFLAGS := $(CPPFLAGS) -I../lib/libZRCola/include -I../lib/stdex/include -I../lib/oatpp-swagger/src -I../lib/oatpp/src
|
||||||
LDFLAGS := $(LDFLAGS) -L../lib/libZRCola/lib -L/usr/local/lib64/oatpp-1.3.0
|
LDFLAGS := $(LDFLAGS) -L../lib/libZRCola/lib -L../lib/oatpp-swagger/build/src -L../lib/oatpp/build/src
|
||||||
LDLIBS := $(LDLIBS) -lZRCola -loatpp-swagger -loatpp -lstdc++
|
LDLIBS := $(LDLIBS) -lZRCola -loatpp-swagger -loatpp -lstdc++
|
||||||
SRCS := zrcolaws.cpp
|
SRCS := zrcolaws.cpp
|
||||||
|
|
||||||
@ -8,9 +8,25 @@ include ../include/props.mak
|
|||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: zrcolaws
|
all: zrcolaws
|
||||||
|
|
||||||
zrcolaws: ../lib/libZRCola/lib/libZRCola.a $(OBJS)
|
zrcolaws: \
|
||||||
|
../lib/oatpp/build/src/liboatpp.a \
|
||||||
|
../lib/oatpp-swagger/build/src/liboatpp-swagger.a \
|
||||||
|
../lib/libZRCola/lib/libZRCola.a \
|
||||||
|
$(OBJS)
|
||||||
$(CC) $(LDFLAGS) $(OBJS) -o $@ $(LDLIBS)
|
$(CC) $(LDFLAGS) $(OBJS) -o $@ $(LDLIBS)
|
||||||
|
|
||||||
|
../lib/oatpp/build/src/liboatpp.a: ../lib/oatpp/build/Makefile
|
||||||
|
$(MAKE) $(MFLAGS) -C ../lib/oatpp/build
|
||||||
|
|
||||||
|
../lib/oatpp/build/Makefile: ../lib/oatpp/CMakeLists.txt
|
||||||
|
cmake -D OATPP_INSTALL=OFF -D OATPP_BUILD_TESTS=OFF -D OATPP_LINK_TEST_LIBRARY=OFF -S ../lib/oatpp -B ../lib/oatpp/build
|
||||||
|
|
||||||
|
../lib/oatpp-swagger/build/src/liboatpp-swagger.a: ../lib/oatpp-swagger/build/Makefile
|
||||||
|
$(MAKE) $(MFLAGS) -C ../lib/oatpp-swagger/build
|
||||||
|
|
||||||
|
../lib/oatpp-swagger/build/Makefile: ../lib/oatpp-swagger/CMakeLists.txt
|
||||||
|
cmake -D OATPP_INSTALL=OFF -D OATPP_BUILD_TESTS=OFF -D OATPP_MODULES_LOCATION=CUSTOM -D OATPP_DIR_SRC=${CURDIR}/../lib/oatpp/src -D OATPP_DIR_LIB=${CURDIR}/../lib/oatpp/build/src -S ../lib/oatpp-swagger -B ../lib/oatpp-swagger/build
|
||||||
|
|
||||||
../lib/libZRCola/lib/libZRCola.a:
|
../lib/libZRCola/lib/libZRCola.a:
|
||||||
$(MAKE) $(MFLAGS) -C ../lib/libZRCola/build
|
$(MAKE) $(MFLAGS) -C ../lib/libZRCola/build
|
||||||
|
|
||||||
@ -20,6 +36,23 @@ install: zrcolaws ../output/data/ZRCola.zrcdb
|
|||||||
install -m 755 zrcolaws $(PREFIX)/bin/
|
install -m 755 zrcolaws $(PREFIX)/bin/
|
||||||
install -d $(PREFIX)/share/zrcola/
|
install -d $(PREFIX)/share/zrcola/
|
||||||
install -m 644 ../output/data/ZRCola.zrcdb $(PREFIX)/share/zrcola/
|
install -m 644 ../output/data/ZRCola.zrcdb $(PREFIX)/share/zrcola/
|
||||||
|
install -d $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/favicon-16x16.png $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/favicon-32x32.png $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/index.html $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/oauth2-redirect.html $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-bundle.js $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-bundle.js.map $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-es-bundle-core.js $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-es-bundle-core.js.map $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-es-bundle.js $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-es-bundle.js.map $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-standalone-preset.js $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/swagger-ui-standalone-preset.js.map $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/swagger-ui.css $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/swagger-ui.css.map $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/swagger-ui.js $(PREFIX)/share/zrcola/res/
|
||||||
|
install -m 644 ../lib/oatpp-swagger/res/swagger-ui.js.map $(PREFIX)/share/zrcola/res/
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
@ -64,6 +64,6 @@ public:
|
|||||||
}());
|
}());
|
||||||
|
|
||||||
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::swagger::Resources>, swaggerResources)([] {
|
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::swagger::Resources>, swaggerResources)([] {
|
||||||
return oatpp::swagger::Resources::loadResources(PREFIX "/include/oatpp-1.3.0/bin/oatpp-swagger/res");
|
return oatpp::swagger::Resources::loadResources(PREFIX "/share/zrcola/res");
|
||||||
}());
|
}());
|
||||||
};
|
};
|
||||||
|
1
lib/oatpp
Submodule
1
lib/oatpp
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit bbe455af60b8f292ed90f84bd02cac1b98c2e232
|
1
lib/oatpp-swagger
Submodule
1
lib/oatpp-swagger
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit ed5251c580e2e98beb50d818bcea8ddc91419d8c
|
Loading…
x
Reference in New Issue
Block a user