Skip to content
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

Pass CMAKE_TOOLCHAIN_FILE if crosscompiling #112

Merged
merged 1 commit into from
May 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions sqlite3_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@ list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
find_package(SQLite3)

if (NOT SQLite3_FOUND)
set(extra_cmake_args)

if(DEFINED CMAKE_TOOLCHAIN_FILE)
list(APPEND extra_cmake_args "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
endif()

include(ExternalProject)
ExternalProject_Add(sqlite3-3.24.0
PREFIX sqlite3-3.24.0
URL https://www.sqlite.org/2018/sqlite-amalgamation-3240000.zip
URL_MD5 4ea1e0c6e7e82cb0490d4753d6878698
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/sqlite3_install
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/sqlite3_install
${extra_cmake_args}
INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/sqlite3_install"
PATCH_COMMAND
${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/sqlite3_cmakelists.txt" <SOURCE_DIR>/CMakeLists.txt
Expand All @@ -30,4 +38,4 @@ install(DIRECTORY cmake DESTINATION share/${PROJECT_NAME})
install(FILES
"${PROJECT_BINARY_DIR}/sqlite3_vendorConfig.cmake"
"${PROJECT_BINARY_DIR}/sqlite3_vendorConfig-version.cmake"
DESTINATION share/${PROJECT_NAME}/cmake)
DESTINATION share/${PROJECT_NAME}/cmake)