CMakeLists.txt
cmake_minimum_required (VERSION 3.5)
project (demo)
#set (SRC_LIST ${PROJECT_SOURCE_DIR}/tableInterface/tableInterface.cpp)
aux_source_directory (tableInterface SRC_LIST)
add_library (tableInterface_shared SHARED ${SRC_LIST})
add_library (tableInterface_static STATIC ${SRC_LIST})
set_target_properties (tableInterface_shared PROPERTIES OUTPUT_NAME "tableInterface")
set_target_properties (tableInterface_static PROPERTIES OUTPUT_NAME "tableInterface")
include_directories("/usr/include/mysql")
link_directories("/usr/lib64/mysql")
target_link_libraries(tableInterface_shared -lmysqlclient)
target_link_libraries(tableInterface_static -lmysqlclient)
set (LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)