cmake_minimum_required(VERSION 2.8.12) set(CMAKE_BUILD_TYPE Debug) set(STATIC_EMBEDDED TRUE) include(CheckFunctionExists) include(CheckLibraryExists) include(CheckIncludeFiles) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") find_package(PCRE) find_package(MySQL) include_directories(${MYSQL_HEADERS}) include_directories(${MYSQL_HEADERS}/private) include_directories(${MYSQL_HEADERS}/private/atomic) include_directories(${MYSQL_HEADERS}/psi) include_directories(${MYSQL_HEADERS}/..) add_library(test_lib lib.cc) add_executable(test_main test.cc) target_link_libraries(test_main test_lib ${EMBEDDED_LIB} pthread z m rt ssl crypt crypto dl pcre aio lzma) file(COPY ${ERRMSG} DESTINATION ${CMAKE_BINARY_DIR})