libsodium install not being picked up via cmake #1535
Replies: 2 comments
-
|
This is most likely a If Please check that you are configuring with something like: cmake -B build -S . ^
-DCMAKE_TOOLCHAIN_FILE=C:/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake ^
-DWITH_LIBSODIUM=ON ^
-DENABLE_CURVE=ONIf you want static linking, also add Also, after changing the toolchain or triplet, delete the build directory / CMake cache and reconfigure from scratch. So, you are probably not missing a libsodium-specific install step; the missing step is making CMake use vcpkg when configuring |
Beta Was this translation helpful? Give feedback.
-
|
Thank you so much for the response. Like I mentioned in the above, I'm very new to these tools so I appreciate the explanation. Your response helped me realize my issue: my triplets weren't matching. My libsodium installation is x64-windows, but I was targeting an x86 release. I reconfigured my project for x64, deleted the cache and the CMake picked it up. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Apologies if this isn't the place for this but I'm struggling with something and at a loss.
I'm currently using cmake to build libzmq in visual studio and I cannot get my script to recognize that libsodium is installed. I've installed libsodium via vcpkg as detailed in the installation documentation and I can confirm the install ran correctly by running
vcpkg listin the vcpkg directory that sits in my project directory.When I generate my cmake build files, the installation fails to find libsodium installation. I've attached the entire cmake file and pasted the relevant script snippet below. Every attempt to generate cmake gives me the "libsodium not installed, you may want to install libsodium and run cmake again" error.
find_package("sodium") if(SODIUM_FOUND) message(STATUS "Using libsodium for CURVE security") include_directories(${SODIUM_INCLUDE_DIRS}) link_directories(${SODIUM_LIBRARY_DIRS}) if(WITH_LIBSODIUM_STATIC) add_compile_definitions(SODIUM_STATIC) endif() set(ZMQ_USE_LIBSODIUM 1) set(ZMQ_HAVE_CURVE 1) if (ENABLE_LIBSODIUM_RANDOMBYTES_CLOSE) set(ZMQ_LIBSODIUM_RANDOMBYTES_CLOSE 1) endif() else() message( ERROR "libsodium not installed, you may want to install libsodium and run cmake again" ) endif()Is there an intermediary step I'm missing to have my libsodium install picked up here? I'm not particularly well versed in cmake or vcpkg so I assume there's something simple I'm missing. Any help would be appreciated.
CMake version 4.2.3
Visual Studio 2026
libsodium 1.0.22
Thanks,
Tristan
CMakeLists.txt
Beta Was this translation helpful? Give feedback.
All reactions