forked from numenta/nupic.core-legacy
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added sqlite3 as third party package #857
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cc77fe1
Added sqlite3 as third party package
dkeeney 2cfef09
Told CMake it was C code.
dkeeney 8656e4d
Merge branch 'master' into sqlite3_external
dkeeney 2d4ab62
Also need to tell it to generate a static library
dkeeney 66a27e0
Told CMake it was C in the Project statement
dkeeney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# ----------------------------------------------------------------------------- | ||
# Numenta Platform for Intelligent Computing (NuPIC) | ||
# Copyright (C) 2019, Numenta, Inc. Unless you have purchased from | ||
# Numenta, Inc. a separate commercial license for this software code, the | ||
# following terms and conditions apply: | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero Public License version 3 as | ||
# published by the Free Software Foundation. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# See the GNU Affero Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero Public License | ||
# along with this program. If not, see http://www.gnu.org/licenses. | ||
# | ||
# http://numenta.org/licenses/ | ||
# ----------------------------------------------------------------------------- | ||
# This downloads and builds the sqlite3 library. | ||
# | ||
# SQLite is a C-language library that implements a small, fast, self-contained, | ||
# high-reliability, full-featured, SQL database engine. SQLite is the most used | ||
# database engine in the world. | ||
# | ||
# The current release is 3/32/3 (2020-06-18) | ||
# The repository is at https://www.sqlite.org/2020/sqlite-autoconf-3320300.tar.gz | ||
# | ||
# | ||
if(EXISTS ${REPOSITORY_DIR}/build/ThirdParty/share/sqlite3.tar.gz) | ||
set(URL ${REPOSITORY_DIR}/build/ThirdParty/share/sqlite3.tar.gz) | ||
else() | ||
set(URL "https://www.sqlite.org/2020/sqlite-autoconf-3320300.tar.gz") | ||
endif() | ||
|
||
message(STATUS "Obtaining sqlite3") | ||
include(DownloadProject/DownloadProject.cmake) | ||
download_project(PROJ sqlite3 | ||
PREFIX ${EP_BASE}/sqlite3 | ||
URL ${URL} | ||
GIT_SHALLOW ON | ||
UPDATE_DISCONNECTED 1 | ||
QUIET | ||
) | ||
|
||
# SQLite does not provide a CMakeList.txt to buld with so we provide the following lines to perform the compile here. | ||
# Since we are building here and not in the source folder, the library will show up directly under build/ThirdParty. | ||
set(SRCS ${sqlite3_SOURCE_DIR}/sqlite3.c ${sqlite3_SOURCE_DIR}/sqlite3.h) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you might need to explicitely tell CMake this is a C (not C++) file somewhere here https://github.com/htm-community/htm.core/pull/857/checks?check_run_id=827912596#step:6:173 |
||
add_library(sqlite3 STATIC ${SRCS} ) | ||
target_compile_definitions(sqlite3 PRIVATE ${COMMON_COMPILER_DEFINITIONS}) | ||
|
||
set(sqlite3_INCLUDE_DIRS ${sqlite3_SOURCE_DIR}/include) | ||
if (MSVC) | ||
set(sqlite3_LIBRARIES "${CMAKE_BINARY_DIR}$<$<CONFIG:Release>:/Release/sqlite3.lib>$<$<CONFIG:Debug>:/Debug/sqlite3.lib>") | ||
else() | ||
set(sqlite3_LIBRARIES ${CMAKE_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}sqlite3${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
endif() | ||
|
||
FILE(APPEND "${EXPORT_FILE_NAME}" "sqlite3_INCLUDE_DIRS@@@${sqlite3_INCLUDE_DIRS}\n") | ||
FILE(APPEND "${EXPORT_FILE_NAME}" "sqlite3_LIBRARIES@@@${sqlite3_LIBRARIES}\n") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it doesn't hurt if we add C to the languages (?)