Skip to content

Commit

Permalink
included ftdipp lybrary to avoid dependencies (removed boost dependency)
Browse files Browse the repository at this point in the history
  • Loading branch information
lancos committed Jan 6, 2025
1 parent 43d8384 commit d219ea1
Show file tree
Hide file tree
Showing 5 changed files with 942 additions and 51 deletions.
53 changes: 7 additions & 46 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ SET(CURRENT_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})

INCLUDE(FindLibUSB-1.0)


IF(NOT ${LIBUSB_VERSION} LESS "1.0.16")
MESSAGE(STATUS "LibUSB version ${LIBUSB_VERSION}")
ELSE()
Expand Down Expand Up @@ -137,12 +136,7 @@ SET(PONYPROG_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
# SET(PONYPROG_ENABLE_SYMBOL_VISIBILITY_DEFAULT OFF)
# ENDIF(MSVC)

IF (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fno-exceptions")
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-exceptions")
ENDIF()

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-exceptions")

# options for gprof
IF(${USE_PROFILER})
Expand All @@ -158,16 +152,6 @@ ENDIF()



IF(${USE_QT_VERSION} MATCHES "4")
SET(HAVE_QT_PRINTSUPPORT true)
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui REQUIRED)

IF(NOT QT4_FOUND)
MESSAGE(FATAL_ERROR "Qt4 could not be found. "
"If it's INSTALLed in a non-standard location, specify the path to qmake in QT_QMAKE_EXECUTABLE. "
"You can do it in interactive mode (ccmake instead of cmake) or using -DVAR=VAL syntax.")
ENDIF()
ELSE()
FIND_PACKAGE(Qt5 COMPONENTS Core PrintSupport Gui Widgets Multimedia REQUIRED QUIET)

IF(NOT Qt5Widgets_FOUND)
Expand All @@ -185,19 +169,18 @@ ELSE()
MESSAGE(FATAL_ERROR "Qt5 Multimedia development files are not found. "
"Qt5Multimedia development package is to install.")
ENDIF(NOT Qt5Multimedia_FOUND)
ENDIF()

IF (NOT WIN32)
FIND_PACKAGE ( LibFTDI1 NO_MODULE REQUIRED )

IF(NOT LibFTDI1_FOUND)
MESSAGE(FATAL_ERROR "LibFTDI1 files are not found. "
"LibFTDI1 and LibFTDIPP1 development packages are to install.")
"need to install LibFTDI1 development packages.")
ENDIF(NOT LibFTDI1_FOUND)

INCLUDE ( ${LIBFTDI_USE_FILE} )
ELSE()
SET ( BOOST_DIR "C:/Libraries/boost_1_77_0" )
SET ( BOOST_DIR "C:/Libraries/boost_1_83_0" )
SET ( LIBFTDI_ROOT_DIR "C:/libftdi1-1.5_devkit_x86_x64_19July2020" )

SET ( LIBFTDI_LIBRARY "ftdi1" )
Expand All @@ -218,16 +201,11 @@ INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS})
# for this feature install debhelper or
SET(PONYPROG_CPACK_PACKAGE_SHLIBDEPS ON)

IF(${USE_QT_VERSION} MATCHES "4")
INCLUDE_DIRECTORIES(${QT_INCLUDES})
MESSAGE(STATUS "QT_INCLUDES ${QT_INCLUDES}")
ELSE()
INCLUDE_DIRECTORIES(${QT_INCLUDES} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS})

#MESSAGE(STATUS "QT_INCLUDES ${QT_INCLUDES} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Multimedia_INCLUDE_DIRS}")

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS} ${Qt5Multimedia_EXECUTABLE_COMPILE_FLAGS} ${Qt5PrintSupport_EXECUTABLE_COMPILE_FLAGS}")
ENDIF()

configure_file (
"${PROJECT_SOURCE_DIR}/SrcPony/version-cmake.h.in"
Expand All @@ -245,17 +223,10 @@ ADD_SUBDIRECTORY(SrcPony)
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/qhexedit2/src/ ${CMAKE_CURRENT_SOURCE_DIR}/SrcPony/ )


IF(${USE_QT_VERSION} MATCHES "4")
# QT4_ADD_TRANSLATION(APP_TRANSLATIONS ${TRANSLATION})
QT4_WRAP_CPP(APP_HEADERS_MOC ${HEX_HEADERS} ${PONY_HEADERS} )
QT4_WRAP_UI(APP_FORMS_HEADERS ${PONY_FORMS} )
QT4_ADD_RESOURCES(APP_RESOURCES_RCC ${APP_RESOURCES})
ELSE()
# QT5_ADD_TRANSLATION(APP_TRANSLATIONS ${TRANSLATION})
QT5_WRAP_CPP(APP_HEADERS_MOC ${HEX_HEADERS} ${PONY_HEADERS} )
QT5_WRAP_UI(APP_FORMS_HEADERS ${PONY_FORMS} )
QT5_ADD_RESOURCES(APP_RESOURCES_RCC ${APP_RESOURCES})
ENDIF()


MESSAGE(STATUS "PONY_RESOURCES ${APP_RESOURCES_RCC}")
Expand All @@ -281,13 +252,7 @@ ELSE()
ADD_DEFINITIONS(${QT_DEFINITIONS} -DQT_DEBUG)
ENDIF()


IF(${USE_QT_VERSION} MATCHES "4")
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS} -DNO_QT3SUPPORT -DDISABLE_QT3SUPPORT -DQT_PROJECT)
ELSE()
ADD_DEFINITIONS(${Qt5Widgets_DEFINITIONS} ${Qt5PrintSupport_DEFINITIONS} ${Qt5Multimedia_DEFINITIONS} -DQT_PROJECT)
ENDIF()
ADD_DEFINITIONS(${Qt5Widgets_DEFINITIONS} ${Qt5PrintSupport_DEFINITIONS} ${Qt5Multimedia_DEFINITIONS} -DQT_PROJECT)

IF(WIN32)
ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
Expand All @@ -304,15 +269,11 @@ ADD_EXECUTABLE(${CMAKE_PROJECT_NAME}
)


IF(${USE_QT_VERSION} MATCHES "4")
TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME} ${QT_LIBRARIES})
ELSE()
TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME} ${QT_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Multimedia_LIBRARIES} ${Qt5PrintSupport_LIBRARIES})
#MESSAGE(STATUS "QT LIBRARIES: ${QT_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Multimedia_LIBRARIES} ${Qt5PrintSupport_LIBRARIES} ${Qt5Core_LIBRARIES}")
ENDIF()
TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME} ${QT_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Multimedia_LIBRARIES} ${Qt5PrintSupport_LIBRARIES})
#MESSAGE(STATUS "QT LIBRARIES: ${QT_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Multimedia_LIBRARIES} ${Qt5PrintSupport_LIBRARIES} ${Qt5Core_LIBRARIES}")

#TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME} ${LIBFTDI_LIBRARIES} )
TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME} ${LIBFTDIPP_LIBRARY} ${LIBFTDI_LIBRARY} ${LIBUSB_LIBRARIES})
TARGET_LINK_LIBRARIES(${CMAKE_PROJECT_NAME} ${LIBFTDI_LIBRARY} ${LIBUSB_LIBRARIES})

ADD_CUSTOM_TARGET (tags
COMMAND ctags -R -f tags ${CMAKE_SOURCE_DIR}/SrcPony
Expand Down
2 changes: 2 additions & 0 deletions SrcPony/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#CMakeLists.txt

SET(PONY_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/aboutmdlg.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ftdi.cpp
${CMAKE_CURRENT_SOURCE_DIR}/usbwatcher.cpp
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Translator.cpp
Expand Down Expand Up @@ -84,6 +85,7 @@ SET(PONY_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/aboutmdlg.cpp
SET(PONY_NOMOC_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/e2app.h
${CMAKE_CURRENT_SOURCE_DIR}/e2awinfo.h
${CMAKE_CURRENT_SOURCE_DIR}/ftdi.hpp
${CMAKE_CURRENT_SOURCE_DIR}/Translator.h
${CMAKE_CURRENT_SOURCE_DIR}/globals.h
${CMAKE_CURRENT_SOURCE_DIR}/device.h
Expand Down
Loading

0 comments on commit d219ea1

Please sign in to comment.