aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/Modules
diff options
context:
space:
mode:
authorAngelo Mantellini <angelo.mantellini@cisco.com>2020-03-26 12:02:23 +0100
committerAngelo Mantellini <angelo.mantellini@cisco.com>2020-03-31 11:35:33 +0200
commit3718e549ee31ac764b327bbf3d6e51dd7e224b46 (patch)
tree5bfc2147e348a5fd4b0291ad458dacf3feececc0 /cmake/Modules
parent4b36dc3d5dd3ec206aa24d49557c61ae5886be2b (diff)
[HICN-581] update hicn stack to support windows, again
Signed-off-by: Angelo Mantellini <angelo.mantellini@cisco.com> Change-Id: Ic5cfeae600fde8140a076807fa1e411da1933a02
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/FindConfig.cmake37
1 files changed, 35 insertions, 2 deletions
diff --git a/cmake/Modules/FindConfig.cmake b/cmake/Modules/FindConfig.cmake
index 5361d9611..11e764d21 100644
--- a/cmake/Modules/FindConfig.cmake
+++ b/cmake/Modules/FindConfig.cmake
@@ -1,6 +1,39 @@
-FIND_PATH(CONFIG_INCLUDE_DIR libconfig.h /usr/include /usr/local/include)
+set(LIBCONFIG_SEARCH_PATH_LIST
+ ${LIBCONFIG_HOME}
+ $ENV{LIBCONFIG_HOME}
+ /usr/local
+ /opt
+ /usr
+)
+
+find_path(CONFIG_INCLUDE_DIR libconfig.h
+ HINTS ${LIBCONFIG_SEARCH_PATH_LIST}
+ PATH_SUFFIXES include
+ DOC "Find the libconfig include"
+)
+
+if (WIN32)
+ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ find_library(CONFIG_LIBRARY NAMES libconfig.lib
+ HINTS ${LIBCONFIG_SEARCH_PATH_LIST}
+ PATH_SUFFIXES lib/x64
+ DOC "Find the libconfig libraries"
+ )
+ elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ find_library(CONFIG_LIBRARY NAMES libconfig.lib
+ HINTS ${LIBCONFIG_SEARCH_PATH_LIST}
+ PATH_SUFFIXES lib/x32
+ DOC "Find the libconfig libraries"
+ )
+ endif()
+else()
+ find_library(CONFIG_LIBRARY NAMES config
+ HINTS ${LIBCONFIG_SEARCH_PATH_LIST}
+ PATH_SUFFIXES lib
+ DOC "Find the libconfig libraries"
+ )
+endif()
-FIND_LIBRARY(CONFIG_LIBRARY NAMES config PATH /usr/lib /usr/local/lib)
IF (CONFIG_INCLUDE_DIR AND CONFIG_LIBRARY)
SET(CONFIG_FOUND TRUE)