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) aux_source_directory(tool SHOWME_SRC)
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux") 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() else()
# X11 # X11
include_directories(/opt/X11/include) include_directories(/opt/X11/include)