[CMake] MySQL++ Configuration

Mathieu Malaterre mathieu.malaterre at gmail.com
Tue Jun 17 07:54:33 EDT 2008


# - Find mysql++

FIND_PATH(MYSQLPP_INCLUDE_PATH mysql++.h /usr/include/mysql++/)

FIND_PATH(MYSQL_INCLUDE_PATH mysql.h /usr/include/mysql/)
IF(MYSQL_INCLUDE_PATH AND MYSQLPP_INCLUDE_PATH)
  SET(MYSQLPP_INCLUDE_DIR
    ${MYSQLPP_INCLUDE_PATH}
    ${MYSQL_INCLUDE_PATH}
  )
ENDIF(MYSQL_INCLUDE_PATH AND MYSQLPP_INCLUDE_PATH)

FIND_LIBRARY(MYSQLPP_LIBRARIES mysqlpp)

IF (MYSQLPP_INCLUDE_DIR AND MYSQLPP_LIBRARIES)
   SET(MYSQLPP_FOUND TRUE)
ELSE (MYSQLPP_INCLUDE_DIR AND MYSQLPP_LIBRARIES)
   SET(MYSQLPP_FOUND FALSE)
ENDIF (MYSQLPP_INCLUDE_DIR AND MYSQLPP_LIBRARIES)

IF(MYSQLPP_FIND_REQUIRED)
  IF(MYSQLPP_FOUND)
  ELSE(MYSQLPP_FOUND)
    MESSAGE(FATAL_ERROR "Could not find mysqlpp")
  ENDIF(MYSQLPP_FOUND)
ENDIF(MYSQLPP_FIND_REQUIRED)


MARK_AS_ADVANCED(MYSQLPP_LIBRARIES MYSQLPP_INCLUDE_DIR)

HTH
-Mathieu

On Mon, Jun 16, 2008 at 10:48 AM, ivan gm <ivan.gm.itk at gmail.com> wrote:
> Hello,
>
> I want to generate a CMakeLists.txt which configures a visual studio 2005
> project with the libraries needed to use MySQL++.
>
> The changes I have to manually do with visual studio properties window are
> the following:
>
> 1. Append the following to 'C/C++::General::Additional Include Directories'
> and add this two:
>     C:\Archivos de programa\MySQL\MySQL Server 5.0\include
>     C:\...\mysql++-3.0.1\lib
> 2. On 'Linker::General::Additional Library Directories':
>     For the 'Debug' configuration:
>        C:\Archivos de programa\MySQL\MySQL Server 5.0\lib\debug
>        C:\...\mysql++-3.0.1\vc2005\Debug
>     For the 'Release' configuration:
>        C:\Archivos de programa\MySQL\MySQL Server 5.0\lib\opt
>        C:\...\mysql++-3.0.1\vc2005\Release
> 3. Under "Linker::Input::Additional Dependencies" add the following:
>     For the 'Debug' configuration:      libmysql.lib wsock32.lib
> mysqlpp_d.lib
>     For the 'Release' configuration:    libmysql.lib wsock32.lib mysqlpp.lib
>
>
> Can anybody help me? Thank you so much.
>
> Yours faithfully.
>
>
> Iván García Martínez.
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
Mathieu


More information about the CMake mailing list