Skip to content

Commit

Permalink
Only add fmt and cxxopts if tools ON and targets don't exist. (Khrono…
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCallow authored Nov 25, 2023
1 parent fddeaeb commit 84d766a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1041,9 +1041,16 @@ else()
endif()

# Other external projects
set(FMT_SYSTEM_HEADERS ON)
add_subdirectory(other_projects/fmt)
add_subdirectory(other_projects/cxxopts)
# `NOT TARGET`s here are a precaution. They would only be exercised if
# this CMakeLists is included in another project which is unlikely
# except for building the ktx library.
if((KTX_FEATURE_TOOLS OR KTX_FEATURE_TESTS) AND NOT TARGET fmt::fmt)
set(FMT_SYSTEM_HEADERS ON)
add_subdirectory(other_projects/fmt)
endif()
if(KTX_FEATURE_TOOLS AND NOT TARGET cxxopts::cxxopts)
add_subdirectory(other_projects/cxxopts)
endif()

# Tools
if(KTX_FEATURE_TOOLS)
Expand Down

0 comments on commit 84d766a

Please sign in to comment.