@@ -2056,8 +2056,8 @@ else() # WIN and Linux:
20562056endif ()
20572057
20582058set_target_properties (SerialPrograms PROPERTIES LINKER_LANGUAGE CXX)
2059- target_link_libraries (SerialPrograms Qt${QT_MAJOR} ::Widgets Qt${QT_MAJOR} ::SerialPort Qt${QT_MAJOR} ::Multimedia Qt${QT_MAJOR} ::MultimediaWidgets)
2060- target_link_libraries (SerialPrograms Threads::Threads)
2059+ target_link_libraries (SerialPrograms PRIVATE Qt${QT_MAJOR} ::Widgets Qt${QT_MAJOR} ::SerialPort Qt${QT_MAJOR} ::Multimedia Qt${QT_MAJOR} ::MultimediaWidgets)
2060+ target_link_libraries (SerialPrograms PRIVATE Threads::Threads)
20612061
20622062#add defines
20632063target_compile_definitions (SerialPrograms PRIVATE NOMINMAX)
@@ -2107,7 +2107,7 @@ if (MSVC)
21072107 MAP_IMPORTED_CONFIG_MINSIZEREL RELEASE
21082108 )
21092109
2110- target_link_libraries (SerialPrograms tesseractPA.lib OpenCV_lib Sleepy.lib dpp_lib)
2110+ target_link_libraries (SerialPrograms PRIVATE tesseractPA.lib OpenCV_lib Sleepy.lib dpp_lib)
21112111 target_compile_definitions (SerialPrograms PRIVATE PA_TESSERACT PA_SLEEPY PA_DPP _CRT_SECURE_NO_WARNINGS)
21122112
21132113 target_compile_options (SerialPrograms PRIVATE /FAs /FaAssembly/ /MP /W4 /WX /utf-8)
@@ -2137,7 +2137,7 @@ else()
21372137 # pkg_search_module(OPENCV REQUIRED opencv)
21382138 include_directories (${OpenCV_INCLUDE_DIRS} )
21392139 link_directories (${OpenCV_LIBRARY_DIRS} )
2140- target_link_libraries (SerialPrograms ${OpenCV_LIBS} )
2140+ target_link_libraries (SerialPrograms PRIVATE ${OpenCV_LIBS} )
21412141
21422142 #we hope to use our own Tesseract build in future so we can rid that dependency
21432143 #but right now to run on Linux and Mac we need to use external Tesseract library
@@ -2150,8 +2150,8 @@ else()
21502150 include_directories (${LEPTONICA_INCLUDE_DIRS} )
21512151 link_directories (${TESSERACT_LIBRARY_DIRS} )
21522152 link_directories (${LEPTONICA_LIBRARY_DIRS} )
2153- target_link_libraries (SerialPrograms ${TESSERACT_LINK_LIBRARIES} )
2154- target_link_libraries (SerialPrograms ${LEPTONICA_LINK_LIBRARIES} )
2153+ target_link_libraries (SerialPrograms PRIVATE ${TESSERACT_LINK_LIBRARIES} )
2154+ target_link_libraries (SerialPrograms PRIVATE ${LEPTONICA_LINK_LIBRARIES} )
21552155 endif ()
21562156
21572157 # enable dpp integration
@@ -2162,7 +2162,7 @@ else()
21622162 INTERFACE_COMPILE_DEFINITIONS "PA_DPP"
21632163 INTERFACE_LINK_LIBRARIES "-L/opt/homebrew/lib -lssl -lcrypto -lopus -lsodium -lz" # add dpp's deps
21642164 )
2165- target_link_libraries (SerialPrograms libdpp)
2165+ target_link_libraries (SerialPrograms PRIVATE libdpp)
21662166 endif ()
21672167
21682168 # Add -Wno-c11-extensions to avoid clang gives
@@ -2174,7 +2174,7 @@ else()
21742174 if (WIN32 )
21752175 elseif (APPLE )
21762176 # on macOS, need this framework to query OS API to control display sleep and system sleep behavior
2177- target_link_libraries (SerialPrograms "-framework IOKit -framework CoreFoundation" )
2177+ target_link_libraries (SerialPrograms PRIVATE "-framework IOKit -framework CoreFoundation" )
21782178 elseif (UNIX )
21792179 endif ()
21802180
@@ -2271,3 +2271,5 @@ file(GLOB MY_DLLS
22712271)
22722272file (COPY ${MY_DLLS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR} )
22732273endif ()
2274+
2275+ qt_finalize_target(SerialPrograms)
0 commit comments