0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Add USE_SYSTEM_DATE cmake option (#372)

* Add `USE_SYSTEM_DATE` cmake option
This commit is contained in:
Daniil Kovalev 2021-07-29 08:37:25 +03:00 committed by GitHub
parent d68744c432
commit 77db53436d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 7 deletions

View File

@ -32,6 +32,14 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
include(CTest)
option(USE_SYSTEM_DATE "\
Use find_package to find installed HowardHinnant's \
date library instead of fetching it from github" OFF
)
if(USE_SYSTEM_DATE)
find_package(date REQUIRED)
endif()
### Dependencies
add_subdirectory(dependencies)

View File

@ -135,7 +135,7 @@ To demonstrate that sqlpp11 can work with other backends as well, here is an exp
* STL Container: https://github.com/rbock/sqlpp11-connector-stl
__Date Library:__
sqlpp11 requires [Howard Hinnant's date library](https://github.com/HowardHinnant/date) for `date` and `date_time` data types. Sqlpp11 uses FetchContent to pull the library automatically in the project.
sqlpp11 requires [Howard Hinnant's date library](https://github.com/HowardHinnant/date) for `date` and `date_time` data types. By default, sqlpp11 uses FetchContent to pull the library automatically in the project. If you want to use an already installed version of the library with `find_package`, set `USE_SYSTEM_DATE` option to `ON`.
Build and Install
-----------------

View File

@ -22,11 +22,14 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
include(FetchContent)
FetchContent_Declare(date
GIT_REPOSITORY https://github.com/HowardHinnant/date.git
GIT_TAG v3.0.0
)
if(NOT USE_SYSTEM_DATE)
include(FetchContent)
add_subdirectory(hinnant_date)
FetchContent_Declare(date
GIT_REPOSITORY https://github.com/HowardHinnant/date.git
GIT_TAG v3.0.0
)
add_subdirectory(hinnant_date)
endif()