Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 8 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
cmake_minimum_required (VERSION 3.10)

# Project name
set (PROJECT_NAME "rkDevelopTool_Mac")

project (${PROJECT_NAME})

# The version number.
set (RKDevelopTool_Mac_PACKAGE_VERSION "1.3")

find_package (PkgConfig REQUIRED)
pkg_check_modules (LIBUSB1 REQUIRED IMPORTED_TARGET libusb-1.0)

file (GLOB LOCAL_CPP_FILES *.cpp)
set (SOURCE_FILES ${SOURCE_FILES} ${LOCAL_CPP_FILES})

file (GLOB LOCAL_H_FILES *.h)
set (HEADER_FILES ${HEADER_FILES} ${LOCAL_H_FILES})

# Set your libusb path
set (libusb_INCLUDE_DIR "/usr/local/Cellar/libusb/1.0.22/include/libusb-1.0/")
set (libusb_STATIC "/usr/local/Cellar/libusb/1.0.22/lib/")

# Set your libiconv path
set (libiconv_INCLUDE_DIR "/usr/local/opt/libiconv/include/")
set (libiconv_STATIC "/usr/local/opt/libiconv/lib/")

cmake_minimum_required (VERSION 2.6)
project (${PROJECT_NAME})


# Turn off build log
# set (CMAKE_VERBOSE_MAKEFILE ON)
Expand All @@ -37,20 +33,11 @@ configure_file (
include_directories (
"${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}"
"${libusb_INCLUDE_DIR}"
"${libiconv_INCLUDE_DIR}"
)

link_directories (
${libusb_STATIC}
${libiconv_STATIC}
)

add_executable (${PROJECT_NAME} ${SOURCE_FILES})

target_link_libraries (
"${PROJECT_NAME}"
"${libusb_STATIC}/libusb-1.0.dylib"
"${libiconv_STATIC}/libiconv.dylib"
PkgConfig::LIBUSB1
)

4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2559,7 +2559,7 @@ bool read_lba(STRUCT_RKDEVICE_DESC &dev, UINT uiBegin, UINT uiLen, char *szFile)
bool bRet, bFirst = true, bSuccess = false;
int iRet;
UINT iTotalRead = 0,iRead = 0;
int nSectorSize = 512;
const int nSectorSize = 512;
BYTE pBuf[nSectorSize * DEFAULT_RW_LBA];
pComm = new CRKUsbComm(dev, g_pLogObject, bRet);
if (bRet) {
Expand Down Expand Up @@ -2931,7 +2931,7 @@ bool write_lba(STRUCT_RKDEVICE_DESC &dev, UINT uiBegin, char *szFile)
long long iTotalWrite = 0, iFileSize = 0;
UINT iWrite = 0, iRead = 0;
UINT uiLen;
int nSectorSize = 512;
const int nSectorSize = 512;
BYTE pBuf[nSectorSize * DEFAULT_RW_LBA];


Expand Down