How to disable generation of shared objects (.so's) of a third-party library(mysql) which uses cmake
I am trying to build MySql Connector C(6.0.2) from source and the default build exports .so
's in addition to the static libraries(.a
's). I wanted to suppress the generation of the .so
's and t开发者_如何学运维ried setting BUILD_SHARED_LIBS
to OFF
(which didn't work). Also tried setting CMAKE_LIBRARY_OUTPUT_DIRECTORY
to /dev/null
(which didn't work either). Does any one have any suggestions on how to get around this issue?
I am using cmake-2.8.4(on Ubuntu) and my cmake invocation looks something like this:
cmake -G "Unix Makefiles"
-DCMAKE_INSTALL_PREFIX=/path/to/install/root/
-DCMAKE_C_FLAGS="-m64"
-DBUILD_SHARED_LIBS:BOOL=OFF
[-DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=/dev/null]
Just grep for ADD_LIBRARY in CMakeLists.txt files and comment out the one that adds shared target
精彩评论