--- mysql-connector-odbc-5.3.13-src/CMakeLists.txt 2019-04-16 00:56:34.000000000 +0800 +++ mysql-connector-odbc-5.3.13-src_arm/CMakeLists.txt 2019-08-28 11:42:59.514993586 +0800 @@ -56,6 +56,33 @@ endmacro() endif() #----------------------------------------------------- +if(PLAT_ARM64) + # this one is important + SET(CMAKE_SYSTEM_NAME Linux) + #this one not so much + SET(CMAKE_SYSTEM_VERSION 1) + # this is install root directory + SET(CMAKE_INSTALL_PREFIX /usr) + + # specify the cross compiler + SET(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) + SET(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) + SET(CMAKE_STRIP aarch64-fsl-linux-strip) + + # specify the cross compile and link flags + set(CMAKE_C_FLAGS "--sysroot=$ENV{SDKTARGETSYSROOT}") + set(CMAKE_SHARED_LINKER_FLAGS "--sysroot=$ENV{SDKTARGETSYSROOT}") + SET(CMAKE_LIBRARY_PATH $ENV{SDKTARGETSYSROOT}/usr/lib) + + # where is the target environment + SET(CMAKE_FIND_ROOT_PATH ${SDKTARGETSYSROOT}) + + # search for programs in the build host directories + SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + # for libraries and headers in the target directories + SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() FIND_PACKAGE(Threads)