diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6048f86..2e32a6d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -72,15 +72,21 @@ endif() # 设定源文件文件夹 aux_source_directory(tool SHOWME_SRC) -# 设置X11的地址 -include_directories(/opt/X11/include) -# 添加可执行文件 -add_executable(showme_triangle ${SHOWME_SRC}) -# 链接动态库 -find_library(X_LIBRARY X11 /opt/X11/lib) -target_link_libraries(showme_triangle PUBLIC ${X_LIBRARY}) -# 命令行工具安装命令 -install(TARGETS showme_triangle RUNTIME DESTINATION sbin) +if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux") + # 还没弄好 +else() + # 设置X11的地址 + include_directories(/opt/X11/include) + # 链接动态库 + find_library(X_LIBRARY X11 /opt/X11/lib) + + # 添加可执行文件 + add_executable(showme_triangle ${SHOWME_SRC}) + target_link_libraries(showme_triangle PUBLIC ${X_LIBRARY}) + + # 命令行工具安装命令 + install(TARGETS showme_triangle RUNTIME DESTINATION sbin) +endif() # 以下部分为例子程序的编译 # 添加可执行文件