Skip to content

Commit

Permalink
fix: path
Browse files Browse the repository at this point in the history
  • Loading branch information
aijle authored and gittiver committed Oct 8, 2023
1 parent 35aa6e4 commit 37afc92
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
12 changes: 6 additions & 6 deletions cmake/FindSQLite3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,27 @@ IF ( NOT SQLITE3_FOUND AND NOT PKG_CONFIG_FOUND )


IF ( _sqlite3_FOUND )
SET ( SQLITE3_INCLUDE_DIRS ${_sqlite3_include_DIR} )
SET ( SQLITE3_INCLUDE_DIR ${_sqlite3_include_DIR} )
SET ( SQLITE3_LIBRARIES ${_sqlite3_link_DIR} )
ENDIF ( _sqlite3_FOUND )

# Report results
IF ( SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS AND _sqlite3_FOUND )
IF ( SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIR AND _sqlite3_FOUND )
SET( SQLITE3_FOUND 1 )
IF ( NOT Sqlite3_FIND_QUIETLY )
MESSAGE( STATUS "Found sqlite3: ${SQLITE3_LIBRARIES} ${SQLITE3_INCLUDE_DIRS}" )
MESSAGE( STATUS "Found sqlite3: ${SQLITE3_LIBRARIES} ${SQLITE3_INCLUDE_DIR}" )
ENDIF ( NOT Sqlite3_FIND_QUIETLY )
ELSE ( SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS AND _sqlite3_FOUND )
ELSE ( SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIR AND _sqlite3_FOUND )
IF ( Sqlite3_FIND_REQUIRED )
MESSAGE( SEND_ERROR "Could NOT find sqlite3" )
ELSE ( Sqlite3_FIND_REQUIRED )
IF ( NOT Sqlite3_FIND_QUIETLY )
MESSAGE( STATUS "Could NOT find sqlite3" )
ENDIF ( NOT Sqlite3_FIND_QUIETLY )
ENDIF ( Sqlite3_FIND_REQUIRED )
ENDIF ( SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIRS AND _sqlite3_FOUND )
ENDIF ( SQLITE3_LIBRARIES AND SQLITE3_INCLUDE_DIR AND _sqlite3_FOUND )

ENDIF ( NOT SQLITE3_FOUND AND NOT PKG_CONFIG_FOUND )

# Hide advanced variables from CMake GUIs
MARK_AS_ADVANCED( SQLITE3_LIBRARIES SQLITE3_INCLUDE_DIRS )
MARK_AS_ADVANCED( SQLITE3_LIBRARIES SQLITE3_INCLUDE_DIR )
32 changes: 22 additions & 10 deletions src/library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,23 @@ endif(LITESQL_USE_SYSTEM_SQLITE AND SQLITE3_FOUND)

if (LITESQL_WITH_SQLITE3)
target_sources(${LIBNAME}
PRIVATE
sqlite3/sqlite3_backend.cpp)
target_link_libraries(${LIBNAME} PRIVATE ${SQLITE3_LIBRARIES})

add_library(${LIBNAME}_sqlite STATIC
sqlite3/sqlite3_backend.cpp
sqlite3/sqlite3.hpp)
target_link_libraries(${LIBNAME}_sqlite PRIVATE ${SQLITE3_LIBRARIES} litesql-util)
target_include_directories(${LIBNAME}_sqlite PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
PRIVATE
sqlite3/sqlite3_backend.cpp)
target_include_directories(${LIBNAME}
PRIVATE
${SQLITE3_INCLUDE_DIR}
)
target_link_directories(${LIBNAME}
PUBLIC
${SQLITE3_LIBRARIY_DIR}
)
target_link_libraries(${LIBNAME} PUBLIC ${SQLITE3_LIBRARIES})

# add_library(${LIBNAME}_sqlite STATIC
# sqlite3/sqlite3_backend.cpp
# sqlite3/sqlite3.hpp)
# target_link_libraries(${LIBNAME}_sqlite PRIVATE ${SQLITE3_LIBRARIES} litesql-util)
# target_include_directories(${LIBNAME}_sqlite PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
# install(TARGETS ${LIBNAME}_sqlite EXPORT ${LIBNAME}_sqlite
# RUNTIME DESTINATION lib
# LIBRARY DESTINATION lib
Expand Down Expand Up @@ -135,8 +143,12 @@ if (LITESQL_WITH_MYSQL)
PRIVATE
${MYSQL_INCLUDE_DIR}
)
target_link_directories(${LIBNAME}
PUBLIC
${MYSQL_LIBRARY_DIR}
)
target_link_libraries(${LIBNAME}
PRIVATE
PUBLIC
${MYSQL_LIBRARIES}
)
endif()
Expand Down

0 comments on commit 37afc92

Please sign in to comment.