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:
parent
d68744c432
commit
77db53436d
@ -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)
|
||||
|
@ -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
|
||||
-----------------
|
||||
|
11
dependencies/CMakeLists.txt
vendored
11
dependencies/CMakeLists.txt
vendored
@ -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
|
||||
if(NOT USE_SYSTEM_DATE)
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(date
|
||||
GIT_REPOSITORY https://github.com/HowardHinnant/date.git
|
||||
GIT_TAG v3.0.0
|
||||
)
|
||||
)
|
||||
|
||||
add_subdirectory(hinnant_date)
|
||||
add_subdirectory(hinnant_date)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user