Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib*.cmake scripts don't work in VisualStudio #1251

Open
sphaero opened this issue Jun 8, 2020 · 3 comments
Open

lib*.cmake scripts don't work in VisualStudio #1251

sphaero opened this issue Jun 8, 2020 · 3 comments

Comments

@sphaero
Copy link
Contributor

sphaero commented Jun 8, 2020

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.
@sphaero
Copy link
Contributor Author

sphaero commented Jun 8, 2020

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.

@sphaero
Copy link
Contributor Author

sphaero commented Jun 9, 2020

More background here: zeromq/czmq#1972

@sphaero
Copy link
Contributor Author

sphaero commented Jun 9, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant