update cmakelists

This commit is contained in:
2022-03-16 08:25:58 +08:00
parent b3b5fc7f23
commit 9cd60f736f

View File

@@ -74,6 +74,18 @@ endif()
aux_source_directory(tool SHOWME_SRC)
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
# 还没弄好
elseif(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
# 设置X11的地址
include_directories(/opt/homebrew/include)
# 链接动态库
find_library(X_LIBRARY X11 /opt/homebrew/lib)
# 添加可执行文件
add_executable(showme_triangle ${SHOWME_SRC})
target_link_libraries(showme_triangle PUBLIC ${X_LIBRARY})
# 命令行工具安装命令
install(TARGETS showme_triangle RUNTIME DESTINATION sbin)
else()
# 设置X11的地址
include_directories(/opt/X11/include)