Skip to content

Commit

Permalink
1.0.0 update
Browse files Browse the repository at this point in the history
initial commit.
  • Loading branch information
greenfish77 committed Mar 9, 2022
1 parent c3d15f1 commit 12e6c61
Show file tree
Hide file tree
Showing 84 changed files with 18,623 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ignore cmake configured file.
include/gaenari/gaenari-config.h

# ignore downloaded sqlite sources.
extern/sqlite/sqlite/*

# write '*' in .gitignore to ignore the cmake build directory in repo.
# do it in root CMakeFiles.txt.
# do nothing.

158 changes: 158 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
######################
# gaenari build & test
######################
# mkdir build
# cd build
# cmake ..
# cmake --build . --config release
# cmake --install . --prefix install
# ctest --verbose
# (find executables in build/tests/* and just execute it, display in color.)

####################
# build with gaenari
####################
# -------------------
# wrapper/wrapper.cpp
# -------------------
# #include "gaenari/gaenari.hpp"
# int main(void) {
# gaenari::logger::init1("/temp/_log.txt");
# using supul_t = supul::supul::supul_t;
# supul_t::api::project::create("/temp/supul_dir");
# supul_t::api::project::add_field("/temp/supul_dir", "x1", "REAL");
# supul_t::api::project::add_field("/temp/supul_dir", "x2", "INTEGER");
# supul_t::api::project::add_field("/temp/supul_dir", "x3", "TEXT_ID");
# supul_t::api::project::add_field("/temp/supul_dir", "y0", "TEXT_ID");
# supul_t::api::project::x("/temp/supul_dir", {"x1", "x2", "x3"});
# supul_t::api::project::y("/temp/supul_dir", "y0");
# supul_t::api::project::set_property("/temp/supul_dir", "db.type", "sqlite");
# supul_t supul;
# supul.api.lifetime.open("/temp/supul_dir");
# supul.api.model.insert_chunk_csv("/temp/dataset.csv");
# supul.api.model.update();
# supul.api.model.deinit();
# // ...
# supul.api.model.rebuild();
# supul.api.lifetime.close();
# return 0;
# }
#
# ----------------------
# wrapper/CMakeLists.txt
# ----------------------
# cmake_minimum_required(VERSION 3.6)
# project(wrapper)
#
# # call order is important.
#
# add_subdirectory(</path/to/gaenari>)
# check_cpp17_gaenari()
#
# add_executable(wrapper wrapper.cpp)
# add_gaenari(wrapper)
#
# -----
# build
# -----
# wrapper/build$ cmake ..
# wrapper/build$ cmake --build . --config release

cmake_minimum_required(VERSION 3.6)

##########
# settings
##########
# project.
project(gaenari VERSION 1.0.0)

#################################
# auto git ignore build directory
#################################
if(NOT EXISTS ${PROJECT_BINARY_DIR}/.gitignore)
file(WRITE ${PROJECT_BINARY_DIR}/.gitignore "*")
endif()

#########
# include
#########
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/gaenari_util.cmake")

#########
# options
#########
set(_SQLITE_SHA256_ "999826FE4C871F18919FDB8ED7EC9DD8217180854DD1FE21EEA96AED36186729")
set(SQLITE_VERSION "3360000" CACHE STRING "sqlite version to build. minimum(3350400(=3.35.5) for supporting `returning`)")
set(SQLITE_RELEASE_YEAR "2021" CACHE STRING "release year of SQLITE_VERSION.")
set(SQLITE_SHA256 ${_SQLITE_SHA256_} CACHE STRING "sha256 value of sqlite.zip.")

##################
# global variables
##################
# download directory.
set(DOWNLOAD_DIR "${CMAKE_CURRENT_BINARY_DIR}/download")

# gaenari include directory.
set(GAENARI_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")

# sqlite include directory.
set(SQLITE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extern/sqlite")

# gaenari hpp files.
# gaenari has only header files.
# this list is used to build source_group for IDE tools, not compilation.
file(GLOB_RECURSE GAENARI_HPP_FILES
"${GAENARI_INCLUDE_DIR}/*.hpp"
"${GAENARI_INCLUDE_DIR}/*.h"
)

#######
# c++17
#######
check_cpp17_gaenari()

###########
# configure
###########
configure_file("${GAENARI_INCLUDE_DIR}/gaenari/gaenari-config.h.in" "${GAENARI_INCLUDE_DIR}/gaenari/gaenari-config.h")

############
# definition
############
# compile definitions.
set(GAENARI_DEFINITIONS "")
add_compile_definitions(${GAENARI_DEFINITIONS})

#########
# targets
#########
# add sqlite target to build.
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/extern/sqlite")

# add tests target to build.
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/tests")

# add files target to edit some files in IDE.
add_custom_target(files SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/README.md"
"${CMAKE_CURRENT_SOURCE_DIR}/TODO.md"
)

#########################
# for add_gaenari() macro
#########################
set(GAENARI_INCLUDE_DIR_FOR_BUILD ${GAENARI_INCLUDE_DIR} ${SQLITE_INCLUDE_DIR} CACHE INTERNAL "_GAENARI_INCLUDE_DIR_FOR_BUILD")
set(GAEANRI_DEFINITION_FOR_BUILD ${GAENARI_DEFINITIONS} CACHE INTERNAL "_GAEANRI_DEFINITION_FOR_BUILD")
set(GAENARI_LINK_FOR_BUILD sqlite3 CACHE INTERNAL "_GAENARI_LINK_FOR_BUILD")

######
# test
######
# call tests from tests sub-directory.
enable_testing()

#########
# install
#########
# add gaenari header files to install directory.
install(DIRECTORY "${GAENARI_INCLUDE_DIR}" DESTINATION include)
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Apache License
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

Expand Down Expand Up @@ -186,7 +186,7 @@ Apache License
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2022 greenfish77

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
23 changes: 23 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Apache gaenari
Copyright 2022 The Apache Software Foundation

================================
sqlite (https://www.sqlite.org/)
================================
public domain
https://www.sqlite.org/copyright.html

=============
forsythia.jpg
=============
public domain
https://cdn.pixabay.com/photo/2020/02/28/21/42/forsythia-4888681__340.jpg
(compressed)

==========
apples.gif
==========
public domain
https://cdn.pixabay.com/photo/2019/02/04/06/45/apple-3974055_1280.jpg
(resized, compressed, and animated)

Loading

0 comments on commit 12e6c61

Please sign in to comment.