From 07b3c4957d46ec3f2d92fdbd4e5f2bb86663b115 Mon Sep 17 00:00:00 2001 From: Alexander Damian Date: Tue, 21 May 2019 08:52:03 -0400 Subject: [PATCH] Changed method to determine bitness --- CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ebe9db..eebfa5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,14 +38,13 @@ option(CPPKAFKA_BOOST_STATIC_LIBS "Link with Boost static libraries." ON) option(CPPKAFKA_BOOST_USE_MULTITHREADED "Use Boost multithreaded libraries." ON) option(CPPKAFKA_RDKAFKA_STATIC_LIB "Link with Rdkafka static library." OFF) -# Determine if this is a 32 or 64 bit build -string(FIND ${CMAKE_CXX_FLAGS} "-m64" BITNESS) +math(EXPR BITS "8*${CMAKE_SIZEOF_VOID_P}") # Properly set the output directory -if (${BITNESS} EQUAL -1) - set(LIBDIR "lib") -else() +if (${BITS} EQUAL 64) set(LIBDIR "lib64") +else() + set(LIBDIR "lib") endif() # Disable output from find_package macro