1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456
|
#
# Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
#
# The MySQL Connector/C++ is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptions to the terms and
# conditions of the GPLv2 as it is applied to this software, see the
# FLOSS License Exception
# <http://www.mysql.com/about/legal/licensing/foss-exception.html>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
PROJECT(MYSQLCPPCONN)
cmake_minimum_required(VERSION 2.6.2)
IF(COMMAND cmake_policy AND POLICY CMP0015)
cmake_policy(SET CMP0015 NEW)
ENDIF(COMMAND cmake_policy AND POLICY CMP0015)
INCLUDE(VersionInfo.cmake)
OPTION(TAR_LAYOUT "Use directory layout for an unpacked TAR install")
OPTION(RPM_LAYOUT "Use directory layout for an RPM install")
IF(TAR_LAYOUT OR NOT CMAKE_VERSION OR CMAKE_VERSION VERSION_LESS "2.8.5")
SET(INSTALL_LIBDIR lib)
ELSE()
INCLUDE(GNUInstallDirs)
SET(INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
ENDIF()
SET(EDIT_WARNING_MESSAGE "Please do not edit this file - it is generated by cmake. Edit its source file instead.")
# Configuring header file with driver version info
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/driver/version_info.h.cmake
${CMAKE_BINARY_DIR}/driver/version_info.h @ONLY)
# This is needed by windows installer and fro CPACK
IF(EXISTS "${CMAKE_SOURCE_DIR}/COPYING")
SET(LICENSE_FILENAME "${CMAKE_SOURCE_DIR}/COPYING")
ELSE(EXISTS "${CMAKE_SOURCE_DIR}/COPYING")
SET(LICENSE_FILENAME "${CMAKE_SOURCE_DIR}/LICENSE.mysql")
ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/COPYING")
# Creating file with version info that will be used for installer
# We have to do this trick because of license filename that is looked in this CMAKE_SOURCE_DIR (installer's cmake is run separately)
IF(WIN32)
FILE(WRITE "${CMAKE_BINARY_DIR}/win/config.cmake" "SET(CONNECTOR_PRODUCT_VERSION ${CONNECTOR_VERSION})\n"
"SET(LICENSE_FILENAME \"${LICENSE_FILENAME}\")\n")
ENDIF(WIN32)
#-----------------
# CPPFLAGS, CXXFLAGS and LDFLAGS from the environment
SET(FreeBSD11Up False)
if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND
CMAKE_SYSTEM_VERSION GREATER "10")
SET(FreeBSD11Up True)
endif()
# c++11 enabled by default only for FreeBSD 11 and up
OPTION(CMAKE_ENABLE_C++11 "Build Connector using c++11" ${FreeBSD11Up})
IF(CMAKE_ENABLE_C++11)
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
IF(COMPILER_SUPPORTS_CXX11)
MESSAGE(STATUS "Compiler supports C++11. Adding -std=c++11 flags")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSEIF(COMPILER_SUPPORTS_CXX0X)
MESSAGE(STATUS "Compiler supports C++11. Adding -std=c++0x flag.")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
ELSE()
MESSAGE(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} doesn't support C++11. Please use a different compiler.")
ENDIF(COMPILER_SUPPORTS_CXX11)
ENDIF(CMAKE_ENABLE_C++11)
#
# Configure static runtime library on Windows if requested
#
option(STATIC_MSVCRT "Use static MSVC runtime library" OFF)
if(WIN32)
IF(STATIC_MSVCRT)
message("Using static runtime library")
foreach(LANG C CXX)
set(CMAKE_${LANG}_FLAGS "${CMAKE_${LANG}_FLAGS} /MT")
foreach(TYPE RELEASE RELWITHDEBINFO MINSIZEREL)
set(CMAKE_${LANG}_FLAGS_${TYPE} "${CMAKE_${LANG}_FLAGS_${TYPE}} /MT")
endforeach()
set(CMAKE_${LANG}_FLAGS_DEBUG "${CMAKE_${LANG}_FLAGS_DEBUG} /MTd")
endforeach(LANG)
ELSE(STATIC_MSVCRT)
foreach(LANG C CXX)
set(CMAKE_${LANG}_FLAGS "${CMAKE_${LANG}_FLAGS} /MD")
foreach(TYPE RELEASE RELWITHDEBINFO MINSIZEREL)
set(CMAKE_${LANG}_FLAGS_${TYPE} "${CMAKE_${LANG}_FLAGS_${TYPE}} /MD")
endforeach()
set(CMAKE_${LANG}_FLAGS_DEBUG "${CMAKE_${LANG}_FLAGS_DEBUG} /MDd")
endforeach(LANG)
ENDIF(STATIC_MSVCRT)
endif()
#-----------------
# ICU
SET(MYSQLCPPCONN_ICU_ENABLE 0 CACHE BOOL "development only: search icu although we do not make use of it yet.")
IF(MYSQLCPPCONN_ICU_ENABLE)
SET(MYSQLCPPCONN_ICU_CONFIG_EXECUTABLE)
SET(MYSQLCPPCONN_ICU_LIBRARY)
SET(MYSQLCPPCONN_ICU_INCLUDE)
FIND_PROGRAM (MYSQLCPPCONN_ICU_CONFIG_EXECUTABLE icu-config)
IF (NOT MYSQLCPPCONN_ICU_CONFIG_EXECUTABLE)
SET (MYSQLCPPCONN_ICU_FOUND FALSE)
MESSAGE(STATUS "icu-config not found")
ELSE (NOT MYSQLCPPCONN_ICU_CONFIG_EXECUTABLE)
EXEC_PROGRAM ("${MYSQLCPPCONN_ICU_CONFIG_EXECUTABLE} --ldflags-libsonly"
OUTPUT_VARIABLE MYSQLCPPCONN_ICU_LIBRARY
RETURN_VALUE ERROR_CODE
)
EXEC_PROGRAM ("${MYSQLCPPCONN_ICU_CONFIG_EXECUTABLE} --cppflags-searchpath|sed s/^-I//"
OUTPUT_VARIABLE MYSQLCPPCONN_ICU_INCLUDE
RETURN_VALUE ERROR_CODE
)
EXEC_PROGRAM ("${MYSQLCPPCONN_ICU_CONFIG_EXECUTABLE} --ldflags-searchpath|sed s/^-L//"
OUTPUT_VARIABLE MYSQLCPPCONN_ICU_LDLIB
RETURN_VALUE ERROR_CODE
)
IF (MYSQLCPPCONN_ICU_LIBRARY)
SET (MYSQLCPPCONN_ICU_FOUND TRUE)
ENDIF (MYSQLCPPCONN_ICU_LIBRARY)
MESSAGE(STATUS "ICU::CONFIG: ${MYSQLCPPCONN_ICU_CONFIG_EXECUTABLE}")
MESSAGE(STATUS "ICU::LIBRARY: ${MYSQLCPPCONN_ICU_LIBRARY}")
MESSAGE(STATUS "ICU::INCLUDE: ${MYSQLCPPCONN_ICU_INCLUDE}")
MESSAGE(STATUS "ICU::LDLIB: ${MYSQLCPPCONN_ICU_LDLIB}")
INCLUDE_DIRECTORIES(${MYSQLCPPCONN_ICU_INCLUDE})
LINK_DIRECTORIES(${MYSQLCPPCONN_ICU_LDLIB})
ENDIF (NOT MYSQLCPPCONN_ICU_CONFIG_EXECUTABLE)
ENDIF(MYSQLCPPCONN_ICU_ENABLE)
#-----------------
#-----------------
# BOOST
SET(ENV_BOOST $ENV{BOOST_ROOT})
IF(NOT BOOST_ROOT AND ENV_BOOST)
SET(BOOST_ROOT ${ENV_BOOST})
ENDIF(NOT BOOST_ROOT AND ENV_BOOST)
IF(NOT BOOST_ROOT AND WIN32)
SET(BOOST_ROOT "C:/Program Files/Boost")
ENDIF(NOT BOOST_ROOT AND WIN32)
# Prefer static linking in all cases
SET(Boost_ADDITIONAL_VERSIONS "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39")
SET(Boost_NO_BOOST_CMAKE ON CACHE BOOL "Enable fix for FindBoost.cmake")
SET(MYSQLCPPCONN_BOOST_COMPONENTS thread date_time)
SET(Boost_USE_STATIC_LIBS TRUE)
#FIND_PACKAGE(Boost COMPONENTS ${MYSQLCPPCONN_BOOST_COMPONENTS})
FIND_PACKAGE(Boost)
IF(NOT Boost_FOUND)
# Try dynamic
SET(Boost_USE_STATIC_LIBS FALSE)
FIND_PACKAGE(Boost COMPONENTS ${MYSQLCPPCONN_BOOST_COMPONENTS})
IF(NOT Boost_FOUND)
MESSAGE(FATAL_ERROR "Boost or some of its libraries found. If not in standard place please set -DBOOST_ROOT:STRING=")
ENDIF(NOT Boost_FOUND)
ENDIF(NOT Boost_FOUND)
SET(MYSQLCPPCONN_BOOST_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
SET(MYSQLCPPCONN_BOOST_SYSTEM_LIBS ${Boost_SYSTEM_LIBRARY})
SET(MYSQLCPPCONN_BOOST_THREAD_LIBS ${Boost_THREAD_LIBRARY})
SET(MYSQLCPPCONN_BOOST_LIBRARY_DIRS ${Boost_LIBRARY_DIRS})
INCLUDE_DIRECTORIES(${MYSQLCPPCONN_BOOST_INCLUDE_DIRS})
MESSAGE(STATUS "BOOST_INCLUDE_DIRS=${MYSQLCPPCONN_BOOST_INCLUDE_DIRS}")
#-----------------
IF(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
ENDIF(COMMAND cmake_policy)
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckTypeSize)
#----------------------
# STLPORT - BEGIN
#
SET(MYSQLCPPCONN_STLPORT_ENABLE 0 CACHE BOOL "stlport-enabled")
IF(MYSQLCPPCONN_STLPORT_ENABLE)
MESSAGE(STATUS "Looking for STLPort")
FIND_PATH(STLPORT_INCLUDE_DIR stl_user_config.h
$ENV{STLPORT_INCLUDE_DIR}
/usr/include/stlport
/usr/local/include/stlport)
IF(STLPORT_INCLUDE_DIR)
MESSAGE(STATUS "Using STLPort from : ${STLPORT_INCLUDE_DIR}")
INCLUDE_DIRECTORIES(STLPORT_INCLUDE_DIR)
SET(MYSQLCPPCONN_STLPORT_LIB "stlport")
ELSE(STLPORT_INCLUDE_DIR)
MESSAGE(FATAL_ERROR "STLPORT not found. Please set \$ENV{STLPORT_INCLUDE_DIR} if installed in non-standard location")
ENDIF(STLPORT_INCLUDE_DIR)
# We want to set the inclusion of the library globally
ADD_DEFINITIONS(-library=stlport4) # Not a macro defintion, but CMake manual says I can!! ;)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -library=stlport4")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -library=stlport4")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -library=stlport4")
ELSE(MYSQLCPPCONN_STLPORT_ENABLE)
SET(MYSQLCPPCONN_STLPORT_LIB "")
ENDIF(MYSQLCPPCONN_STLPORT_ENABLE)
#
# STLPORT - END
#----------------------
# Make tests cover methods that throw not implemented to detect API changes?
SET(MYSQLCPPCONN_TEST_NOT_IMPLEMENTED 0 CACHE BOOL "HEAD/trunk QA: invoke methods that should return not implemented to detect API changes")
INCLUDE(${CMAKE_SOURCE_DIR}/FindMySQL.cmake)
SET(MYSQLCLIENT_STATIC_BINDING 1 CACHE BOOL "enable static binding")
IF(MYSQLCLIENT_STATIC_BINDING AND EXISTS "${CMAKE_SOURCE_DIR}/cmake/mysql_version_info.cmake")
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/mysql_version_info.cmake)
IF(NOT LIBMYSQL_CPP_VERSION STREQUAL "")
SET(MYSQL_VERSION "${LIBMYSQL_CPP_VERSION}")
ELSEIF(NOT MYSQL_CPP_SERVER_VERSION STREQUAL "")
SET(MYSQL_VERSION "${MYSQL_CPP_SERVER_VERSION}")
ENDIF(NOT LIBMYSQL_CPP_VERSION STREQUAL "")
STRING(REGEX MATCHALL "([0-9]+.[0-9]+.[0-9]+)" MYSQL_VERSION "${MYSQL_VERSION}")
IF(LIBMYSQL_CPP_VERSION_ID)
SET(MYSQL_NUM_VERSION ${LIBMYSQL_CPP_VERSION_ID})
ELSEIF(MYSQL_CPP_SERVER_VERSION_ID)
SET(MYSQL_NUM_VERSION ${MYSQL_CPP_SERVER_VERSION_ID})
ENDIF(LIBMYSQL_CPP_VERSION_ID)
ENDIF()
OPTION(USE_SERVER_CXXFLAGS "USE MYSQL_CXXFLAGS on connector build" 0)
message(STATUS "USE_SERVER_FLAGS : ${USE_SERVER_CXXFLAGS}")
if (USE_SERVER_CXXFLAGS)
SET(MYSQLCPPCONN_COMPILE_FLAGS_ENV "$ENV{CPPFLAGS} ${MYSQL_CXXFLAGS} $ENV{CXXFLAGS}")
else (USE_SERVER_CXXFLAGS)
SET(MYSQLCPPCONN_COMPILE_FLAGS_ENV "$ENV{CPPFLAGS} $ENV{CXXFLAGS}")
endif(USE_SERVER_CXXFLAGS)
MESSAGE(STATUS "Environment compile flags: ${MYSQLCPPCONN_COMPILE_FLAGS_ENV}")
SET(MYSQLCPPCONN_LINK_FLAGS_ENV "$ENV{LDFLAGS}")
MESSAGE(STATUS "Environment link flags: ${MYSQLCPPCONN_LINK_FLAGS_ENV}")
# Configuring header file with DM version info
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cppconn/version_info.h.cmake
${CMAKE_BINARY_DIR}/cppconn/version_info.h @ONLY)
#
# ----------------------------------------------------------------------
# Create package script
# ----------------------------------------------------------------------
IF(NOT CONNECTOR_PLATFORM)
IF(WIN32)
IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
SET(CONNECTOR_PLATFORM "winx64")
ELSE(CMAKE_SIZEOF_VOID_P MATCHES 8)
SET(CONNECTOR_PLATFORM "win32")
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 8)
ELSE(WIN32)
SET(CONNECTOR_PLATFORM "unknown")
ENDIF(WIN32)
ENDIF(NOT CONNECTOR_PLATFORM)
#CPACK version variables are initialized in VersionInfo.cmake
# Get the part of the package name for this product
IF(MYSQL_SERVER_SUFFIX STREQUAL "-community")
SET(CPACK_SERVER_SUFFIX "")
ELSE(MYSQL_SERVER_SUFFIX STREQUAL "-community")
SET(CPACK_SERVER_SUFFIX ${MYSQL_SERVER_SUFFIX})
ENDIF(MYSQL_SERVER_SUFFIX STREQUAL "-community")
IF(EXTRA_NAME_SUFFIX)
SET(CPACK_PACKAGE_NAME "mysql-connector-c++${EXTRA_NAME_SUFFIX}")
ELSE(EXTRA_NAME_SUFFIX)
SET(CPACK_PACKAGE_NAME "mysql-connector-c++")
ENDIF(EXTRA_NAME_SUFFIX)
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
"Connector/C++, a library for connecting to MySQL servers.")
SET(CPACK_PACKAGE_VENDOR "Oracle and/or its affiliates")
SET(CPACK_RPM_PACKAGE_DESCRIPTION
"The MySQL Connector/C++ is a MySQL database connector for C++. The
MySQL Driver for C++ can be used to connect to the MySQL Server from
C++ applications. The MySQL Driver for C++ mimics the JDBC 4.0 API. It
is recommended to use the connector with MySQL 5.1 or later. Note -
its full functionality is not available when connecting to MySQL 5.0.
The MySQL Driver for C++ cannot connect to MySQL 4.1 or earlier. MySQL
is a trademark of ${CPACK_PACKAGE_VENDOR}
The MySQL software has Dual Licensing, which means you can use the MySQL
software free of charge under the GNU General Public License
(http://www.gnu.org/licenses/). You can also purchase commercial MySQL
licenses from ${CPACK_PACKAGE_VENDOR} if you do not wish to be
QLCPPCONN_VERSION
in the manual for further info.")
SET(CPACK_RESOURCE_FILE_LICENSE "${LICENSE_FILENAME}")
SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${MYSQLCPPCONN_VERSION}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}-${MYSQLCPPCONN_VERSION}-${CONNECTOR_PLATFORM}")
IF(WIN32)
SET(CPACK_GENERATOR "ZIP")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-noinstall-${MYSQLCPPCONN_VERSION}-${CONNECTOR_PLATFORM}")
ELSE(WIN32)
SET(CPACK_GENERATOR "TGZ")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
ENDIF(WIN32)
SET(DOC_DESTINATION ".")
IF(RPM_LAYOUT)
SET(DOC_DESTINATION "share/doc/${CPACK_PACKAGE_NAME}-${MYSQLCPPCONN_VERSION}")
ENDIF()
INSTALL(FILES
${CPACK_RESOURCE_FILE_README}
${CPACK_RESOURCE_FILE_LICENSE}
"${CMAKE_SOURCE_DIR}/Licenses_for_Third-Party_Components.txt"
DESTINATION ${DOC_DESTINATION} OPTIONAL)
SET(COMMON_IGNORE_FILES
"/CMakeFiles/"
"/Testing/"
"/.bzr/"
"_CPack_Packages/"
"~"
".swp"
".log"
".gz"
".directory$"
"CMakeCache.txt"
"Makefile"
"install_manifest.txt"
)
SET(PRJ_COMMON_IGNORE_FILES
${COMMON_IGNORE_FILES}
"ANNOUNCEMENT_102_ALPHA"
"ANNOUNCEMENT_103_ALPHA"
"ANNOUNCEMENT_104_BETA"
"ANNOUNCEMENT_105_GA"
"ANNOUNCEMENT_110_GA"
"ANNOUNCEMENT_111_GA"
"ANNOUNCEMENT_DRAFT"
)
SET(CPACK_SOURCE_IGNORE_FILES
${PRJ_COMMON_IGNORE_FILES}
"cppconn/config.h$"
"cppconn/version_info.h$"
"driver/nativeapi/binding_config.h$"
"driver/version_info.h$"
)
SET(CPACK_PACKAGE_IGNORE_FILES ${PRJ_COMMON_IGNORE_FILES} "something_there" )
SET(CPACK_SOURCE_GENERATOR "TGZ")
SET(MYSQLCPPCONN_GCOV_ENABLE 0 CACHE BOOL "gcov-enabled")
IF(CMAKE_COMPILER_IS_GNUCC)
ADD_DEFINITIONS("-Wall -fPIC -Woverloaded-virtual")
IF (MYSQLCPPCONN_GCOV_ENABLE)
ADD_DEFINITIONS("-fprofile-arcs -ftest-coverage")
ENDIF (MYSQLCPPCONN_GCOV_ENABLE)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
# SET(CPACK_*) before the INCLUDE(CPack)
INCLUDE(CPack)
IF(WIN32)
STRING(REGEX REPLACE "MYSQLCPPCONN" "MySQL/ConnectorCPP" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
ENDIF(WIN32)
MESSAGE(STATUS "Installation path is: ${CMAKE_INSTALL_PREFIX} (overwrite with -DCMAKE_INSTALL_PREFIX=/your/path)")
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/cppconn)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/cppconn)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/driver/nativeapi)
ADD_SUBDIRECTORY(cppconn)
ADD_SUBDIRECTORY(driver)
ADD_SUBDIRECTORY(examples)
IF(DEFINED CMAKE_SYSTEM_NAME AND ${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
# see also README
IF(${CMAKE_C_COMPILER} MATCHES "gcc$")
MESSAGE("NOTE")
MESSAGE("You seem to be using GCC on SunOS.")
MESSAGE("This is not recommended. Compilation")
MESSAGE("might fail due to compile flags")
MESSAGE("returned by the MySQL tool mysql_config.")
MESSAGE("In case of an error, try commenting out:")
MESSAGE("# ADD_DEFINITIONS(\"\${MYSQL_CXXFLAGS}\")")
MESSAGE("in the file FindMySQL.cm")
ENDIF(${CMAKE_C_COMPILER} MATCHES "gcc$")
IF(${CMAKE_C_COMPILER} MATCHES "gcc$")
IF(${CMAKE_CXX_COMPILER} MATCHES "CC$")
MESSAGE("NOTE")
MESSAGE("You seem to be using the GCC C-compiler")
MESSAGE("together with the Sun CC C++-compiler.")
MESSAGE("Linking of the resulting binaries")
MESSAGE("might fail. In case of an error,")
MESSAGE("try using Sun compilers only")
ENDIF(${CMAKE_CXX_COMPILER} MATCHES "CC$")
ELSEIF(${CMAKE_C_COMPILER} MATCHES "cc$" AND ${CMAKE_CXX_COMPILER} MATCHES "[c|g]\\+\\+$")
MESSAGE("NOTE")
MESSAGE("You seem to be using the GCC C-compiler")
MESSAGE("together with the Sun CC C++-compiler.")
MESSAGE("Linking of the resulting binaries")
MESSAGE("might fail. In case of an error,")
MESSAGE("try using Sun compilers only")
ENDIF(${CMAKE_C_COMPILER} MATCHES "gcc$")
ENDIF(DEFINED CMAKE_SYSTEM_NAME AND ${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
INSTALL(FILES "BUILDINFO" DESTINATION . OPTIONAL)
|