Skip to content

Commit

Permalink
Move calls to find_package to where they're required
Browse files Browse the repository at this point in the history
  • Loading branch information
imwints committed Nov 26, 2023
1 parent ed0fa34 commit ebbb769
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ if(BTOP_STATIC)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
find_package(devstat REQUIRED)
find_package(kvm REQUIRED)
if(BTOP_STATIC)
find_package(elf REQUIRED)
endif()
endif()

include(CheckCXXCompilerFlag)
include(CheckIPOSupported)

Expand Down Expand Up @@ -153,8 +145,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
target_link_libraries(btop PRIVATE $<LINK_LIBRARY:FRAMEWORK,CoreFoundation)
target_link_libraries(btop PRIVATE $<LINK_LIBRARY:FRAMEWORK,IOKit)
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
find_package(devstat REQUIRED)
find_package(kvm REQUIRED)
target_link_libraries(btop PRIVATE devstat::devstat kvm::kvm)
if(BTOP_STATIC)
find_package(elf REQUIRED)
target_link_libraries(btop PRIVATE elf::elf)
endif()
endif()
Expand Down

0 comments on commit ebbb769

Please sign in to comment.