@@ -64,37 +64,34 @@ elseif(APPLE)
64
64
target_compile_options (clip PRIVATE -fobjc-arc )
65
65
endif ()
66
66
67
- find_library (COCOA_LIBRARY Cocoa )
68
- if (COCOA_LIBRARY )
69
- target_sources (clip PRIVATE clip_osx.mm )
70
- target_link_libraries (clip ${COCOA_LIBRARY} )
71
- else ()
72
- target_sources (clip PRIVATE clip_none.cpp )
73
- endif ()
67
+ find_library (COCOA_LIBRARY REQUIRED Cocoa )
68
+
69
+ target_sources (clip PRIVATE clip_osx.mm )
70
+ target_link_libraries (clip ${COCOA_LIBRARY} )
74
71
elseif (UNIX )
75
72
include (CheckIncludeFiles )
76
73
check_include_files (xcb/xcb.h HAVE_XCB_XLIB_H )
77
74
78
- if (HAVE_XCB_XLIB_H )
79
- target_compile_definitions (clip PRIVATE -DHAVE_XCB_XLIB_H )
80
- target_link_libraries (clip xcb pthread )
81
-
82
- if (CLIP_ENABLE_IMAGE AND CLIP_X11_WITH_PNG )
83
- check_include_files (png.h HAVE_PNG_H )
84
- if (CLIP_X11_PNG_LIBRARY )
85
- set (PNG_LIBRARY ${CLIP_X11_PNG_LIBRARY} )
86
- else ()
87
- find_library (PNG_LIBRARY png )
88
- endif ()
89
- if (HAVE_PNG_H AND PNG_LIBRARY )
90
- target_compile_definitions (clip PRIVATE -DHAVE_PNG_H )
91
- endif ()
92
- target_link_libraries (clip ${PNG_LIBRARY} )
75
+ if (NOT HAVE_XCB_XLIB_H )
76
+ message (FATAL_ERROR "xcb/xcb.h not found, install libxcb-dev package" )
77
+ endif ()
78
+
79
+ target_compile_definitions (clip PRIVATE -DHAVE_XCB_XLIB_H )
80
+ target_link_libraries (clip xcb pthread )
81
+
82
+ if (CLIP_ENABLE_IMAGE AND CLIP_X11_WITH_PNG )
83
+ check_include_files (png.h HAVE_PNG_H )
84
+ if (CLIP_X11_PNG_LIBRARY )
85
+ set (PNG_LIBRARY ${CLIP_X11_PNG_LIBRARY} )
86
+ else ()
87
+ find_library (PNG_LIBRARY png )
88
+ endif ()
89
+ if (HAVE_PNG_H AND PNG_LIBRARY )
90
+ target_compile_definitions (clip PRIVATE -DHAVE_PNG_H )
93
91
endif ()
94
- target_sources (clip PRIVATE clip_x11.cpp )
95
- else ()
96
- target_sources (clip PRIVATE clip_none.cpp )
92
+ target_link_libraries (clip ${PNG_LIBRARY} )
97
93
endif ()
94
+ target_sources (clip PRIVATE clip_x11.cpp )
98
95
else ()
99
96
target_sources (clip PRIVATE clip_none.cpp )
100
97
endif ()
0 commit comments