cmake配使用boost
cmake配使用boost1234567891011# boostlink_directories("/usr/locate/boost/")# find find_package(Boost COMPONENTS json "system" filesystem program_options locale json REQUIRED)if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) MESSAGE( STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}.") MESSAGE( STATUS "Boost_LIBRARIES = ${Boost_LIBRARIES}.") MESSAGE( STATUS "Boost_LIB_VERSION = ${Boost_LIB_VERSION}.&quo ...
/RTC(运行时错误检查)
/RTC(运行时错误检查)语法/RTC1/RTCc/RTCs/RTCu
参数/RTC1等效于 /RTCsu。
/RTCc报告何时向较小的数据类型赋值会导致数据丢失。 例如,它报告 short 类型值 0x0101 是否已分配给类型为 char 的变量。
此选项可以报告你要在什么情况下进行截断。 例如,当需要返回 int 的前 8 位作为 char 时。 由于 /RTCc 在分配导致信息丢失的情况下会导致运行时错误,因此请首先屏蔽所需的信息以避免运行时错误。 例如:
123456789101112#include <crtdbg.h>char get8bits(unsigned value, int position) { _ASSERT(position < 32); return (char)(value >> position); // Try the following line instead: // return (char)((value >> position) & 0xff);}int ...
cmake使用/clr
cmake use /clrThere are three options
(1) Collect the affected source files in dedicated directories with aCMakeLists.txt and remove “-g” from CMAKE_{C,CXX}_FLAGS_DEBUG therein.However, the sources must go into targets defined in the directory’sCMakeLists.txt; maybe, you need to add particular static librariesbuilt from these sources, provided your toolchain supports this.
(2) Externalize the affected sources and reintegrate them as anexternal project built with the same toolchain but different ...
cmake链接boost
cmake链接boost1234567891011121314# boostif(MSVC)# vs会自动链接else() link_directories("/usr/locate/boost") # BOOST 安装位置 find_package(Boost COMPONENTS json system filesystem program_options locale json REQUIRED) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) MESSAGE( STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}.") MESSAGE( STATUS "Boost_LIBRARIES = ${Boost_LIBRARIES}.") MESSAGE( STATUS "Boost_LIB_VERSION = ...
cmake生成后事件
cmake生成后事件使用cmake的add_custom_command复件生成的库到../lib。
12345add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<$<CONFIG:Debug>:./debug/test-d.dll>" # debug "$<$<CONFIG:Release>:./release/test.dll>" # release "../lib")
cmake引入不同版本的库
cmake引入不同版本的库cmake引入不同版本的库
12345678910111213target_link_libraries(${PROJECT_NAME} PRIVATE debug opencv_core440d.lib debug opencv_highgui440d.lib debug opencv_imgproc440d.lib debug opencv_imgcodecs440d.lib debug opencv_video440d.lib debug opencv_videoio440d.lib optimized opencv_core440.lib optimized o ...
qt托盘菜单半透明
qt托盘菜单半透明1234567891011121314151617181920212223242526272829303132QMenu#toptoolbarmenu { padding: 10px 0; border-radius: 15px; background-color: rgba(38, 40, 42, 0.7);}QMenu#toptoolbarmenu::separator { height: 2px; margin: 6px 0; background-color: rgba(255, 255, 255, 1);}QMenu#toptoolbarmenu::icon { padding: 0 0 0 10px;}QMenu#toptoolbarmenu::item { color: white; padding: 3px 10px; font-weight: bold; background-color: transparent;& ...
python遍历目录加水印
python遍历目录加水印12345678910111213141516171819202122232425262728293031323334353637from watermarker.marker import add_markimport osimport shutildef mark(file, outdir, mark = "火苗999℃"): add_mark(file = file, out = outdir, mark = mark #, color = "#000000" , opacity=0.1, angle=30, space=300, size=20) return def mark_dir2(root, out): if not os.path.exists(out): # os.path.isdir(out): os.mkdir(out) files = os.listdir(root) for fname in ...
boost消息队列问题
boost消息队列问题boost消息队列打不开、读取失败。
windows上x64与x86程序创建的消息队列不能互相通信
同为x64读取失败时请注意receive的buffersize要和创建时的maxsize相同。
qt下拉框qss
qt下拉框QComboBox uses the model/view framework for its popup list and to store its items. By default a QStandardItemModel stores the items and a QListView subclass displays the popuplist.
QComboBox 使用模型/视图框架作为其弹出列表并存储其项目。默认情况下,QStandardItemModel 存储项目,QListView 子类显示弹出列表。
qss1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162/*下拉框*/QComboBox{ border-radius: 3px; color: rgb(0,0,0); border: 1px solid #c2c2c2;; padding-top ...