This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/myddas/postgres/CMakeLists.txt

40 lines
1.2 KiB
CMake
Raw Normal View History

2015-11-05 17:06:15 +00:00
set( YAPPOSTGRES_SOURCES
myddas_postgres.c
)
set(SO_MAJOR 1)
set(SO_MINOR 0)
set(SO_PATCH 0)
macro_optional_find_package(PostgreSQL ON)
2015-11-05 17:06:15 +00:00
macro_log_feature (PostgreSQL_FOUND "postgres"
"PostgreSQL Driver for MYDDAS Data-Base Interface "
2015-11-05 17:06:15 +00:00
"http://www.postgres.org" FALSE)
if (PostgreSQL_FOUND)
# PostgreSQL_FOUND - Set to true when PostgreSQL is found.
# PostgreSQL_INCLUDE_DIRS - Include directories for PostgreSQL
# PostgreSQL_LIBRARY_DIRS - Link directories for PostgreSQL libraries
# PostgreSQL_LIBRARIES - The PostgreSQL libraries.
2015-11-09 18:21:54 +00:00
add_library (Yappostgres SHARED ${YAPPOSTGRES_SOURCES})
2016-04-05 08:09:39 +01:00
set (MYDDAS_FLAGS ${MYDDAS_FLAGS} -DMYDDAS_POSTGRES=1 PARENT_SCOPE)
set_property( DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS MYDDAS_POSTGRES=1 )
target_link_libraries(Yappostgres libYap ${PostgreSQL_LIBRARIES})
include_directories (${PostgreSQL_INCLUDE_DIRS} ..)
2016-01-03 02:06:09 +00:00
set_target_properties (Yappostgres PROPERTIES
POSITION_INDEPENDENT_CODE ON
VERSION "${SO_MAJOR}.${SO_MINOR}.${SO_PATCH}"
SOVERSION ${SO_MAJOR}
2015-11-05 17:06:15 +00:00
)
install(TARGETS Yappostgres
LIBRARY DESTINATION ${libdir}
2016-01-20 22:25:25 +00:00
ARCHIVE DESTINATION ${libdir}
2015-11-05 17:06:15 +00:00
)
2016-01-03 02:06:09 +00:00
else()
add_definitions (-DMYDDAS_PostgreSQL=0)
endif (PostgreSQL_FOUND)