@@ -85,28 +85,6 @@ else (NOT MSVC)
8585 endif ()
8686endif ()
8787
88- # Options relative to SQLite and SQLiteC++ functions
89-
90- option (SQLITE_ENABLE_COLUMN_METADATA "Enable Column::getColumnOriginName(). Require support from sqlite3 library." ON )
91- if (SQLITE_ENABLE_COLUMN_METADATA)
92- # Enable the use of SQLite column metadata and Column::getColumnOriginName() method,
93- # Require that the sqlite3 library is also compiled with this flag (default under Debian/Ubuntu, but not on Mac OS X).
94- add_definitions (-DSQLITE_ENABLE_COLUMN_METADATA)
95- endif (SQLITE_ENABLE_COLUMN_METADATA)
96-
97- option (SQLITE_ENABLE_ASSERT_HANDLER "Enable the user defintion of a assertion_failed() handler." OFF )
98- if (SQLITE_ENABLE_ASSERT_HANDLER)
99- # Enable the user defintion of a assertion_failed() handler (default to false, easier to handler for begginers).
100- add_definitions (-DSQLITECPP_ENABLE_ASSERT_HANDLER)
101- endif (SQLITE_ENABLE_ASSERT_HANDLER)
102-
103- option (SQLITE_USE_LEGACY_STRUCT "Fallback to forward declaration of legacy struct sqlite3_value (pre SQLite 3.19)" OFF )
104- if (SQLITE_USE_LEGACY_STRUCT)
105- # Force forward declaration of legacy struct sqlite3_value (pre SQLite 3.19)
106- add_definitions (-DSQLITE_USE_LEGACY_STRUCT)
107- endif (SQLITE_USE_LEGACY_STRUCT)
108-
109-
11088## Build the C++ Wrapper ##
11189
11290# adding a new file require explicittly modifing the CMakeLists.txt
@@ -188,6 +166,27 @@ add_library(SQLiteCpp ${SQLITECPP_SRC} ${SQLITECPP_INC} ${SQLITECPP_DOC} ${SQLIT
188166# PR https://github.com/SRombauts/SQLiteCpp/pull/111 "linked SQLiteCpp to sqlite3" commented out since it breaks install step from PR #118
189167#target_link_libraries(SQLiteCpp PUBLIC sqlite3)
190168
169+ # Options relative to SQLite and SQLiteC++ functions
170+
171+ option (SQLITE_ENABLE_COLUMN_METADATA "Enable Column::getColumnOriginName(). Require support from sqlite3 library." ON )
172+ if (SQLITE_ENABLE_COLUMN_METADATA)
173+ # Enable the use of SQLite column metadata and Column::getColumnOriginName() method,
174+ # Require that the sqlite3 library is also compiled with this flag (default under Debian/Ubuntu, but not on Mac OS X).
175+ target_compile_definitions (SQLiteCpp PUBLIC SQLITE_ENABLE_COLUMN_METADATA)
176+ endif (SQLITE_ENABLE_COLUMN_METADATA)
177+
178+ option (SQLITE_ENABLE_ASSERT_HANDLER "Enable the user defintion of a assertion_failed() handler." OFF )
179+ if (SQLITE_ENABLE_ASSERT_HANDLER)
180+ # Enable the user defintion of a assertion_failed() handler (default to false, easier to handler for begginers).
181+ target_compile_definitions (SQLiteCpp PUBLIC SQLITECPP_ENABLE_ASSERT_HANDLER)
182+ endif (SQLITE_ENABLE_ASSERT_HANDLER)
183+
184+ option (SQLITE_USE_LEGACY_STRUCT "Fallback to forward declaration of legacy struct sqlite3_value (pre SQLite 3.19)" OFF )
185+ if (SQLITE_USE_LEGACY_STRUCT)
186+ # Force forward declaration of legacy struct sqlite3_value (pre SQLite 3.19)
187+ target_compile_definitions (SQLiteCpp PUBLIC SQLITE_USE_LEGACY_STRUCT)
188+ endif (SQLITE_USE_LEGACY_STRUCT)
189+
191190if (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" ))
192191 set_target_properties (SQLiteCpp PROPERTIES COMPILE_FLAGS "-fPIC" )
193192endif (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" ))
0 commit comments