cmake: properly find older msgpack versions
Change-Id: I63e4cd903395d99092e0c0de47efaf7799793d05
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0ee7cab..45fa4d9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,15 +15,11 @@
set (VERSION ${CMAKE_PROJECT_VERSION})
find_package (PkgConfig REQUIRED)
-find_package(msgpackc-cxx QUIET CONFIG)
+find_package(msgpackc-cxx QUIET CONFIG NAMES msgpackc-cxx msgpack)
if(msgpackc-cxx_FOUND)
add_library(msgpack-cxx ALIAS msgpackc-cxx)
else()
- find_package(msgpack-cxx CONFIG)
- if(NOT msgpack-cxx_FOUND)
- find_package(msgpack CONFIG REQUIRED)
- add_library(msgpack-cxx ALIAS msgpack)
- endif()
+ find_package(msgpack-cxx CONFIG REQUIRED)
endif()
find_package(fmt)