comparison dep/animia/CMakeLists.txt @ 201:8f6f8dd2eb23

dep/animia: finish kvm backend dep/animia: cmake: don't use kvm on unsupported systems, use private and public includes properly cmake: why are we defining target include directories twice?
author paper@DavesDouble.local
date Sun, 19 Nov 2023 19:13:28 -0500
parents e44b7c428d7c
children 71832ffe425a
comparison
equal deleted inserted replaced
169:e44b7c428d7c 201:8f6f8dd2eb23
71 if(LIBUTIL_GOOD) 71 if(LIBUTIL_GOOD)
72 list(APPEND LIBRARIES ${LIBUTIL_LIBRARY}) 72 list(APPEND LIBRARIES ${LIBUTIL_LIBRARY})
73 list(APPEND DEFINES LIBUTIL) 73 list(APPEND DEFINES LIBUTIL)
74 list(APPEND SRC_FILES src/fd/libutil.cc) 74 list(APPEND SRC_FILES src/fd/libutil.cc)
75 endif() # LIBUTIL_GOOD 75 endif() # LIBUTIL_GOOD
76 elseif(LIBKVM_LIBRARY) # BSD libkvm 76 elseif(LIBKVM_LIBRARY) # OpenBSD kvm
77 get_filename_component(LIBKVM_DIR ${LIBKVM_LIBRARY} DIRECTORY) 77 include(CheckSymbolExists)
78 # Check if we can get open files by PID
79 check_symbol_exists(KERN_FILE_BYPID "kvm.h" HAVE_BYPID)
78 80
79 include(CheckLibraryExists) 81 if(HAVE_BYPID)
80 check_library_exists(kvm kvm_getprocs ${LIBKVM_DIR} LIBKVM_GOOD)
81
82 if(LIBKVM_GOOD)
83 list(APPEND LIBRARIES ${LIBKVM_LIBRARY}) 82 list(APPEND LIBRARIES ${LIBKVM_LIBRARY})
84 list(APPEND DEFINES LIBKVM) 83 list(APPEND DEFINES LIBKVM)
85 list(APPEND SRC_FILES src/fd/libkvm.cc) 84 list(APPEND SRC_FILES src/fd/kvm.cc)
86 endif() # LIBUTIL_GOOD 85 endif() # LIBUTIL_GOOD
87 endif() # LINUX 86 endif() # LINUX
88 87
89 # X11 88 # X11
90 find_package(X11 COMPONENTS X11) 89 find_package(X11 COMPONENTS X11)
126 PUBLIC_HEADER include/animia.h 125 PUBLIC_HEADER include/animia.h
127 CXX_STANDARD 17 126 CXX_STANDARD 17
128 ) 127 )
129 128
130 target_compile_definitions(animia PUBLIC ${DEFINES}) 129 target_compile_definitions(animia PUBLIC ${DEFINES})
131 target_include_directories(animia PRIVATE include PUBLIC ${INCLUDE_DIRS}) 130 target_include_directories(animia PUBLIC include PRIVATE ${INCLUDE_DIRS})
132 target_link_libraries(animia PUBLIC ${LIBRARIES}) 131 target_link_libraries(animia PUBLIC ${LIBRARIES})