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/mysql/CMakeLists.txt

54 lines
1.5 KiB
CMake
Raw Normal View History

2015-11-05 17:06:15 +00:00
set(MYSQL_SOURCES
myddas_mysql.c
myddas_util.c
myddas_util.c
myddas_wkb2prolog.c
)
2015-11-05 17:06:15 +00:00
set(SO_MAJOR 1)
set(SO_MINOR 0)
set(SO_PATCH 0)
2015-11-05 17:06:15 +00:00
macro_optional_find_package(MySQL ON)
2015-11-05 17:06:15 +00:00
if (MYSQL_FOUND)
# MYSQL_INCLUDE_DIR - where to find mysql.h, etc.
# MYSQL_LIBRARIES - List of libraries when using MySQL.
# MYSQL_FOUND - True if MySQL found.
set_property(GLOBAL
APPEND PROPERTY COMPILE_DEFINITIONS -DMYDDAS_MYSQL=1)
2016-08-01 12:54:28 +01:00
if (WIN32)
2018-06-28 12:48:29 +01:00
add_library(YAPmysql OBJECT ${MYSQL_SOURCES})
2016-08-01 12:54:28 +01:00
else()
2018-06-28 12:48:29 +01:00
add_lib(YAPmysql ${MYSQL_SOURCES})
target_link_libraries(YAPmysql ${MYSQL_LIBRARIES} libYap)
install(TARGETS YAPmysql
2017-12-05 15:14:57 +00:00
RUNTIME DESTINATION ${YAP_INSTALL_DLLDIR}
ARCHIVE DESTINATION ${YAP_INSTALL_DLLDIR}
LIBRARY DESTINATION ${YAP_INSTALL_DLLDIR}
2016-08-01 12:54:28 +01:00
)
endif()
include_directories(${MYSQL_INCLUDE_DIR} ..)
2018-06-28 12:48:29 +01:00
set_target_properties(YAPmysql PROPERTIES
POSITION_INDEPENDENT_CODE ON
PREFIX ""
)
list (APPEND MYDDAS_FLAGS -DMYDDAS_MYSQL=1)
set (MYDDAS_FLAGS ${MYDDAS_FLAGS} ON PARENT_SCOPE)
set_property(GLOBAL APPEND PROPERTY COMPILE_DEFINITIONS
-DMYDDAS_MYSQL=1)
2016-08-01 12:54:28 +01:00
else ()
add_definitions(-DMYDDAS_MYSQL=0)
2016-01-03 02:06:09 +00:00
endif (MYSQL_FOUND)
cmake_dependent_option(USE_MYDDAS_top_level
"enable the MYDDAS top-level (REPL) support for MySQL" OFF
'USE_MYDDAS AND MYSQL_FOUND' OFF)
#TODO: