Martchus / cpp-utilities

Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
GNU General Public License v2.0
52 stars 18 forks source link

cmake can't find cppunit - mac big sur #22

Closed buckmanhands closed 2 years ago

buckmanhands commented 2 years ago

Are there some flags I can set in my cmake command to point at cppunit? I am on a Mac, OS Big Sur I installed cppunit with homebrew.

I tried a lot of things and nothing worked :(

Here are some paths I can see after installing cppunit 1.15.1: /usr/local/include/cppunit <-- This is a symlink to the cppunit directory /usr/local/opt/cppunit <-- another symlink to the same directory /usr/local/lib/libcppunit-1.15.1.dylib /usr/local/lib/libcppunit.dylib /usr/local/lib/libcppunit.a

Below is the error I get:

CMake Warning at cmake/modules/TestTarget.cmake:57 (message): Cppunit not detected via pkg-config so the version couldn't be checked. Required version for c++utilities is 1.13.0. Call Stack (most recent call first): CMakeLists.txt:200 (include)

buckmanhands commented 2 years ago

Sorry, the answer was

brew install pkg-config

buckmanhands commented 2 years ago

And just as an FYI, now that I can run make test here is the errors that resulted. Its all greek to me (such a noob) but I thought you might like to know in case it means something to you and is important:

/Users/oldfaithful/Local/tageditor/cpp-utilities/tests/conversiontests.cpp:29:15: error: call to 'swapOrder' is ambiguous static_assert(swapOrder(0xABCDEF1234567890ul) == 0x9078563412EFCDABul, "swapOrder(uint64)"); ^~~~~~~~~

/Users/oldfaithful/Local/tageditor/cpp-utilities/tests/../conversion/./binaryconversion.h:154:46: note: candidate function CPP_UTILITIES_EXPORT constexpr std::uint16_t swapOrder(std::uint16_t value) ^

/Users/oldfaithful/Local/tageditor/cpp-utilities/tests/../conversion/./binaryconversion.h:162:46: note: candidate function CPP_UTILITIES_EXPORT constexpr std::uint32_t swapOrder(std::uint32_t value) ^

/Users/oldfaithful/Local/tageditor/cpp-utilities/tests/../conversion/./binaryconversion.h:170:46: note: candidate function CPP_UTILITIES_EXPORT constexpr std::uint64_t swapOrder(std::uint64_t value) ^

1 error generated. make[3]: [CMakeFiles/c++utilities_tests.dir/tests/conversiontests.cpp.o] Error 1 make[2]: [CMakeFiles/c++utilities_tests.dir/all] Error 2 make[1]: [CMakeFiles/check.dir/rule] Error 2 make: [check] Error 2 ``

Martchus commented 2 years ago

I don't see that error when building for other platforms. I've just pushed a potential fix (https://github.com/Martchus/cpp-utilities/commit/f81607be82de955830a80a28bfa7bf09d3af4b86) you might try out.