Skip to content

Instantly share code, notes, and snippets.

@C0nsultant
Created September 19, 2017 13:42
Show Gist options
  • Save C0nsultant/3644307812e4ca9bf0d9225f3ffa830a to your computer and use it in GitHub Desktop.
Save C0nsultant/3644307812e4ca9bf0d9225f3ffa830a to your computer and use it in GitHub Desktop.
Manually lniking static libraries in CMake
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
PROJECT(Code)
ADD_LIBRARY(libmysqlcppconn STATIC IMPORTED)
SET_PROPERTY(TARGET libmysqlcppconn PROPERTY IMPORTED_LOCATION /usr/lib/libmysqlcppconn.so.7)
ADD_EXECUTABLE(exec main.cpp)
TARGET_LINK_LIBRARIES(exec libmysqlcppconn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment