summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt28
1 files changed, 16 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06f992e..22e0e25 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,7 @@
# The meson/ninja build should be preferred in all other cases.
#
cmake_minimum_required(VERSION 3.13)
-project(libdjinterop VERSION 0.14.1)
+project(libdjinterop VERSION 0.14.2)
# Require C++17
set(CMAKE_CXX_STANDARD 17)
@@ -22,14 +22,6 @@ option(SYSTEM_SQLITE "Use system installation of SQLite" ON)
# Require zlib >= 1.2.8
find_package(ZLIB 1.2.8 REQUIRED)
-# Generate config.hpp based on build-time environment.
-include(CheckIncludeFileCXX)
-CHECK_INCLUDE_FILE_CXX(optional DJINTEROP_STD_OPTIONAL)
-CHECK_INCLUDE_FILE_CXX(experimental/optional DJINTEROP_STD_EXPERIMENTAL_OPTIONAL)
-configure_file(
- include/djinterop/config.hpp.in
- include/djinterop/config.hpp)
-
add_library(
djinterop
src/djinterop/impl/crate_impl.cpp
@@ -61,9 +53,20 @@ add_library(
src/djinterop/transaction_guard.cpp
src/djinterop/util.cpp)
-target_compile_definitions(
- djinterop PUBLIC
- DJINTEROP_SOURCE)
+target_compile_definitions(djinterop PUBLIC DJINTEROP_SOURCE)
+
+get_target_property(djinterop_library_type djinterop TYPE)
+if(djinterop_library_type STREQUAL "STATIC_LIBRARY")
+ set(DJINTEROP_STATIC ON)
+endif()
+
+# Generate config.hpp based on build-time environment.
+include(CheckIncludeFileCXX)
+CHECK_INCLUDE_FILE_CXX(optional DJINTEROP_STD_OPTIONAL)
+CHECK_INCLUDE_FILE_CXX(experimental/optional DJINTEROP_STD_EXPERIMENTAL_OPTIONAL)
+configure_file(
+ include/djinterop/config.hpp.in
+ include/djinterop/config.hpp)
target_include_directories(
djinterop PUBLIC
@@ -76,6 +79,7 @@ target_link_libraries(
djinterop PUBLIC
${ZLIB_LIBRARIES})
+
if(SYSTEM_SQLITE)
# Search for system installation of SQLite and use that.
find_package(SQLite3 3.11.0 REQUIRED)