[CMake] works when I build using XCode, but not with CMake makefile

Peter Steinbach steinbach at scionics.de
Tue Sep 6 08:20:18 EDT 2016


Aaron,

it's about the way that you compile your binary and link libmysqlclient 
into it. I guess (@all: please correct me if I am wrong) as I don't know 
how you use cmake to build your libraries/binaries, that you don't set 
the rpath of libmysqlclient inside your binary. Doing so will ensure 
that the absolute path of libmysqlclient is stored into your binary, so 
that the runtime environment can pick it up and use (keeping fingers 
crossed that the path is still valid). The alternative to doing so, is 
linking against the static version of libmysqlclient (which comes at a 
cost on another front as well).

Best,
P


More information about the CMake mailing list