Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Windows Cmake issues

Open Jason420Git opened this issue 8 years ago • 6 comments

I have some issues using the CMake on windows 10 with Visual Studio 2015.

Firstly, the include directory path becomes:

C:\local\open3d\install\include\Open3D

Which is a level too deep. This means that I need to use #include <../Open3D/Core/Core.h> .

Secondly, the linker adds 'Open3D.lib' but without the location of that library. My Cmake is as follows:

`` find_package(Open3D REQUIRED)

include_directories(${Open3D_INCLUDE_DIRS})

add_executable(exampleProject main.cpp

target_link_libraries(exampleProject ${Open3D_LIBRARIES}) ``

If I manually set the full .lib paths it also causes a linker error. The Cmake for Open3D links to glfw.lib but the library file created inside the install folder is glfw3.lib so, it is missing the 3.

Jason420Git avatar Aug 27 '18 14:08 Jason420Git

To update on this I was able to fix the direct path stuff.

The issue with looking for glfw instead of glfw3 still exists. I also am struggling to build the library with static runtime. Even with disabling shared libs and disabling MSVC DLL runtime options in CMake. I have to manually change the run time of all the projects in visual studio before building.

Jason420Git avatar Aug 28 '18 13:08 Jason420Git

cmake install + C++ project was never supported on windows for the exact same reasons you've raised. for example glfw: open3d depends on glfw. however the glfw binary will have different names for static vs shared builds - the difference is the 3 you've noticed as well. modifying the glfw cmake files is non-trivial and as such was not attempted.

takanokage avatar Aug 28 '18 22:08 takanokage

what I would do if I were in your shoes:

  1. build/install glfw from source on Windows
  2. make sure CMake can find your installed glfw. unfortunately you might have to manually edit the open3d cmake file in order to look for the installed glfw - by default on Windows open3d cmake is configured to always build external dependencies from source instead of looking for them.
  3. open3d install
  4. create your project that depends on open3d.

takanokage avatar Aug 28 '18 22:08 takanokage

@yxlao I think you are working on similar issues. Can you give some comments on this?

qianyizh avatar Sep 10 '18 04:09 qianyizh

Regarding your first comment: "a level too deep", I could confirm this issue. This happened when we previously moved the 3rdparty directory out to the root level. The installed libraries are still in the correct location, however, the ${Open3D_INCLUDE_DIRS} is not properly set. I'll working on a fix for this now.

In the mean time, your fix of including "one level deeper" could be a temporary fix.

yxlao avatar Sep 11 '18 00:09 yxlao

Please refer to https://github.com/IntelVCL/Open3D/pull/552 and https://github.com/IntelVCL/Open3D/pull/548 for the related cmake install fixes

yxlao avatar Sep 11 '18 19:09 yxlao