Skip to content

Commit

Permalink
Keep libconfig++ header check from being called on Windows.
Browse files Browse the repository at this point in the history
vcpkg doesn't set the variable, it seems.
  • Loading branch information
kristomu committed Jul 31, 2024
1 parent 6de9988 commit 301b0c4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@ endif()

# External library requirements

# Config++ uses another package on Windows.
# vcpkg uses another package for Config++.
if (MSVC)
find_package(libconfig REQUIRED)
add_library(config++ ALIAS libconfig::libconfig++)
else()
find_package(Config++ REQUIRED)

if (NOT EXISTS "${CONFIG++_INCLUDE_DIR}/libconfig.h++")
message(FATAL_ERROR "Could not find libconfig++ header file!")
endif()
endif()

find_package(GLPK REQUIRED)
Expand All @@ -70,10 +74,6 @@ find_library(GETOPT_LIB getopt)

include_directories(${Boost_INCLUDE_DIRS})

if (NOT EXISTS "${CONFIG++_INCLUDE_DIR}/libconfig.h++")
message(FATAL_ERROR "Could not find libconfig++ header file!")
endif()

# Internal functionality groupings. Not all programs need all the
# functionality: in particular, the yee/BR program doesn't need the
# gen_custom_function search and vice versa.
Expand Down

0 comments on commit 301b0c4

Please sign in to comment.