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)