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.
This commit is contained in:
Marcus Müller
2015-07-24 12:04:55 +02:00
parent b3442dad46
commit 2841634b1c
+6 -4
View File
@@ -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)