From 9cd60f736f5d8003a6478561d2eb2b35fd5f6f9f Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Wed, 16 Mar 2022 08:25:58 +0800 Subject: [PATCH] update cmakelists --- src/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2e32a6d..2a75363 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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)