Windows Cmake issues
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.
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.
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.
what I would do if I were in your shoes:
- build/install glfw from source on Windows
- 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.
- open3d install
- create your project that depends on open3d.
@yxlao I think you are working on similar issues. Can you give some comments on this?
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.
Please refer to https://github.com/IntelVCL/Open3D/pull/552 and https://github.com/IntelVCL/Open3D/pull/548 for the related cmake install fixes