Skip to content

Commit

Permalink
- #183 Initial project skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
adamansky committed May 8, 2018
1 parent e1f9cea commit df9f7d1
Show file tree
Hide file tree
Showing 21 changed files with 382 additions and 49 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
@@ -1,9 +1,12 @@
[*]
charset=utf-8
end_of_line=lf
insert_final_newline=true
insert_final_newline=false
indent_style=space
indent_size=2

[Makefile]
indent_style = tab

[*.{c,cpp,cc,h,hpp}]
insert_final_newline=true
113 changes: 113 additions & 0 deletions .vscode/c_cpp_properties.json
@@ -0,0 +1,113 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
]
},
{
"name": "Linux",
"includePath": [
"/usr/include",
"/usr/include/linux",
"/usr/local/include",
"/usr/include/x86_64-linux-gnu",
"/usr/lib/gcc/x86_64-linux-gnu/7/include",
"/usr/lib/gcc/x86_64-linux-gnu/6/include",
"/usr/lib/gcc/x86_64-linux-gnu/5/include",
"/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed",
"/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed",
"/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"/usr/include/x86_64-linux-gnu/c++/7",
"/usr/include/x86_64-linux-gnu/c++/6",
"/usr/include/x86_64-linux-gnu/c++/5",
"/usr/include/c++/7",
"/usr/include/c++/6",
"/usr/include/c++/5",
"/usr/include/c++/7/backward",
"/usr/include/c++/6/backward",
"/usr/include/c++/5/backward",
"${workspaceRoot}",
"${workspaceRoot}/build/src/generated",
"${workspaceRoot}/src",
"${workspaceRoot}/src/jbj"
],
"defines": [
"_GNU_SOURCE",
"IW_64",
"JB_64"
],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/include/linux",
"/usr/local/include",
"/usr/include/x86_64-linux-gnu",
"/usr/lib/gcc/x86_64-linux-gnu/7/include",
"/usr/lib/gcc/x86_64-linux-gnu/6/include",
"/usr/lib/gcc/x86_64-linux-gnu/5/include",
"/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed",
"/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed",
"/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed",
"/usr/include/x86_64-linux-gnu/c++/7",
"/usr/include/x86_64-linux-gnu/c++/6",
"/usr/include/x86_64-linux-gnu/c++/5",
"/usr/include/c++/7",
"/usr/include/c++/6",
"/usr/include/c++/5",
"/usr/include/c++/7/backward",
"/usr/include/c++/6/backward",
"/usr/include/c++/5/backward",
"${workspaceRoot}",
"${workspaceRoot}/src"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17"
},
{
"name": "Win32",
"includePath": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include",
"${workspaceRoot}"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 4
}
101 changes: 101 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,101 @@
{
"files.insertFinalNewline": false,
"cmake.configureArgs": [
"-DBUILD_TESTS=ON",
"-DCMAKE_VERBOSE_MAKEFILE=OFF",
"-DBUILD_SHARED_LIBS=ON",
"-DBUILD_EXAMPLES=ON",
"-DBUILD_BENCHMARKS=OFF"
],
"cmake.ctestArgs": [],
"cmake.debugConfig": {
"cwd": "${workspaceRoot}/build/src/tests"
},
"C_Cpp.formatting": "Disabled",
"C_Cpp.autocomplete": "Disabled",
"C_Cpp.errorSquiggles": "Disabled",
"astyle.astylerc": "${workspaceRoot}/.astylerc",
"astyle.c.enable": true,
"astyle.cpp.enable": true,
"clang.completion.enable": true,
"clang.diagnostic.enable": true,
"clang.cflags": [
"-D_GNU_SOURCE",
"-D_LARGEFILE_SOURCE",
"-D_FILE_OFFSET_BITS=64",
"-DIW_64",
"-DJB_64",
"-std=gnu11",
"-Wc99-compat",
"-Wall",
"-Wcast-qual",
"-Wunused",
"-Wnonportable-system-include-path",
"-Wno-sign-compare",
"-Wno-unused-parameter",
"-Wno-unknown-pragmas",
"-Wno-unused-function",
"-Wno-missing-field-initializers",
"-Wno-missing-braces",
"-Wno-pragma-once-outside-header",
"-I${workspaceRoot}/build/src/generated",
"-I${workspaceRoot}/src",
"-I${workspaceRoot}/src/jbj"
],
"clang.cxxflags": [
"-D_GNU_SOURCE",
"-D_LARGEFILE_SOURCE",
"-D_FILE_OFFSET_BITS=64",
"-DIW_64",
"-DJB_64",
"-std=c++11",
"-Wall",
"-Wcast-qual",
"-Wunused",
"-Wnonportable-system-include-path",
"-Wno-sign-compare",
"-Wno-unused-parameter",
"-Wno-unknown-pragmas",
"-Wno-unused-function",
"-Wno-missing-field-initializers",
"-Wno-pragma-once-outside-header",
"-I${workspaceRoot}/build/src/generated",
"-I${workspaceRoot}/src",
"-I${workspaceRoot}/src/jbj"
],
"files.associations": {
"*.h": "c"
},
"python.pythonPath": "/usr/bin/python3",
"python.linting.pylintEnabled": false,
"python.linting.enabled": true,
"python.linting.pep8Enabled": false,
"python.linting.flake8Enabled": true,
"search.exclude": {
"**/build": true
},
"files.exclude": {
"**/.git": true,
"**/build": true,
"**/mxe": true
},
"cSpell.enabledLanguageIds": [
"asciidoc",
"html",
"markdown",
"plaintext",
"restructuredtext",
"text"
],
"cSpell.words": [
"IWKV"
],
"cSpell.enabled": false,
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true,
"**/mxe/**": true
}
}

22 changes: 1 addition & 21 deletions CMakeLists.txt
Expand Up @@ -64,26 +64,6 @@ if(UPLOAD_PPA)
set(ENABLE_PPA ON)
endif(UPLOAD_PPA)

# add a target to generate API documentation with Doxygen
find_package(Doxygen)
option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" OFF)

if(BUILD_DOCUMENTATION)
if(NOT DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen is needed to build the documentation.")
endif()
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
add_custom_target(docs
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
install(CODE "execute_process(COMMAND ${CMAKE_BUILD_TOOL} docs)")
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc)
endif()

add_subdirectory(man)

if(NOT ENABLE_PPA)
Expand Down Expand Up @@ -113,7 +93,7 @@ if(CPACK_GENERATORS)
"/\\\\.vscode/"
"/\\\\.codelite/"
"/\\\\.idea/"
"/cmake-.*/"
"/cmake-.*/"
"\\\\.sh$"
"\\\\.project$"
"\\\\.workspace$"
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2012-2018 Softmotions Ltd <info@softmotions.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions README.md
@@ -0,0 +1,2 @@
# EJDB2

12 changes: 5 additions & 7 deletions ejdb2.project
Expand Up @@ -13,8 +13,8 @@
<Reconciliation>
<Regexes/>
<Excludepaths>
<Path>/home/adam/Projects/softmotions/ejdb/build</Path>
<Path>/home/adam/Projects/softmotions/ejdb/cmake-build-Debug</Path>
<Path>/home/adam/Projects/softmotions/ejdb/build</Path>
</Excludepaths>
<Ignorefiles/>
<Extensions>
Expand All @@ -25,19 +25,17 @@
<Description/>
<Dependencies/>
<VirtualDirectory Name="src">
<File Name="src/ejdb2defs.h"/>
<File Name="src/ejdb2.c"/>
<File Name="src/ejdb2.h"/>
<VirtualDirectory Name="tmpl">
<File Name="src/tmpl/ejdb2cfg.h"/>
<File Name="src/tmpl/libejdb2.pc.in"/>
<File Name="src/tmpl/jbcfg.h"/>
</VirtualDirectory>
<File Name="src/jb.c"/>
<File Name="src/jb.h"/>
<File Name="src/jbdefs.h"/>
<File Name="src/CMakeLists.txt"/>
<VirtualDirectory Name="jbj">
<File Name="src/jbj/jbj.h"/>
<File Name="src/jbj/jbj.c"/>
<File Name="src/json/jbj.h"/>
<File Name="src/json/jbj.c"/>
</VirtualDirectory>
</VirtualDirectory>
<VirtualDirectory Name="resources">
Expand Down
59 changes: 59 additions & 0 deletions installer/CMakeLists.txt
@@ -0,0 +1,59 @@
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_PACKAGE_CONTACT "${PROJECT_MAINTAINER}")
set(CPACK_PACKAGE_VERSION ${ejdb2_VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR ${ejdb2_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${ejdb2_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${ejdb2_VERSION_PATCH})
set(CPACK_PACKAGE_VENDOR ${PROJECT_VENDOR})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${PROJECT_DESCRIPTION_SUMMARY})
set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_SOURCE_DIR}/README.md")
set(CPACK_PACKAGE_FILE_NAME
"${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_BUILD_TYPE}-${CMAKE_SYSTEM_NAME}-${PROJECT_ARCH}")
if (CMAKE_BUILD_TYPE STREQUAL "Release")
set(CPACK_STRIP_FILES ON)
endif()

if (PACKAGE_DEB)
execute_process (
COMMAND /usr/bin/dpkg --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
RESULT_VARIABLE EXECUTE_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
if (EXECUTE_RESULT)
message(FATAL_ERROR "dpkg not found: No package generation.")
endif()
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${PROJECT_WEBSITE})
set(CPACK_DEBIAN_PACKAGE_SECTION libs)
set(CPACK_DEBIAN_PACKAGE_PRIORITY optional)
#set(CPACK_DEBIAN_PACKAGE_DEPENDS zlib1g)
set(CPACK_DEBIAN_PACKAGE_BUILD_DEPENDS pkg-config git devscripts dh-make)
if (NOT PPA_DEBIAN_VERSION)
set(PPA_DEBIAN_VERSION ppa1)
endif()
if (PROJECT_PPA)
set(DPUT_HOST ${PROJECT_PPA})
endif()
#set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "any")
set(CPACK_DEBIAN_RESOURCE_FILE_CHANGELOG ${CMAKE_SOURCE_DIR}/Changelog)
set(CPACK_DEBIAN_UPDATE_CHANGELOG ON)
endif(PACKAGE_DEB)

if (PACKAGE_TGZ)
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
endif(PACKAGE_TGZ)

include(CPack)

if (ENABLE_PPA)
if (NOT PROJECT_PPA_DISTRIB_TARGET)
set(PROJECT_PPA_DISTRIB_TARGET xenial artful)
endif()
set(DPUT_CONFIG_IN ${CMAKE_CURRENT_SOURCE_DIR}/debian/dput.cf.in)
include(UploadPPA)
endif()
5 changes: 5 additions & 0 deletions installer/debian/dput.cf.in
@@ -0,0 +1,5 @@
[ppa]
fqdn = ppa.launchpad.net
method = sftp
login = @PROJECT_PPA_USER@
incoming = ~%(ppa)s/ubuntu/@DPUT_DIST@
2 changes: 2 additions & 0 deletions man/CMakeLists.txt
@@ -0,0 +1,2 @@
install(FILES ejdb.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3
COMPONENT doc)

0 comments on commit df9f7d1

Please sign in to comment.