Peter,
In XCode I have this list of "settings" that includes
"Other Linker Flags" that I have set to "-lmysqlclient -lpthread -lm -lz"
and
"Other C++ Flags" that I have set to "-L/Applications/MAMP/Library/lib
-lmysqlclient -lpthread -lz"

Maybe these explain why things work when I build with XCode, but not with
CMake.

In my CMakeLists.txt file I included:
set( CMAKE_CXX_FLAGS  "-L/Applications/MAMP/Library/lib -lmysqlclient
-lpthread -lz" )
set( CMAKE_EXE_LINKER_FLAGS  "-lmysqlclient -lpthread -lm -lz" )

but when I run the make it always says it is ignoring these (e.g. "warning:
argument unused during compilation: '-L/Applications/MAMP/Library/lib'").

Thanks again for you help.
Aaron





On Tue, Sep 6, 2016 at 2:20 PM, Peter Steinbach <steinb...@scionics.de>
wrote:

> 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
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to