separate DB dependent from DB index.
This commit is contained in:
38
packages/myddas/postgres/CMakeLists.txt
Normal file
38
packages/myddas/postgres/CMakeLists.txt
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
set( YAPPOSTGRES_SOURCES
|
||||
myddas_postgres.c
|
||||
)
|
||||
|
||||
set(SO_MAJOR 1)
|
||||
set(SO_MINOR 0)
|
||||
set(SO_PATCH 0)
|
||||
|
||||
macro_optional_find_package(POSTGRESQL ON)
|
||||
|
||||
macro_log_feature (POSTGRES_FOUND "postgres"
|
||||
"POSTGRES Driver for MYDDAS Data-Base Interface "
|
||||
"http://www.postgres.org" FALSE)
|
||||
|
||||
add_library (Yappostgres SHARED ${YAPPOSTGRES_SOURCES})
|
||||
|
||||
if (POSTGRES_FOUND)
|
||||
# POSTGRES_INCLUDE_DIRECTORIES, where to find sql.h
|
||||
# POSTGRES_LIBRARIES, the libraries to link against to use POSTGRES
|
||||
# POSTGRES_FOUND. If false, you cannot build anything that requires Postgres.
|
||||
add_definitions (-DMYDDAS_POSTGRES=1)
|
||||
target_link_libraries(Yappostgres libYap ${POSTGRES_LIBRARIES})
|
||||
include_directories (${POSTGRES_INCLUDE_DIRECTORIES} ..)
|
||||
else()
|
||||
add_definitions (-DMYDDAS_POSTGRES=0)
|
||||
endif (POSTGRES_FOUND)
|
||||
|
||||
set_target_properties (Yappostgres PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
VERSION "${SO_MAJOR}.${SO_MINOR}.${SO_PATCH}"
|
||||
SOVERSION ${SO_MAJOR}
|
||||
)
|
||||
|
||||
install(TARGETS Yappostgres
|
||||
LIBRARY DESTINATION ${libdir}
|
||||
)
|
||||
|
Reference in New Issue
Block a user