I'm working in a project where I need to use MySQL LIBRARIES. I had success in the past, using a simple makefile where I wrote the specific flags.
CFLAGS+=`mysql_config --cflags`
LIB+=`mysql_config --libs`
However... for my project is required to use a cmakelist and I'm having difficulties with that. I can add GTK libraries with this code:
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED gtk+-3.0)
include_directories(${GTK_INCLUDE_DIRS})
link_directories(${GTK_LIBRARY_DIRS})
target_link_libraries( cgm ${GTK_LIBRARIES} )
but for MySQL I'm in trouble. I tried many things unsuccessfully, but I believe that is similar to the GTK example. Can anyone help me with this problem?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…