Skip to content

Commit

Permalink
☀️ add make target : package
Browse files Browse the repository at this point in the history
  • Loading branch information
coleflowers committed Sep 4, 2020
1 parent 4e86949 commit a38a08f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
13 changes: 6 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,15 @@ cmake_minimum_required(VERSION 2.8)

project("proto2json")

# CMake commands copied by the CMake file for CImg

# To use PKG_CHECK_MODULES to find some optional packages
find_package(PkgConfig)


# ### Search Additional Libraries ##########

SET(CMAKE_CXX_FLAGS "-std=c++11 -O3")

# #### End of additional libraries search ##########


### Configure Paths according to detected packages


if (NOT APPLE)
if(NOT WIN32)
Expand Down Expand Up @@ -176,6 +170,11 @@ install(PROGRAMS
build/proto2json
DESTINATION bin)

add_custom_target(package
COMMAND sh ../bin/package.sh
COMMENT "Now Generating tar.gz file..."
)

if(CMAKE_SYSTEM_NAME MATCHES "Linux")
add_custom_command(TARGET proto2json POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
Expand Down
5 changes: 5 additions & 0 deletions bin/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/bash
export protover=`cat ../src/version.h | grep PROTOJSON_VERSION`
ver=`echo $protover | awk '{print $3}' | sed "s/\"//g"`
tar -zcvf proto2json-$ver-macos-brew.tar.gz ../build/proto2json
openssl dgst -sha256 proto2json-$ver-macos-brew.tar.gz
2 changes: 1 addition & 1 deletion src/AVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ Json::Value AVisitor::parseParamBody(std::string parName) {
arr["$$ref"] = "#/definitions/" + fieldType;
arr["items"]["type"] = "object";
//arr["items"]["properties"] = objTmp["properties"];
arr["description"] = fieldType;// objTmp["title"];
arr["description"] = fieldType;
body["properties"][pName] = arr;
}
continue;
Expand Down

0 comments on commit a38a08f

Please sign in to comment.