1 | ################################################################################################# |
---|
2 | # This file allows to configure osgVisual with CMAKE to generate native build solutions. # |
---|
3 | # # |
---|
4 | # Specify the following environment variables to use osgVisual and this CMAKE script: # |
---|
5 | # * OSG_ROOT: Path to your 32 bit (x86) OSG, e.g. D:\OSG\OpenSceneGraph-2.9.8_x86 # |
---|
6 | # * OSG_ROOT_X64: Path to your 64 bit (x64) OSG, e.g. D:\OSG\OpenSceneGraph-2.9.8_x64 # |
---|
7 | # * OSG: Path to your 32 bit (x86) OSG and 3rdParty binary folder, # |
---|
8 | # e.g. %OSG_ROOT%\bin;D:\OSG\3rdParty\bin\x86 # |
---|
9 | # * OSG_X64: Path to your 64 bit (x64) OSG and 3rdParty binary folder, # |
---|
10 | # e.g. %OSG_ROOT_X64%\bin;D:\OSG\3rdParty\bin\x64 # |
---|
11 | # * PATH: Extend with %OSG% or %OSG_X64% to use OSG and osgVisual from command line, # |
---|
12 | # e.g. PATH=%PATH%;%OSG% # |
---|
13 | # # |
---|
14 | # NOTE: On Visual Studio and x64 Arch, CMAKE uses the project settings to specify the # |
---|
15 | # correct x64 OSG path, so you can use osg as 32 bit in your system path. # |
---|
16 | # # |
---|
17 | # # |
---|
18 | ################################################################################################# |
---|
19 | |
---|
20 | cmake_minimum_required(VERSION 2.8) |
---|
21 | |
---|
22 | |
---|
23 | PROJECT(osgVisual) |
---|
24 | #SET(CMAKE_MODULE_PATH "${osgVisual_SOURCE_DIR}/../CMakeModules;${CMAKE_MODULE_PATH}") |
---|
25 | |
---|
26 | # Check Architecture |
---|
27 | IF( CMAKE_SIZEOF_VOID_P EQUAL 4 ) |
---|
28 | MESSAGE( STATUS "32 bit architecture detected" ) |
---|
29 | SET(DESTINATION_ARCH "x86") |
---|
30 | ENDIF() |
---|
31 | IF( CMAKE_SIZEOF_VOID_P EQUAL 8 ) |
---|
32 | MESSAGE( STATUS "64 bit architecture detected" ) |
---|
33 | SET(DESTINATION_ARCH "x64") |
---|
34 | ENDIF() |
---|
35 | |
---|
36 | |
---|
37 | # Get required packages |
---|
38 | IF(DESTINATION_ARCH STREQUAL "x64") |
---|
39 | SET(OSG_ROOT_BKP $ENV{OSG_ROOT}) # BACKUP old OSG_ROOT |
---|
40 | SET(ENV{OSG_ROOT} $ENV{OSG_ROOT_X64}) # Replace OSGROOT with OSG_ROOT_X64 to force CMAKE to find the correct OSG version (64 bit) |
---|
41 | ENDIF () |
---|
42 | |
---|
43 | SET(OpenSceneGraph_MARK_AS_ADVANCED ON) |
---|
44 | FIND_PACKAGE(OpenSceneGraph 2.9.9 REQUIRED osgViewer OpenThreads osgDB osgTerrain osgGA osgText osgSim osgUtil) |
---|
45 | FIND_PACKAGE(OpenGL REQUIRED) |
---|
46 | |
---|
47 | |
---|
48 | IF(DESTINATION_ARCH STREQUAL "x64") |
---|
49 | SET(ENV{OSG_ROOT} ${OSG_ROOT_BKP}) # Restore old OSG_ROOT |
---|
50 | UNSET(OSG_ROOT_BKP) # Delete backup |
---|
51 | ENDIF () |
---|
52 | |
---|
53 | # LIBXML2 |
---|
54 | SET(LIBXML2_LIBRARY ../../../OpenSceneGraph/3rdParty_x86_x64/${DESTINATION_ARCH}/lib/libxml2 CACHE FILEPATH "Select the libxml2 library to link osgVisual against. REQUIRED!" ) |
---|
55 | SET(LIBXML2_INCLUDE ../../../OpenSceneGraph/3rdParty_x86_x64/${DESTINATION_ARCH}/include CACHE PATH "Select the libxml2 include path to link osgVisual against. REQUIRED!" ) |
---|
56 | INCLUDE_DIRECTORIES( ${LIBXML2_INCLUDE} ) |
---|
57 | |
---|
58 | # Module sky-silverlining |
---|
59 | # OPTION( OPTION_VAR "description string" [initial value] ) |
---|
60 | IF ( WIN32 ) |
---|
61 | |
---|
62 | SET(USE_SKY_SILVERLINING ON CACHE BOOL "Enable to use Sundog-soft's Silverlining SDK for sky & weather") |
---|
63 | IF(USE_SKY_SILVERLINING ) |
---|
64 | SET(SOURCES |
---|
65 | ${SOURCES} |
---|
66 | include/sky_Silverlining/skySilverLining_AtmosphereReference.h |
---|
67 | include/sky_Silverlining/skySilverLining_cloudLayerSlot.h |
---|
68 | include/sky_Silverlining/skySilverLining_cloudsDrawable.h |
---|
69 | include/sky_Silverlining/skySilverLining_ProjectionMatrixCallback.h |
---|
70 | include/sky_Silverlining/skySilverLining_skyDrawable.h |
---|
71 | include/sky_Silverlining/visual_skySilverLining.h |
---|
72 | src/sky_Silverlining/skySilverLining_cloudsDrawable.cpp |
---|
73 | src/sky_Silverlining/skySilverLining_skyDrawable.cpp |
---|
74 | src/sky_Silverlining/visual_skySilverLining.cpp |
---|
75 | ) |
---|
76 | |
---|
77 | IF (DESTINATION_ARCH STREQUAL "x86") |
---|
78 | SET(SILVERLINING_ARCH "win32") |
---|
79 | ELSEIF ( DESTINATION_ARCH STREQUAL "x64" ) |
---|
80 | SET(SILVERLINING_ARCH "x64") |
---|
81 | ENDIF () |
---|
82 | SET(SILVERLINING_LIBRARY_RELEASE $ENV{SILVERLINING_PATH}\\lib\\vc9\\${SILVERLINING_ARCH}\\SilverLining-MT-DLL.lib CACHE FILEPATH "Select the release library of Sundog-Soft's Silverlining SDK to link against." ) |
---|
83 | SET(SILVERLINING_LIBRARY_DEBUG $ENV{SILVERLINING_PATH}\\lib\\vc9\\${SILVERLINING_ARCH}\\SilverLining-MTD-DLL.lib CACHE FILEPATH "Select the debug library of Sundog-Soft's Silverlining SDK to link against." ) |
---|
84 | SET(SILVERLINING_INCLUDE_DIR "$ENV{SILVERLINING_PATH}\\Public Headers" CACHE PATH "Enter the path to the the public Include directory of Sundog-Soft's Silverlining SDK" ) |
---|
85 | SET(SILVERLINING_LICENSEE "Your user name" CACHE STRING "Enter your Silverlining licensee name. If you license available, osgVisual will work with silverlining as 5 minute demo with the default value." ) |
---|
86 | SET(SILVERLINING_LICENSE "Your license code" CACHE STRING "Enter your Silverlining license key. If you license available, osgVisual will work with silverlining as 5 minute demo with the default value." ) |
---|
87 | INCLUDE_DIRECTORIES(${SILVERLINING_INCLUDE_DIR} include/sky_Silverlining) |
---|
88 | ADD_DEFINITIONS( "-DUSE_SKY_SILVERLINING" ) |
---|
89 | ADD_DEFINITIONS( "-DSILVERLINING_LICENSEE=\"${SILVERLINING_LICENSEE}\"" ) |
---|
90 | ADD_DEFINITIONS( "-DSILVERLINING_LICENSE=\"${SILVERLINING_LICENSE}\"" ) |
---|
91 | |
---|
92 | ELSE(USE_SKY_SILVERLINING) |
---|
93 | UNSET(SILVERLINING_LIBRARY_RELEASE CACHE) |
---|
94 | UNSET(SILVERLINING_LIBRARY_DEBUG CACHE) |
---|
95 | UNSET(SILVERLINING_INCLUDE_DIR CACHE) |
---|
96 | UNSET(SILVERLINING_LICENSEE) |
---|
97 | UNSET(SILVERLINING_LICENSE) |
---|
98 | ENDIF(USE_SKY_SILVERLINING) |
---|
99 | ENDIF(WIN32) |
---|
100 | IF(UNIX) |
---|
101 | SET(USE_SKY_SILVERLINING ON CACHE BOOL "Enable to use Sundog-soft's Silverlining SDK for sky & weather") |
---|
102 | IF(USE_SKY_SILVERLINING ) |
---|
103 | SET(SOURCES |
---|
104 | ${SOURCES} |
---|
105 | include/sky_Silverlining/skySilverLining_AtmosphereReference.h |
---|
106 | include/sky_Silverlining/skySilverLining_cloudLayerSlot.h |
---|
107 | include/sky_Silverlining/skySilverLining_cloudsDrawable.h |
---|
108 | include/sky_Silverlining/skySilverLining_ProjectionMatrixCallback.h |
---|
109 | include/sky_Silverlining/skySilverLining_skyDrawable.h |
---|
110 | include/sky_Silverlining/visual_skySilverLining.h |
---|
111 | src/sky_Silverlining/skySilverLining_cloudsDrawable.cpp |
---|
112 | src/sky_Silverlining/skySilverLining_skyDrawable.cpp |
---|
113 | src/sky_Silverlining/visual_skySilverLining.cpp |
---|
114 | ) |
---|
115 | |
---|
116 | IF (DESTINATION_ARCH STREQUAL "x86") |
---|
117 | SET(SILVERLINING_ARCH "win32") |
---|
118 | ELSEIF ( DESTINATION_ARCH STREQUAL "x64" ) |
---|
119 | SET(SILVERLINING_ARCH "x64") |
---|
120 | ENDIF () |
---|
121 | SET(SILVERLINING_LIBRARY_RELEASE $ENV{SILVERLINING_PATH}\\lib\\vc9\\${SILVERLINING_ARCH}\\SilverLining-MT-DLL.lib CACHE FILEPATH "Select the release library of Sundog-Soft's Silverlining SDK to link against." ) |
---|
122 | SET(SILVERLINING_LIBRARY_DEBUG $ENV{SILVERLINING_PATH}\\lib\\vc9\\${SILVERLINING_ARCH}\\SilverLining-MTD-DLL.lib CACHE FILEPATH "Select the debug library of Sundog-Soft's Silverlining SDK to link against." ) |
---|
123 | SET(SILVERLINING_INCLUDE_DIR "$ENV{SILVERLINING_PATH}\\Public Headers" CACHE PATH "Enter the path to the the public Include directory of Sundog-Soft's Silverlining SDK" ) |
---|
124 | SET(SILVERLINING_LICENSEE "Your user name" CACHE STRING "Enter your Silverlining licensee name. If you license available, osgVisual will work with silverlining as 5 minute demo with the default value." ) |
---|
125 | SET(SILVERLINING_LICENSE "Your license code" CACHE STRING "Enter your Silverlining license key. If you license available, osgVisual will work with silverlining as 5 minute demo with the default value." ) |
---|
126 | INCLUDE_DIRECTORIES(${SILVERLINING_INCLUDE_DIR} "include/sky_Silverlining" ) |
---|
127 | ADD_DEFINITIONS( "-DUSE_SKY_SILVERLINING" ) |
---|
128 | ADD_DEFINITIONS( "-DSILVERLINING_LICENSEE=\"${SILVERLINING_LICENSEE}\"" ) |
---|
129 | ADD_DEFINITIONS( "-DSILVERLINING_LICENSE=\"${SILVERLINING_LICENSE}\"" ) |
---|
130 | |
---|
131 | ELSE(USE_SKY_SILVERLINING) |
---|
132 | UNSET(SILVERLINING_LIBRARY_RELEASE CACHE) |
---|
133 | UNSET(SILVERLINING_LIBRARY_DEBUG CACHE) |
---|
134 | UNSET(SILVERLINING_INCLUDE_DIR CACHE) |
---|
135 | UNSET(SILVERLINING_LICENSEE) |
---|
136 | UNSET(SILVERLINING_LICENSE) |
---|
137 | ENDIF(USE_SKY_SILVERLINING) |
---|
138 | ENDIF() |
---|
139 | |
---|
140 | # Module distortion |
---|
141 | SET(USE_DISTORTION OFF CACHE BOOL "Enable to use distortion with Projection Designer's distortion maps") |
---|
142 | IF(USE_DISTORTION) |
---|
143 | SET(SOURCES |
---|
144 | ${SOURCES} |
---|
145 | include/distortion/visual_distortion.h |
---|
146 | src/distortion/visual_distortion.cpp |
---|
147 | ) |
---|
148 | INCLUDE_DIRECTORIES(include/distortion) |
---|
149 | ADD_DEFINITIONS( "-DUSE_DISTORTION" ) |
---|
150 | ENDIF(USE_DISTORTION) |
---|
151 | |
---|
152 | |
---|
153 | # Module Vista2D - Only available under Win32 |
---|
154 | if( WIN32 ) |
---|
155 | SET(USE_VISTA2D OFF CACHE BOOL "Enable to use Vista2D by Wetzel Technology") |
---|
156 | IF( USE_VISTA2D ) |
---|
157 | INCLUDE_DIRECTORIES( include/vista2D ) |
---|
158 | SET(SOURCES |
---|
159 | ${SOURCES} |
---|
160 | include/vista2D/visual_vista2D.h |
---|
161 | src/vista2D/visual_vista2D.cpp |
---|
162 | ) |
---|
163 | SET(VISTA2D_INCLUDE_DIR . CACHE PATH "Select the INCLUDE directory path for Vista2D by Wetzel Technology." ) |
---|
164 | SET(VISTA2D_LIBRARY_DEBUG . CACHE FILEPATH "Select debug LIBRARY path for linking against Vista2D by Wetzel Technology." ) |
---|
165 | SET(VISTA2D_LIBRARY_RELEASE . CACHE FILEPATH "Select release LIBRARY path for linking against Vista2D by Wetzel Technology." ) |
---|
166 | INCLUDE_DIRECTORIES(${VISTA2D_INCLUDE_DIR}) |
---|
167 | ADD_DEFINITIONS( "-DUSE_VISTA2D" ) |
---|
168 | ELSE(USE_VISTA2D) |
---|
169 | UNSET(VISTA2D_INCLUDE_DIR CACHE) |
---|
170 | UNSET(VISTA2D_LIBRARY_DEBUG CACHE) |
---|
171 | UNSET(VISTA2D_LIBRARY_RELEASE CACHE) |
---|
172 | ENDIF(USE_VISTA2D) |
---|
173 | ENDIF(WIN32) |
---|
174 | |
---|
175 | |
---|
176 | # Module Spacenavigator manipulator - ONLY under WIN32 |
---|
177 | if( WIN32 ) |
---|
178 | # No header or linking required, because WIN32 COM interface used. |
---|
179 | SET(USE_SPACEMOUSE ON CACHE BOOL "Enable to use camera manipulator based on Spacenavigator by 3DConnexion") |
---|
180 | IF( USE_SPACEMOUSE ) |
---|
181 | SET(SOURCES |
---|
182 | ${SOURCES} |
---|
183 | include/manip_Spacemouse/manip_spaceMouse.h |
---|
184 | include/manip_Spacemouse/manip_freeSpaceMouse.h |
---|
185 | include/manip_Spacemouse/manip_nodeTrackerSpaceMouse.h |
---|
186 | src/manip_Spacemouse/manip_spaceMouse.cpp |
---|
187 | src/manip_Spacemouse/manip_freeSpaceMouse.cpp |
---|
188 | src/manip_Spacemouse/manip_nodeTrackerSpaceMouse.cpp |
---|
189 | ) |
---|
190 | INCLUDE_DIRECTORIES(include/manip_Spacemouse) |
---|
191 | ADD_DEFINITIONS( "-DUSE_SPACENAVIGATOR" ) |
---|
192 | ENDIF(USE_SPACEMOUSE) |
---|
193 | ENDIF(WIN32) |
---|
194 | |
---|
195 | |
---|
196 | # Module cluster |
---|
197 | SET(SOURCES |
---|
198 | ${SOURCES} |
---|
199 | include/cluster/dataIO_cluster.h |
---|
200 | include/cluster/dataIO_clusterDummy.h |
---|
201 | src/cluster/dataIO_clusterDummy.cpp |
---|
202 | ) |
---|
203 | SET(USE_CLUSTER_ASIO_TCP_IOSTREAM OFF CACHE BOOL "Enable to use the Boost ASIO TCP iostream implementation for the cluster interface") |
---|
204 | SET(USE_CLUSTER_ENET ON CACHE BOOL "Enable to use the ENet reliable UDP library implementation for the cluster interface") |
---|
205 | IF( USE_CLUSTER_ASIO_TCP_IOSTREAM ) |
---|
206 | SET(SOURCES |
---|
207 | ${SOURCES} |
---|
208 | include/cluster/dataIO_clusterAsioTcpIostream.h |
---|
209 | src/cluster/dataIO_clusterAsioTcpIostream.cpp |
---|
210 | ) |
---|
211 | ADD_DEFINITIONS( "-DUSE_CLUSTER_ASIO_TCP_IOSTREAM" ) |
---|
212 | ADD_DEFINITIONS( "-D_WIN32_WINNT=0x0501" ) |
---|
213 | SET(BOOST_LIBRARY_PATH "../../../3rdParty_x86_x64/lib/${DESTINATION_ARCH}/" CACHE PATH "Select the library folder of Boost libraries to link against." ) |
---|
214 | SET(BOOST_INCLUDE_DIR "../../../3rdParty_x86_x64/include/boost-1.43.0/" CACHE PATH "Enter the path to the the include directory of Boost" ) |
---|
215 | INCLUDE_DIRECTORIES(${BOOST_INCLUDE_DIR}) |
---|
216 | LINK_DIRECTORIES(${BOOST_LIBRARY_PATH}) |
---|
217 | ELSE() |
---|
218 | UNSET(BOOST_LIBRARY_PATH CACHE) |
---|
219 | UNSET(BOOST_ASIO_INCLUDE_DIR CACHE) |
---|
220 | ENDIF() |
---|
221 | |
---|
222 | IF( USE_CLUSTER_ENET ) |
---|
223 | SET(SOURCES |
---|
224 | ${SOURCES} |
---|
225 | include/cluster/dataIO_clusterENet.h |
---|
226 | src/cluster/dataIO_clusterENet.cpp |
---|
227 | include/cluster/dataIO_clusterENet_implementation.h |
---|
228 | src/cluster/dataIO_clusterENet_implementation.cpp |
---|
229 | src/cluster/enet/callbacks.c |
---|
230 | src/cluster/enet/compress.c |
---|
231 | src/cluster/enet/host.c |
---|
232 | src/cluster/enet/list.c |
---|
233 | src/cluster/enet/packet.c |
---|
234 | src/cluster/enet/peer.c |
---|
235 | src/cluster/enet/protocol.c |
---|
236 | src/cluster/enet/unix.c |
---|
237 | src/cluster/enet/win32.c |
---|
238 | include/cluster/enet/callbacks.h |
---|
239 | include/cluster/enet/enet.h |
---|
240 | include/cluster/enet/list.h |
---|
241 | include/cluster/enet/protocol.h |
---|
242 | include/cluster/enet/time.h |
---|
243 | include/cluster/enet/types.h |
---|
244 | include/cluster/enet/unix.h |
---|
245 | include/cluster/enet/utility.h |
---|
246 | include/cluster/enet/win32.h |
---|
247 | ) |
---|
248 | ADD_DEFINITIONS( "-DUSE_CLUSTER_ENET" ) |
---|
249 | ENDIF() |
---|
250 | |
---|
251 | |
---|
252 | |
---|
253 | |
---|
254 | # Module extLink |
---|
255 | SET(SOURCES |
---|
256 | ${SOURCES} |
---|
257 | include/extLink/dataIO_extLinkDummy.h |
---|
258 | src/extLink/dataIO_extLinkDummy.cpp |
---|
259 | include/extLink/dataIO_extLink.h |
---|
260 | include/extLink/manip_extLink.h |
---|
261 | src/extLink/manip_extLink.cpp |
---|
262 | ) |
---|
263 | IF ( WIN32 ) |
---|
264 | SET(USE_EXTLINK_VCL ON CACHE BOOL "Enable to use the VCL Implementation for the externalLink interface") |
---|
265 | IF( USE_EXTLINK_VCL ) |
---|
266 | SET(EXTLINK_VCL_INCLUDE_DIR ../../VCL_1.0.3.4/source/include/VCL CACHE PATH "Select the INCLUDE directory path for extLink VCL Implementation." ) |
---|
267 | SET(SOURCES |
---|
268 | ${SOURCES} |
---|
269 | include/extLink/dataIO_extLinkVCL.h |
---|
270 | src/extLink/dataIO_extLinkVCL.cpp |
---|
271 | ) |
---|
272 | INCLUDE_DIRECTORIES(${EXTLINK_VCL_INCLUDE_DIR}) |
---|
273 | ADD_DEFINITIONS( "-DUSE_EXTLINK_VCL" ) |
---|
274 | #Linking: VCL uses #pragma to link, no need for linking configuration in CMAKE |
---|
275 | ELSE(USE_EXTLINK_VCL) |
---|
276 | UNSET(EXTLINK_VCL_INCLUDE_DIR CACHE) |
---|
277 | ENDIF(USE_EXTLINK_VCL) |
---|
278 | ELSE(WIN32) |
---|
279 | UNSET(EXTLINK_VCL_INCLUDE_DIR CACHE) |
---|
280 | |
---|
281 | |
---|
282 | ENDIF(WIN32) |
---|
283 | |
---|
284 | |
---|
285 | |
---|
286 | # Set core sources |
---|
287 | SET(SOURCES |
---|
288 | ${SOURCES} |
---|
289 | # Core |
---|
290 | include/core/visual_core.h |
---|
291 | src/core/visual_core.cpp |
---|
292 | src/core/osgVisual.cpp |
---|
293 | include/core/core_manipulator.h |
---|
294 | src/core/core_manipulator.cpp |
---|
295 | # Memory Leak debugging |
---|
296 | include/core/leakDetection.h |
---|
297 | # Util |
---|
298 | include/util/visual_util.h |
---|
299 | src/util/visual_util.cpp |
---|
300 | # Draw 2D |
---|
301 | include/draw2D/visual_draw2D.h |
---|
302 | src/draw2D/visual_draw2D.cpp |
---|
303 | # Debug HUD |
---|
304 | include/draw2D/visual_debug_hud.h |
---|
305 | src/draw2D/visual_debug_hud.cpp |
---|
306 | # Example HUD |
---|
307 | include/draw2D/visual_hud.h |
---|
308 | src/draw2D/visual_hud.cpp |
---|
309 | # Draw 3D |
---|
310 | include/draw3D/visual_draw3D.h |
---|
311 | src/draw3D/visual_draw3D.cpp |
---|
312 | # Object Mounted Manipulator |
---|
313 | include/manip_ObjectMounted/manip_objectMounted.h |
---|
314 | src/manip_ObjectMounted/manip_objectMounted.cpp |
---|
315 | # Objects |
---|
316 | include/object/visual_object.h |
---|
317 | include/object/object_updater.h |
---|
318 | src/object/visual_object.cpp |
---|
319 | src/object/object_updater.cpp |
---|
320 | # DataIO |
---|
321 | include/dataIO/visual_dataIO.h |
---|
322 | include/dataIO/dataIO_transportContainer.h |
---|
323 | include/dataIO/dataIO_slot.h |
---|
324 | include/dataIO/dataIO_executer.h |
---|
325 | src/dataIO/visual_dataIO.cpp |
---|
326 | src/dataIO/dataIO_transportContainer.cpp |
---|
327 | src/dataIO/dataIO_slot.cpp |
---|
328 | src/dataIO/dataIO_executer.cpp |
---|
329 | ) |
---|
330 | |
---|
331 | INCLUDE_DIRECTORIES(include/core include/util include/draw2D include/draw3D include/object include/manip_ObjectMounted) |
---|
332 | INCLUDE_DIRECTORIES(include/dataIO include/cluster include/extLink ${OPENSCENEGRAPH_INCLUDE_DIRS} .) |
---|
333 | |
---|
334 | |
---|
335 | # Executable Output |
---|
336 | SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) |
---|
337 | ADD_EXECUTABLE(osgVisual ${SOURCES}) |
---|
338 | |
---|
339 | |
---|
340 | # Linking |
---|
341 | TARGET_LINK_LIBRARIES(osgVisual ${OPENSCENEGRAPH_LIBRARIES} ${OPENGL_LIBRARIES} ${LIBXML2_LIBRARY}) |
---|
342 | |
---|
343 | |
---|
344 | IF(USE_SKY_SILVERLINING ) |
---|
345 | IF(WIN32) |
---|
346 | TARGET_LINK_LIBRARIES(osgVisual "winmm.lib") |
---|
347 | ENDIF(WIN32) |
---|
348 | TARGET_LINK_LIBRARIES(osgVisual debug ${SILVERLINING_LIBRARY_DEBUG} optimized ${SILVERLINING_LIBRARY_RELEASE}) |
---|
349 | ENDIF(USE_SKY_SILVERLINING) |
---|
350 | |
---|
351 | IF(USE_VISTA2D) |
---|
352 | TARGET_LINK_LIBRARIES(osgVisual debug ${VISTA2D_LIBRARY_DEBUG} optimized ${VISTA2D_LIBRARY_RELEASE}) |
---|
353 | ENDIF(USE_VISTA2D) |
---|
354 | |
---|
355 | IF(USE_CLUSTER_ENET AND WIN32) |
---|
356 | TARGET_LINK_LIBRARIES(osgVisual "winmm.lib" "ws2_32.lib" ) |
---|
357 | ENDIF(USE_CLUSTER_ENET AND WIN32) |
---|
358 | |
---|
359 | # CMAKE Fix for VS to not prepend build type to path. |
---|
360 | IF(MSVC) |
---|
361 | SET_TARGET_PROPERTIES(osgVisual PROPERTIES PREFIX "../") |
---|
362 | ENDIF(MSVC) |
---|
363 | SET_TARGET_PROPERTIES( osgVisual PROPERTIES DEBUG_POSTFIX d ) |
---|
364 | |
---|
365 | # Adding definitions to disable multicore compiling |
---|
366 | IF(MSVC) |
---|
367 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP1") |
---|
368 | ENDIF(MSVC) |
---|
369 | |
---|
370 | # Generating vcproj file, if MSVC to preset debugging parameter - based on http://stackoverflow.com/questions/1005901/how-to-set-path-environment-variable-using-cmake-and-visual-studio-to-run-test |
---|
371 | IF (MSVC) |
---|
372 | # Set up a default .user file that contains the debugging setup |
---|
373 | ## Find user and system name |
---|
374 | SET(SYSTEM_NAME $ENV{USERDOMAIN} CACHE STRING "Build System Name") |
---|
375 | SET(USER_NAME $ENV{USERNAME} CACHE STRING "Build System UserName") |
---|
376 | SET(USERFILE_COMMAND_DEBUG "$(TargetPath)" CACHE STRING "Command to execute on debugging (VS Project settings)" ) |
---|
377 | SET(USERFILE_WORKING_DIRECTORY_DEBUG "bin" CACHE STRING "Working directory on debugging (VS Project settings)" ) |
---|
378 | SET(USERFILE_COMMAND_ARGUMENTS_DEBUG " --window 100 100 800 600 --config osgVisualConfig.xml" CACHE STRING "Command arguments (VS Project settings)" ) |
---|
379 | SET(USERFILE_REMOTE_MACHINE_DEBUG ${USER_NAME} CACHE STRING "Remote Debugging Machine (VS Project settings)") |
---|
380 | IF (DESTINATION_ARCH STREQUAL "x64") |
---|
381 | SET(USERFILE_ENVIRONMENT "PATH=%OSG_X64%;%PATH%" CACHE STRING "Environment Variables that VS should merge on thy fly with system environment to run osgVisual (VS Project settings)") |
---|
382 | ENDIF () |
---|
383 | |
---|
384 | |
---|
385 | # Only do this if one doesn't already exist |
---|
386 | SET (USER_FILE ${PROJECT_NAME}.vcproj.${SYSTEM_NAME}.${USER_NAME}.user) |
---|
387 | IF (NOT EXISTS "${USER_FILE}") |
---|
388 | message (STATUS "Creating ${USER_FILE} with default debug settings") |
---|
389 | # These are the configuration variables |
---|
390 | IF (CMAKE_GENERATOR MATCHES "Win64") |
---|
391 | SET (USERFILE_PLATFORM "x64") |
---|
392 | ELSE () |
---|
393 | SET (USERFILE_PLATFORM "Win32") |
---|
394 | ENDIF () |
---|
395 | |
---|
396 | # Configure the template file |
---|
397 | # MSC_VER 1300: MSC 13.0, VC 7.0, VS 2002 |
---|
398 | # MSC_VER 1310: MSC 13.1, VC 7.1, VS 2003 |
---|
399 | # MSC_VER 1400: MSC 14.0, VC 8.0, VS 2005 |
---|
400 | # MSC_VER 1500: MSC 15.0, VC 9.0, VS 2008 |
---|
401 | # MSC_VER 1600: MSC ??.0, VC 10.0, VS 2010 |
---|
402 | IF (MSVC_VERSION EQUAL 1400) |
---|
403 | CONFIGURE_FILE(VC80.vcproj.user.template ${USER_FILE} @ONLY) |
---|
404 | ENDIF() |
---|
405 | IF (MSVC_VERSION EQUAL 1500) |
---|
406 | CONFIGURE_FILE(VC90.vcproj.user.template ${USER_FILE} @ONLY) |
---|
407 | ENDIF() |
---|
408 | ELSE() |
---|
409 | message (STATUS "Userfile ${USER_FILE} already exist: Skipping") |
---|
410 | ENDIF() |
---|
411 | ENDIF() |
---|
412 | |
---|
413 | |
---|