Skip to content

Commit

Permalink
Merge pull request apache#194 from rafael-telles/implement-FindSQLite…
Browse files Browse the repository at this point in the history
…3Alt

[C++] Implement FindSqLite3Alt on CMake
  • Loading branch information
JrJuscelino authored Nov 9, 2021
2 parents 9b8eb95 + 7d8159c commit 37e9fa1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions cpp/cmake_modules/FindSQLite3Alt.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Once done this will define
# - FindSQLite3Alt
#
# This module will set the following variables if found:
# SQLite3_INCLUDE_DIRS - SQLite3 include dir.
# SQLite3_LIBRARIES - List of libraries when using SQLite3.
# SQLite3_FOUND - True if SQLite3 found.
#
# Usage of this module as follows:
# find_package(SQLite3Alt)

find_path(SQLite3_INCLUDE_DIR sqlite3.h)
find_library(SQLite3_LIBRARY NAMES sqlite3)

# handle the QUIETLY and REQUIRED arguments and set SQLite3_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SQLite3Alt FAULT_MSG SQLite3_LIBRARY SQLite3_INCLUDE_DIR)

mark_as_advanced(SQLite3_LIBRARY SQLite3_INCLUDE_DIR)

if(SQLite3_FOUND)
SET(SQLite3_INCLUDE_DIRS ${SQLite3_INCLUDE_DIR})
SET(SQLite3_LIBRARIES ${SQLite3_LIBRARY})
endif()
2 changes: 1 addition & 1 deletion cpp/src/arrow/flight/flight_sql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ add_arrow_test(flight_sql_server_test

# Build test server for unit tests
if(ARROW_BUILD_TESTS OR ARROW_BUILD_EXAMPLES)
find_package(SQLite3)
find_package(SQLite3Alt REQUIRED)

add_executable(flight_sql_test_server
server.cc
Expand Down

0 comments on commit 37e9fa1

Please sign in to comment.