more odb-sqlite

This commit is contained in:
Charles Barto 2016-10-19 01:28:50 -04:00
parent 2aa034bf47
commit 8de99463fa
2 changed files with 14 additions and 9 deletions

View File

@ -7,25 +7,25 @@ file(GLOB_RECURSE libodb_src LIST_DIRECTORIES False
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
*.cxx)
list(FILTER libodb_src EXCLUDE REGEX /posix/.*)
add_library(sqlite ${libodb_src})
target_include_directories(sqlite
add_library(libodb-sqlite ${libodb_src})
target_include_directories(libodb-sqlite
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
target_link_libraries(sqlite PRIVATE odb::libodb sqlite3)
target_link_libraries(libodb-sqlite PRIVATE odb::libodb sqlite3)
if(BUILD_SHARED_LIBS)
target_compile_definitions(sqlite PRIVATE
target_compile_definitions(libodb-sqlite PRIVATE
-DLIBODB_SQLITE_DYNAMIC_LIB
-DLIBODB_SQLITE_HAVE_UNLOCK_NOTIFY)
else()
target_compile_definitions(sqlite PRIVATE
target_compile_definitions(libodb-sqlite PRIVATE
-DLIBODB_SQLITE_STATIC_LIB
-DLIBODB_SQLITE_HAVE_UNLOCK_NOTIFY)
endif()
install(TARGETS sqlite EXPORT odb_sqliteConfig
install(TARGETS libodb-sqlite EXPORT odb_sqliteConfig
COMPONENT sqlite
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
@ -42,4 +42,4 @@ install(DIRECTORY odb DESTINATION include/
)
endif()
install(EXPORT odb_sqliteConfig NAMESPACE odb:: COMPONENT sqlite DESTINATION share/odb)
export(TARGETS sqlite NAMESPACE odb:: FILE odb_sqliteConfig.cmake)
export(TARGETS libodb-sqlite NAMESPACE odb:: FILE odb_sqliteConfig.cmake)

View File

@ -25,5 +25,10 @@ vcpkg_configure_cmake(
vcpkg_build_cmake()
vcpkg_install_cmake()
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libodb)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libodb/LICENSE ${CURRENT_PACKAGES_DIR}/share/libodb/copyright)
file(READ ${CURRENT_PACKAGES_DIR}/debug/share/odb/odb_sqliteConfig-debug.cmake LIBODB_DEBUG_TARGETS)
string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" LIBODB_DEBUG_TARGETS "${LIBODB_DEBUG_TARGETS}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/odb/odb_sqliteConfig-debug.cmake "${LIBODB_DEBUG_TARGETS}")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libodb-sqlite)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libodb-sqlite/LICENSE ${CURRENT_PACKAGES_DIR}/share/libodb-sqlite/copyright)
vcpkg_copy_pdbs()