Mercurial > minori
comparison dep/animia/CMakeLists.txt @ 212:6b08fbd7f206
chore: merge branches
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 07 Jan 2024 09:54:50 -0500 |
parents | 71832ffe425a |
children | 8a482049b968 |
comparison
equal
deleted
inserted
replaced
211:7cf53145de11 | 212:6b08fbd7f206 |
---|---|
70 if(LIBUTIL_GOOD) | 70 if(LIBUTIL_GOOD) |
71 list(APPEND LIBRARIES ${LIBUTIL_LIBRARY}) | 71 list(APPEND LIBRARIES ${LIBUTIL_LIBRARY}) |
72 list(APPEND DEFINES LIBUTIL) | 72 list(APPEND DEFINES LIBUTIL) |
73 list(APPEND SRC_FILES src/fd/libutil.cc) | 73 list(APPEND SRC_FILES src/fd/libutil.cc) |
74 endif() # LIBUTIL_GOOD | 74 endif() # LIBUTIL_GOOD |
75 elseif(LIBKVM_LIBRARY) # BSD libkvm | 75 elseif(LIBKVM_LIBRARY) # OpenBSD kvm |
76 list(APPEND LIBRARIES ${LIBKVM_LIBRARY}) | |
77 list(APPEND DEFINES LIBKVM) | |
78 list(APPEND SRC_FILES src/fd/kvm.cc) | |
79 | |
76 get_filename_component(LIBKVM_DIR ${LIBKVM_LIBRARY} DIRECTORY) | 80 get_filename_component(LIBKVM_DIR ${LIBKVM_LIBRARY} DIRECTORY) |
77 | 81 |
78 include(CheckLibraryExists) | 82 include(CheckLibraryExists) |
79 check_library_exists(kvm kvm_getprocs ${LIBKVM_DIR} LIBKVM_GOOD) | 83 check_library_exists(kvm kvm_getfiles ${LIBKVM_DIR} LIBKVM_HAS_GETFILES) |
80 | 84 |
81 if(LIBKVM_GOOD) | 85 if(LIBKVM_HAS_GETFILES) |
82 list(APPEND LIBRARIES ${LIBKVM_LIBRARY}) | 86 list(APPEND DEFINES HAVE_KVM_GETFILES) |
83 list(APPEND DEFINES LIBKVM) | 87 endif() # LIBKVM_HAS_GETFILES |
84 list(APPEND SRC_FILES src/fd/libkvm.cc) | |
85 endif() # LIBUTIL_GOOD | |
86 endif() # LINUX | 88 endif() # LINUX |
87 | 89 |
88 # X11 | 90 # X11 |
89 find_package(X11 COMPONENTS X11 XRes) | 91 find_package(X11 COMPONENTS X11 XRes) |
90 | 92 |
106 find_package(PkgConfig) | 108 find_package(PkgConfig) |
107 if(PKG_CONFIG_FOUND) | 109 if(PKG_CONFIG_FOUND) |
108 pkg_check_modules(X11 x11) | 110 pkg_check_modules(X11 x11) |
109 if(X11_FOUND) | 111 if(X11_FOUND) |
110 # Check for XRes the hard way | 112 # Check for XRes the hard way |
111 find_path(X11_XRes_HEADER "extensions/XRes.h" PATHS ${X11_INCLUDE_DIRS}) | 113 find_path(X11_XRes_HEADER "X11/extensions/XRes.h" PATHS ${X11_INCLUDE_DIRS}) |
112 find_library(X11_XRes_LIB XRes ${X11_LIBRARY_DIRS}) | 114 find_library(X11_XRes_LIB XRes PATHS ${X11_LIBRARY_DIRS}) |
113 | 115 |
114 if(X11_XRes_HEADER AND X11_XRes_LIB) | 116 if(X11_XRes_HEADER AND X11_XRes_LIB) |
115 # TODO: We should REALLY check for XResQueryClientIds here... | 117 # TODO: We should REALLY check for XResQueryClientIds here... |
116 list(APPEND DEFINES HAVE_XRES) | 118 list(APPEND DEFINES HAVE_XRES) |
117 list(APPEND LIBRARIES ${X11_XRes_LIB}) | 119 list(APPEND LIBRARIES ${X11_XRes_LIB}) |
148 PUBLIC_HEADER include/animia.h | 150 PUBLIC_HEADER include/animia.h |
149 CXX_STANDARD 17 | 151 CXX_STANDARD 17 |
150 ) | 152 ) |
151 | 153 |
152 target_compile_definitions(animia PRIVATE ${DEFINES}) | 154 target_compile_definitions(animia PRIVATE ${DEFINES}) |
153 target_include_directories(animia PRIVATE include PUBLIC ${INCLUDE_DIRS}) | 155 target_include_directories(animia PUBLIC include PRIVATE ${INCLUDE_DIRS}) |
154 target_link_libraries(animia PUBLIC ${LIBRARIES}) | 156 target_link_libraries(animia PUBLIC ${LIBRARIES}) |