Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New CMake module to locate libconfig++
The current code to locate libconfig++ has some trouble: - It is located in the main CMakeList file but should be a module of its own - It depends on pkg-config which is not available on Windows - The returned values are not really useful therefore the library name is hard coded This commit tries to solve these problems. For a Unix-like system there should be no difference. Additionally, you can override the variables on the command line which is useful for builds on Windows.
- Loading branch information
Showing
2 changed files
with
27 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Find the libconfig++ includes and library | ||
# | ||
# This module defines | ||
# LIBCONFIG++_INCLUDE_DIR, where to find libconfig++ include files, etc. | ||
# LIBCONFIG++_LIBRARy, the library to link against to use libconfig++. | ||
# LIBCONFIG++_FOUND, If false, do not try to use libconfig++. | ||
|
||
# also defined, but not for general use are | ||
# LIBCONFIG++_LIBRARY, where to find the libconfig++ library. | ||
|
||
set(LIBCONFIG++_FOUND TRUE) | ||
|
||
find_path(LIBCONFIG++_INCLUDE_DIR libconfig.h++) | ||
|
||
find_library(LIBCONFIG++_LIBRARY config++) | ||
|
||
if (LIBCONFIG++_INCLUDE_DIR AND LIBCONFIG++_LIBRARY) | ||
set(LIBCONFIG++_FOUND TRUE) | ||
endif (LIBCONFIG++_INCLUDE_DIR AND LIBCONFIG++_LIBRARY) | ||
|
||
# Use the default CMake facilities for handling QUIET/REQUIRED. | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(LLVM | ||
REQUIRED_VARS LIBCONFIG++_INCLUDE_DIR LIBCONFIG++_LIBRARY) |