If you want to cross-compile with CMake, you really need to use a tool binding file for this. See the CMake Wiki for an introduction. To use third-party libraries (i.e., not included in the cross-compilation toolchain), you also need to cross-compile them.
. toolchain buildroot, CMake. -DCMAKE_TOOLCHAIN_FILE=/home/username/projects/buildroot/output/toolchainfile.cmake CMake. CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMakeLists.txt. , CMAKE_CXX_FLAGS CMAKE_EXE_LINKER_FLAGS .
, sqlite3 buildroot, , . :
find_path(SQLITE3_INCLUDE_DIR sqlite3.h)
find_library(SQLITE3_LIBRARY sqlite3)
if(NOT SQLITE3_INCLUDE_DIR)
message(SEND_ERROR "Failed to find sqlite3.h")
endif()
if(NOT SQLITE3_LIBRARY)
message(SEND_ERROR "Failed to find the sqlite3 library")
endif()
find_package(Threads REQUIRED)
# ...
target_link_libraries(complex
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${SQLITE3_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
rt)
, CMAKE_CXX_FLAGS -O3. -DCMAKE_BUILD_TYPE=Release .