Skip to content

Commit

Permalink
Made the check for date.h a bit more user friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
rbock committed Apr 11, 2016
1 parent 434f691 commit f18ab54
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2013-2015, Roland Bock
# Copyright (c) 2013-2016, Roland Bock
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -32,14 +32,20 @@ add_library(sqlpp11 INTERFACE)
set(DATE_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../date" CACHE FILEPATH "Path to Howard Hinnant's date library")

if(NOT EXISTS ${DATE_INCLUDE_DIR}/date.h)
message(SEND_ERROR "Can't find date.h in ${DATE_INCLUDE_DIR}")
message(SEND_ERROR "Can't find file date.h and cannot compile date_test/date_test.cpp")
message("Can't find date.h in ${DATE_INCLUDE_DIR} ")
message("Please either")
message(" - git clone https://github.com/howardhinnant/date ${DATE_INCLUDE_DIR}")
message(" - download and unzip a current version from https://github.com/howardhinnant/date to ${DATE_INCLUDE_DIR}")
message(" - set DATE_INCLUDE_DIR to point to the dir containing date.h from the date library")
message("")
else()
target_include_directories(sqlpp11 INTERFACE
$<BUILD_INTERFACE:${DATE_INCLUDE_DIR}>
$<BUILD_INTERFACE:${sqlpp11_SOURCE_DIR}/include>
)
endif()

target_include_directories(sqlpp11 INTERFACE
$<BUILD_INTERFACE:${DATE_INCLUDE_DIR}>
$<BUILD_INTERFACE:${sqlpp11_SOURCE_DIR}/include>
)

if (NOT MSVC)
target_compile_features(sqlpp11 INTERFACE
cxx_alias_templates
Expand Down

0 comments on commit f18ab54

Please sign in to comment.