Skip to content

Commit 94f72b1

Browse files
committed
WIP-CAP: working prebinaries linking for open3d 0_17, needs cleaneaning
1 parent 62786fe commit 94f72b1

File tree

206 files changed

+38156
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+38156
-16
lines changed

CMakeLists.txt

Lines changed: 101 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,23 @@ set(CMAKE_CXX_STANDARD 17)
44

55

66
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
7+
8+
9+
#--------------------------------------------------------------------------
10+
# refresh deps gitmodules
11+
#--------------------------------------------------------------------------
12+
713
include(external_tools)
814

15+
execute_process(COMMAND git submodule update --init --recursive
16+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
17+
RESULT_VARIABLE GIT_SUBMOD_RESULT
18+
)
19+
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
20+
message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
21+
endif()
22+
23+
924
#--------------------------------------------------------------------------
1025
# library
1126
#--------------------------------------------------------------------------
@@ -40,48 +55,117 @@ target_precompile_headers(${SHARED_LIB_NAME} PUBLIC src/diffcheckpch.hh)
4055
# 3rd party
4156
#--------------------------------------------------------------------------
4257

58+
59+
60+
61+
4362
# FIXME: problems with glfw (LINK : fatal error LNK1104: cannot open file '..\deps\glew\win\2_2_0\bin\Release\x64\glew32.obj' [F:\diffCheck\build\diffCheck.vcxproj])
44-
# glfw --------------------------------------------------------------
45-
add_subdirectory(deps/glfw)
46-
target_link_libraries(${SHARED_LIB_NAME} PUBLIC glfw ${GLFW_LIBRARIES})
47-
target_include_directories(${SHARED_LIB_NAME} PUBLIC ${GLFW_INCLUDE_DIRS})
48-
target_link_libraries(${SHARED_LIB_NAME} INTERFACE glfw ${GLFW_LIBRARIES})
49-
target_include_directories(${SHARED_LIB_NAME} INTERFACE ${GLFW_INCLUDE_DIRS})
63+
# glfw (pre-build binaries) --------------------------------------------------------------
64+
65+
# TODO: add binaries to deps
66+
set(GLFW_VERSION 3_3_4) # 3.3.4
67+
set(GLFW_LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/glfw/win/${GLFW_VERSION}/lib-vc2019)
68+
set(GLFW_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/glfw/win/${GLFW_VERSION}/include)
69+
70+
add_library(glfw3 SHARED IMPORTED)
71+
set_target_properties(glfw3 PROPERTIES
72+
IMPORTED_LOCATION ${GLFW_LIB_PATH}/glfw3.dll
73+
IMPORTED_IMPLIB ${GLFW_LIB_PATH}/glfw3.lib
74+
INTERFACE_INCLUDE_DIRECTORIES ${GLFW_INCLUDE_PATH}
75+
)
76+
77+
# target_link_directories(${SHARED_LIB_NAME} PUBLIC ${GLFW_LIB_PATH})
78+
# target_link_directories(${SHARED_LIB_NAME} INTERFACE ${GLFW_LIB_PATH})
79+
80+
target_link_libraries(${SHARED_LIB_NAME} PUBLIC glfw3)
81+
target_link_libraries(${SHARED_LIB_NAME} INTERFACE glfw3)
82+
target_include_directories(${SHARED_LIB_NAME} PUBLIC ${GLFW_INCLUDE_PATH})
83+
target_include_directories(${SHARED_LIB_NAME} INTERFACE ${GLFW_INCLUDE_PATH})
84+
85+
# #find openGL
86+
# find_package(OpenGL REQUIRED)
87+
# target_link_libraries(${SHARED_LIB_NAME} PUBLIC OpenGL::GL)
88+
# target_link_libraries(${SHARED_LIB_NAME} INTERFACE OpenGL::GL)
89+
5090

5191
# TODO: replace with add_subdirectory() instead of binaries
52-
# glew --------------------------------------------------------------
92+
# glew (pre-build binaries) --------------------------------------------------------------
5393
set(GLEW_VERSION 2_2_0) # 2.2.0
54-
set(GLEW_LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/glew/win/${GLEW_VERSION}/bin/Release/x64/glew32)
94+
set(GLEW_LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/glew/win/${GLEW_VERSION}/bin/Release/x64)
95+
set(GLEW_STATIC_LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/glew/win/${GLEW_VERSION}/lib/Release/x64)
5596
set(GLEW_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/glew/win/${GLEW_VERSION}/include)
5697

57-
target_link_libraries(${SHARED_LIB_NAME} PUBLIC ${GLEW_LIB_PATH})
58-
target_link_libraries(${SHARED_LIB_NAME} INTERFACE ${GLEW_LIB_PATH})
98+
add_library(glew32 SHARED IMPORTED)
99+
set_target_properties(glew32 PROPERTIES
100+
IMPORTED_LOCATION ${GLEW_LIB_PATH}/glew32.dll
101+
IMPORTED_IMPLIB ${GLEW_STATIC_LIB_PATH}/glew32.lib
102+
INTERFACE_INCLUDE_DIRECTORIES ${GLEW_INCLUDE_PATH}
103+
)
104+
105+
106+
# target_link_directories(${SHARED_LIB_NAME} PUBLIC ${GLEW_STATIC_LIB_PATH})
107+
# target_link_directories(${SHARED_LIB_NAME} INTERFACE ${GLEW_STATIC_LIB_PATH})
108+
# target_link_directories(${SHARED_LIB_NAME} PUBLIC ${GLEW_LIB_PATH})
109+
# target_link_directories(${SHARED_LIB_NAME} INTERFACE ${GLEW_LIB_PATH})
110+
111+
target_link_libraries(${SHARED_LIB_NAME} PUBLIC glew32)
112+
target_link_libraries(${SHARED_LIB_NAME} INTERFACE glew32)
59113
target_include_directories(${SHARED_LIB_NAME} PUBLIC ${GLEW_INCLUDE_PATH})
60114
target_include_directories(${SHARED_LIB_NAME} INTERFACE ${GLEW_INCLUDE_PATH})
61115

62-
# fmt --------------------------------------------------------------
116+
# fmt (header-only)--------------------------------------------------------------
63117
add_subdirectory(deps/fmt)
64118

65119
target_link_libraries(${SHARED_LIB_NAME} PUBLIC fmt::fmt)
66120
target_link_libraries(${SHARED_LIB_NAME} INTERFACE fmt::fmt)
67121

68-
# Eigen --------------------------------------------------------------
122+
# Eigen (header-only)--------------------------------------------------------------
69123
add_subdirectory(deps/eigen)
70124

71125
target_link_libraries(${SHARED_LIB_NAME} PUBLIC Eigen3::Eigen)
72126
target_link_libraries(${SHARED_LIB_NAME} INTERFACE Eigen3::Eigen)
73127

74-
# Open3D --------------------------------------------------------------
128+
# Open3D (pre-build binaries)--------------------------------------------------------------
75129
set(O3D_VERSION 0_17) # 0.17.0
76-
set(OPEN3D_SHAREDLIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/open3d/win/${O3D_VERSION}/bin/Open3D)
130+
set(OPEN3D_SHAREDLIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/open3d/win/${O3D_VERSION}/bin)
131+
set(OPEN3D_LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/open3d/win/${O3D_VERSION}/lib)
77132
set(OPEN3D_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/deps/open3d/win/${O3D_VERSION}/include)
78133

79-
target_link_libraries(${SHARED_LIB_NAME} PUBLIC ${OPEN3D_SHAREDLIB_PATH})
80-
target_link_libraries(${SHARED_LIB_NAME} INTERFACE ${OPEN3D_SHAREDLIB_PATH})
134+
add_library(Open3D SHARED IMPORTED)
135+
set_target_properties(Open3D PROPERTIES
136+
IMPORTED_LOCATION ${OPEN3D_SHAREDLIB_PATH}/Open3D.dll
137+
IMPORTED_IMPLIB ${OPEN3D_LIB_PATH}/Open3D.lib
138+
INTERFACE_INCLUDE_DIRECTORIES ${OPEN3D_INCLUDE_PATH}
139+
)
140+
141+
# target_link_directories(${SHARED_LIB_NAME} PUBLIC ${OPEN3D_LIB_PATH})
142+
# target_link_directories(${SHARED_LIB_NAME} INTERFACE ${OPEN3D_LIB_PATH})
143+
# # target_link_directories(${SHARED_LIB_NAME} PUBLIC ${OPEN3D_SHAREDLIB_PATH})
144+
# # target_link_directories(${SHARED_LIB_NAME} INTERFACE ${OPEN3D_SHAREDLIB_PATH})
145+
146+
target_link_libraries(${SHARED_LIB_NAME} PUBLIC Open3D)
147+
target_link_libraries(${SHARED_LIB_NAME} INTERFACE Open3D)
81148
target_include_directories(${SHARED_LIB_NAME} PUBLIC ${OPEN3D_INCLUDE_PATH})
82149
target_include_directories(${SHARED_LIB_NAME} INTERFACE ${OPEN3D_INCLUDE_PATH})
83150

84151

152+
153+
154+
# copy all the dlls to the bin directory
155+
# List of libraries that DiffCheck is linked against
156+
set(DEPENDENCIES glfw3 glew32 Open3D)
157+
158+
foreach(DEP_LIB ${DEPENDENCIES})
159+
add_custom_command(TARGET ${SHARED_LIB_NAME} POST_BUILD
160+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
161+
$<TARGET_FILE:${DEP_LIB}>
162+
$<TARGET_FILE_DIR:${SHARED_LIB_NAME}>
163+
)
164+
endforeach()
165+
166+
167+
168+
85169
#--------------------------------------------------------------------------
86170
# executable
87171
#--------------------------------------------------------------------------
@@ -100,6 +184,7 @@ target_include_directories(${APP_NAME_EXE}
100184
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src
101185
)
102186

187+
103188
#--------------------------------------------------------------------------
104189
# Tests
105190
#--------------------------------------------------------------------------

deps/glfw/win/3_3_4/LICENSE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Copyright (c) 2002-2006 Marcus Geelnard
2+
3+
Copyright (c) 2006-2019 Camilla Löwy
4+
5+
This software is provided 'as-is', without any express or implied
6+
warranty. In no event will the authors be held liable for any damages
7+
arising from the use of this software.
8+
9+
Permission is granted to anyone to use this software for any purpose,
10+
including commercial applications, and to alter it and redistribute it
11+
freely, subject to the following restrictions:
12+
13+
1. The origin of this software must not be misrepresented; you must not
14+
claim that you wrote the original software. If you use this software
15+
in a product, an acknowledgment in the product documentation would
16+
be appreciated but is not required.
17+
18+
2. Altered source versions must be plainly marked as such, and must not
19+
be misrepresented as being the original software.
20+
21+
3. This notice may not be removed or altered from any source
22+
distribution.
23+

deps/glfw/win/3_3_4/README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# GLFW binaries for 64-bit Windows
2+
3+
This archive contains documentation, headers, pre-compiled static libraries,
4+
import libraries and DLLs for GLFW 3.4.
5+
6+
Binaries for the following compilers are included
7+
8+
- Visual C++ 2022 (built with 17.9.0)
9+
- Visual C++ 2019 (built with 16.11.34)
10+
- Visual C++ 2017 (built with 15.9.60)
11+
- Visual C++ 2015 (built with 14.0.25431.01)
12+
- Visual C++ 2013 (built with 12.0.40629.00)
13+
- MinGW-w64 (built with 13.2.0-win32-dwarf-msvcrt)
14+
15+
16+
## Binaries for Visual C++
17+
18+
All binaries for Visual C++ 2017 and earlier are compatible with Windows XP, but
19+
this is not supported by Visual C++ 2019. This support has been deprecated by
20+
Microsoft and GLFW will also drop support for Windows XP in a future release.
21+
22+
### GLFW as a DLL
23+
24+
To use GLFW as a DLL, link against the `glfw3dll.lib` file for your
25+
environment. This will add a load time dependency on `glfw3.dll`. The
26+
remaining files in the same directory are not needed.
27+
28+
This DLL is built in release mode for the Multithreaded DLL runtime library.
29+
30+
There is also a GLFW DLL and import library pair in the `lib-static-ucrt`
31+
directory. These are built with Visual C++ 2019 and the static Multithreaded
32+
runtime library.
33+
34+
### GLFW as a static library
35+
36+
To use GLFW as a static library, link against `glfw3.lib` if your application
37+
is using the Multithreaded DLL runtime library, or `glfw3_mt.lib` if it is
38+
using the static Multithreaded runtime library. The remaining files in the same
39+
directory are not needed.
40+
41+
The static libraries are built in release mode and do not contain debug
42+
information but can still be linked with the debug versions of the runtime
43+
library.
44+
45+
46+
## Binaries for MinGW-w64
47+
48+
### GLFW as a DLL
49+
50+
To use GLFW as a DLL, link against the `libglfw3dll.a` file for your
51+
environment. This will add a load time dependency on `glfw3.dll`. The
52+
remaining files in the same directory are not needed.
53+
54+
The DLLs are built in release mode.
55+
56+
The DLLs depend on the `msvcrt.dll` C runtime library. There is also a GLFW
57+
DLL and import library in the `lib-static-ucrt` directory that is built with
58+
Visual C++ 2019 and statically linked against the UCRT.
59+
60+
All DLLs in this archive provide the same ABI and can be used as drop-in
61+
replacements for one another, as long as the C runtime library they depend on is
62+
available.
63+
64+
### GLFW as a static library
65+
66+
To use GLFW as a static library, link against the `libglfw3.a` file for your
67+
environment. The other files in the same directory are not needed.
68+
69+
The library is built in release mode and do not contain debug information.
70+
676 Bytes
Loading
635 Bytes
Loading

deps/glfw/win/3_3_4/docs/html/build_8md.html

Lines changed: 81 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)