zproject
zproject copied to clipboard
lib*.cmake scripts don't work in VisualStudio
Not sure yet what goes wrong since it works fine from a console.
1> CMake Error at Findlibzmq.cmake:37 (file):
1> file STRINGS file
1> "C:/src/gazebosc/ext/czmq/LIBZMQ_INCLUDE_DIRS-NOTFOUND/zmq.h" cannot be
1> read.
1> Call Stack (most recent call first):
1> C:\src\gazebosc\ext/czmq/CMakeLists.txt(129): (find_package)
1>
1>
1> -- Could NOT find LIBZMQ (missing: LIBZMQ_LIBRARIES LIBZMQ_INCLUDE_DIRS)
1> CMake Error at ext/czmq/CMakeLists.txt:140 (message):
1> libzmq not found.
1>
1>
1> -- Configuring incomplete, errors occurred!
1> See also "C:/Users/admin/CMakeBuilds/4c3ce48d-2a02-063c-b023-f9a5742d9de3/build/x64-Debug (default)/CMakeFiles/CMakeOutput.log".
1> See also "C:/Users/admin/CMakeBuilds/4c3ce48d-2a02-063c-b023-f9a5742d9de3/build/x64-Debug (default)/CMakeFiles/CMakeError.log".
1> C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\admin\CMakeBuilds\4c3ce48d-2a02-063c-b023-f9a5742d9de3\install\x64-Debug (default)" -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe" -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\src\gazebosc" returned with exit code: 1
CMake Error at Findlibzmq.cmake:37 (file):
file STRINGS file
"C:/src/gazebosc/ext/czmq/LIBZMQ_INCLUDE_DIRS-NOTFOUND/zmq.h" cannot be
read.
Call Stack (most recent call first):
ext/czmq/CMakeLists.txt:129 (find_package)
CMake Error at ext/czmq/CMakeLists.txt:140 (message):
libzmq not found.
Btw this is the output from czmq:
1> CMake Error at Findlibzmq.cmake:37 (file):
1> file STRINGS file "C:/src/czmq/LIBZMQ_INCLUDE_DIRS-NOTFOUND/zmq.h" cannot
1> be read.
1> Call Stack (most recent call first):
1> C:\src\czmq\CMakeLists.txt(129): (find_package)
1>
1>
1> -- Could NOT find LIBZMQ (missing: LIBZMQ_LIBRARIES LIBZMQ_INCLUDE_DIRS)
1> CMake Error at C:\src\czmq\CMakeLists.txt:140 (message):
1> libzmq not found.
1>
1>
1> -- Configuring incomplete, errors occurred!
1> See also "C:/Users/admin/CMakeBuilds/5f58e1a6-7039-9a3f-9f67-d857db877b89/build/x64-Debug (default)/CMakeFiles/CMakeOutput.log".
1> See also "C:/Users/admin/CMakeBuilds/5f58e1a6-7039-9a3f-9f67-d857db877b89/build/x64-Debug (default)/CMakeFiles/CMakeError.log".
1> C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\admin\CMakeBuilds\5f58e1a6-7039-9a3f-9f67-d857db877b89\install\x64-Debug (default)" -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe" -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\src\czmq" returned with exit code: 1
CMake Error at Findlibzmq.cmake:37 (file):
file STRINGS file "C:/src/czmq/LIBZMQ_INCLUDE_DIRS-NOTFOUND/zmq.h" cannot
be read.
Call Stack (most recent call first):
CMakeLists.txt:129 (find_package)
CMake Error at CMakeLists.txt:140 (message):
libzmq not found.
More background here: https://github.com/zeromq/czmq/issues/1972
Ok this issue seems to center around libzmq's filename (libzmq-MSVC_VERSION-mt-gd-MAJOR_MINOR_PATCH) and the fact that CMAKE_VS_PLATFORM_TOOLSET is empty in VisualStudio.
One workaround is to rename the lib to libzmq.llib and to set CMAKE_PREFIX_PATH to the root of libzmq install path.