From 2841634b1c64ae2acdc6e06f638206f90313875a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20M=C3=BCller?= Date: Fri, 24 Jul 2015 12:04:55 +0200 Subject: [PATCH] cmake: fixed FindITPP for custom prefix, DebWithRelInfo * include dir: would only try ${PC_ITPP_INCLUDEDIR}/include: * added ${PC_ITPP_INCLUDEDIR} as HINT * dirs: differentiate between HINTS and PATHS * ITPP_LIBRARY: Now works with CMAKE_BUILD_TYPE=RelWithDebInfo and debug version of libitpp * if build type is RelWithDebInfo and both libraries (libitpp and libitpp-debug) are present, use debug variant. --- cmake/Modules/FindITPP.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/Modules/FindITPP.cmake b/cmake/Modules/FindITPP.cmake index 340822d..909f95a 100644 --- a/cmake/Modules/FindITPP.cmake +++ b/cmake/Modules/FindITPP.cmake @@ -12,8 +12,10 @@ pkg_check_modules(PC_ITPP itpp) find_path(ITPP_INCLUDE_DIR NAMES itpp/itbase.h - HINTS ${PC_ITPP_INCLUDEDIR}/include + HINTS ${PC_ITPP_INCLUDEDIR} + ${PC_ITPP_INCLUDEDIR}/include ${ITPP_DIR}/include + PATHS /usr/pkgs64/include /usr/include /usr/local/include @@ -40,11 +42,11 @@ find_library(ITPP_LIBRARY_DEBUG ) if (ITPP_LIBRARY_NORMAL OR ITPP_LIBRARY_DEBUG) - if (CMAKE_BUILD_TYPE STREQUAL "Debug" AND ITPP_LIBRARY_DEBUG) + if ((CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") AND ITPP_LIBRARY_DEBUG) SET (ITPP_LIBRARY ${ITPP_LIBRARY_DEBUG}) - else (CMAKE_BUILD_TYPE STREQUAL "Debug" AND ITPP_LIBRARY_DEBUG) + else ((CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") AND ITPP_LIBRARY_DEBUG) SET (ITPP_LIBRARY ${ITPP_LIBRARY_NORMAL}) - endif (CMAKE_BUILD_TYPE STREQUAL "Debug" AND ITPP_LIBRARY_DEBUG) + endif ((CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") AND ITPP_LIBRARY_DEBUG) endif (ITPP_LIBRARY_NORMAL OR ITPP_LIBRARY_DEBUG) if (ITPP_LIBRARY AND ITPP_INCLUDE_DIR)