mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2025-07-03 14:14:11 +00:00
Unpacking needs iostreams from boost to be linked.
This commit is contained in:
parent
116f34cbbd
commit
7dff61f2a9
1 changed files with 16 additions and 3 deletions
|
@ -1,11 +1,19 @@
|
||||||
project(${bare_name}-backend-postgresql CXX)
|
project(${bare_name}-backend-postgresql CXX)
|
||||||
|
|
||||||
find_package(ZLIB)
|
find_package(ZLIB)
|
||||||
|
find_package(Boost 1.53.0 COMPONENTS iostreams)
|
||||||
|
|
||||||
include(binary_resource)
|
include(binary_resource)
|
||||||
|
|
||||||
if (ZLIB_FOUND)
|
if (ZLIB_FOUND AND Boost_IOSTREAMS_FOUND)
|
||||||
|
set(compress_bin_data ON)
|
||||||
|
else()
|
||||||
|
set(compress_bin_data OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (compress_bin_data)
|
||||||
set(gzip GZIP)
|
set(gzip GZIP)
|
||||||
|
message(STATUS "Embedded binary resources will be gzipped")
|
||||||
else()
|
else()
|
||||||
set(gzip "")
|
set(gzip "")
|
||||||
endif()
|
endif()
|
||||||
|
@ -13,7 +21,9 @@ make_binary_resource(${gzip}
|
||||||
INPUT ${CMAKE_BINARY_DIR}/dindexer.sql
|
INPUT ${CMAKE_BINARY_DIR}/dindexer.sql
|
||||||
ARRAY_NAME create_tables_query
|
ARRAY_NAME create_tables_query
|
||||||
EXTENSION .cpp
|
EXTENSION .cpp
|
||||||
|
PREFIX extern const
|
||||||
)
|
)
|
||||||
|
unset(gzip)
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} SHARED
|
add_library(${PROJECT_NAME} SHARED
|
||||||
tag.cpp
|
tag.cpp
|
||||||
|
@ -37,8 +47,11 @@ target_link_libraries(${PROJECT_NAME}
|
||||||
PRIVATE ${bare_name}-inc
|
PRIVATE ${bare_name}-inc
|
||||||
PRIVATE ${bare_name}-pq
|
PRIVATE ${bare_name}-pq
|
||||||
)
|
)
|
||||||
if (ZLIB_FOUND)
|
if (compress_bin_data)
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE ZLIB::ZLIB)
|
target_link_libraries(${PROJECT_NAME}
|
||||||
|
PRIVATE ZLIB::ZLIB
|
||||||
|
PRIVATE Boost::iostreams
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS ${PROJECT_NAME}
|
install(TARGETS ${PROJECT_NAME}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue