1 cmake_minimum_required(VERSION 2.8.11)
5 include(CheckFunctionExists)
6 include(CheckIncludeFiles)
7 include(CMakeDependentOption)
8 include(GNUInstallDirs)
13 set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
15 option(BUILD_SHARED_LIBS "Build shared libraries." ON)
16 option(ODE_16BIT_INDICES "Use 16-bit indices for trimeshes (default is 32-bit)." OFF)
17 option(ODE_NO_BUILTIN_THREADING_IMPL "Disable built-in multithreaded threading implementation." OFF)
18 option(ODE_NO_THREADING_INTF "Disable threading interface support (external implementations cannot be assigned." OFF)
19 option(ODE_OLD_TRIMESH "Use old OPCODE trimesh-trimesh collider." OFF)
20 option(ODE_WITH_DEMOS "Builds the demo applications and DrawStuff library." ON)
21 option(ODE_WITH_GIMPACT "Use GIMPACT for trimesh collisions (experimental)." OFF)
22 option(ODE_WITH_LIBCCD "Use libccd for handling some collision tests absent in ODE." OFF)
23 option(ODE_WITH_OPCODE "Use old OPCODE trimesh-trimesh collider." ON)
24 option(ODE_WITH_OU "Use TLS for global caches (allows threaded collision checks for separated spaces)." OFF)
25 option(ODE_WITH_TESTS "Builds the unit test application." ON)
27 cmake_dependent_option(ODE_WITH_LIBCCD_BOX_CYL "Use libccd for box-cylinder." ON "ODE_WITH_LIBCCD" OFF)
28 cmake_dependent_option(ODE_WITH_LIBCCD_CAP_CYL "Use libccd for capsule-cylinder." ON "ODE_WITH_LIBCCD" OFF)
29 cmake_dependent_option(ODE_WITH_LIBCCD_CYL_CYL "Use libccd for cylinder-cylinder." ON "ODE_WITH_LIBCCD" OFF)
30 cmake_dependent_option(ODE_WITH_LIBCCD_CONVEX_BOX "Use libccd for convex-box." ON "ODE_WITH_LIBCCD" OFF)
31 cmake_dependent_option(ODE_WITH_LIBCCD_CONVEX_CAP "Use libccd for convex-capsule." ON "ODE_WITH_LIBCCD" OFF)
32 cmake_dependent_option(ODE_WITH_LIBCCD_CONVEX_CONVEX "Use libccd for convex-convex." ON "ODE_WITH_LIBCCD" OFF)
33 cmake_dependent_option(ODE_WITH_LIBCCD_CONVEX_CYL "Use libccd for convex-cylinder." ON "ODE_WITH_LIBCCD" OFF)
34 cmake_dependent_option(ODE_WITH_LIBCCD_CONVEX_SPHERE "Use libccd for convex-sphere." ON "ODE_WITH_LIBCCD" OFF)
35 cmake_dependent_option(ODE_WITH_LIBCCD_SYSTEM "Use system libccd." OFF "ODE_WITH_LIBCCD" OFF)
37 if(CMAKE_SIZEOF_VOID_P EQUAL 4)
38 option(ODE_DOUBLE_PRECISION "Use double-precision math." OFF)
40 option(ODE_DOUBLE_PRECISION "Use double-precision math." ON)
46 set(CMAKE_REQUIRED_INCLUDES ${OPENGL_INCLUDE_DIR})
47 set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} ${OPENGL_LIBRARIES})
49 if(APPLE AND OPENGL_FOUND)
50 set(HAVE_APPLE_OPENGL_FRAMEWORK ON)
52 check_include_files(alloca.h HAVE_ALLOCA_H)
53 check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
54 check_include_files(inttypes.h HAVE_INTTYPES_H)
55 check_function_exists(isnan HAVE_ISNAN)
56 check_function_exists(isnanf HAVE_ISNANF)
57 check_include_files(malloc.h HAVE_MALLOC_H)
58 check_function_exists(pthread_attr_setstacklazy HAVE_PTHREAD_ATTR_SETSTACKLAZY)
59 check_function_exists(pthread_condattr_setclock HAVE_PTHREAD_CONDATTR_SETCLOCK)
60 check_include_files(stdint.h HAVE_STDINT_H)
61 check_include_files(sys/time.h HAVE_SYS_TIME_H)
62 check_include_files(sys/types.h HAVE_SYS_TYPES_H)
63 check_include_files(unistd.h HAVE_UNISTD_H)
64 check_function_exists(_isnan HAVE__ISNAN)
65 check_function_exists(_isnanf HAVE__ISNANF)
66 check_function_exists(__isnan HAVE___ISNAN)
67 check_function_exists(__isnanf HAVE___ISNANF)
69 set(MAC_OS_X_VERSION 1000)
70 check_function_exists(OSAtomicAdd32Barrier MAC_OS_X_VERSION_1040)
71 if(MAC_OS_X_VERSION_1040)
72 set(MAC_OS_X_VERSION 1040)
74 check_function_exists(OSAtomicAnd32OrigBarrier MAC_OS_X_VERSION_1050)
75 if(MAC_OS_X_VERSION_1050)
76 set(MAC_OS_X_VERSION 1050)
79 if(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|x86.*|x86_64.*|amd64.*|AMD64.*")
82 if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64.*|amd64.*|AMD64.*")
86 set(_OU_FEATURE_SET _OU_FEATURE_SET_TLS)
87 elseif(NOT ODE_NO_THREADING_INTF)
88 set(_OU_FEATURE_SET _OU_FEATURE_SET_ATOMICS)
90 set(_OU_FEATURE_SET _OU_FEATURE_SET_BASICS)
92 set(_OU_NAMESPACE odeou)
94 set(_OU_TARGET_OS _OU_TARGET_OS_WINDOWS)
96 set(_OU_TARGET_OS _OU_TARGET_OS_MAC)
98 set(_OU_TARGET_OS _OU_TARGET_OS_QNX)
99 elseif(CMAKE_SYSTEM MATCHES "SunOS-4")
100 set(_OU_TARGET_OS _OU_TARGET_OS_SUNOS)
102 set(_OU_TARGET_OS _OU_TARGET_OS_GENUNIX)
105 configure_file(config.h.cmake.in ode/src/config.h)
107 if(ODE_DOUBLE_PRECISION)
108 set(CCD_PRECISION CCD_DOUBLE)
109 set(ODE_PRECISION dDOUBLE)
111 set(CCD_PRECISION CCD_SINGLE)
112 set(ODE_PRECISION dSINGLE)
115 configure_file(libccd/src/ccd/precision.h.in include/ccd/precision.h)
116 configure_file(include/ode/precision.h.in include/ode/precision.h)
118 set(ODE_VERSION ${VERSION})
120 configure_file(include/ode/version.h.in include/ode/version.h)
124 include/ode/collision.h
125 include/ode/collision_space.h
126 include/ode/collision_trimesh.h
128 include/ode/compatibility.h
129 include/ode/contact.h
130 include/ode/cooperative.h
132 include/ode/export-dif.h
135 include/ode/matrix_coop.h
138 include/ode/objects.h
140 include/ode/odeconfig.h
142 include/ode/odecpp_collision.h
143 include/ode/odeinit.h
144 include/ode/odemath.h
145 include/ode/odemath_legacy.h
146 include/ode/rotation.h
147 include/ode/threading.h
148 include/ode/threading_impl.h
150 ${CMAKE_CURRENT_BINARY_DIR}/include/ode/precision.h
151 ${CMAKE_CURRENT_BINARY_DIR}/include/ode/version.h
160 ode/src/collision_cylinder_box.cpp
161 ode/src/collision_cylinder_plane.cpp
162 ode/src/collision_cylinder_sphere.cpp
163 ode/src/collision_kernel.cpp
164 ode/src/collision_kernel.h
165 ode/src/collision_quadtreespace.cpp
166 ode/src/collision_sapspace.cpp
167 ode/src/collision_space.cpp
168 ode/src/collision_space_internal.h
169 ode/src/collision_std.h
170 ode/src/collision_transform.cpp
171 ode/src/collision_transform.h
172 ode/src/collision_trimesh_colliders.h
173 ode/src/collision_trimesh_disabled.cpp
174 ode/src/collision_trimesh_gimpact.h
175 ode/src/collision_trimesh_internal.h
176 ode/src/collision_trimesh_opcode.h
177 ode/src/collision_util.cpp
178 ode/src/collision_util.h
181 ode/src/coop_matrix_types.h
183 ode/src/default_threading.cpp
184 ode/src/default_threading.h
187 ode/src/export-dif.cpp
189 ode/src/fastdot_impl.h
190 ode/src/fastldltfactor.cpp
191 ode/src/fastldltfactor_impl.h
192 ode/src/fastldltsolve.cpp
193 ode/src/fastldltsolve_impl.h
194 ode/src/fastlsolve.cpp
195 ode/src/fastlsolve_impl.h
196 ode/src/fastltsolve.cpp
197 ode/src/fastltsolve_impl.h
198 ode/src/fastvecscale.cpp
199 ode/src/fastvecscale_impl.h
200 ode/src/heightfield.cpp
201 ode/src/heightfield.h
223 ode/src/quickstep.cpp
226 ode/src/resource_control.cpp
227 ode/src/resource_control.h
229 ode/src/simple_cooperative.cpp
230 ode/src/simple_cooperative.h
234 ode/src/threaded_solver_ldlt.h
235 ode/src/threading_atomics_provs.h
236 ode/src/threading_base.cpp
237 ode/src/threading_base.h
238 ode/src/threading_fake_sync.h
239 ode/src/threading_impl.cpp
240 ode/src/threading_impl.h
241 ode/src/threading_impl_posix.h
242 ode/src/threading_impl_templates.h
243 ode/src/threading_impl_win.h
244 ode/src/threading_pool_posix.cpp
245 ode/src/threading_pool_win.cpp
246 ode/src/threadingutils.h
251 ode/src/joints/amotor.cpp
252 ode/src/joints/amotor.h
253 ode/src/joints/ball.cpp
254 ode/src/joints/ball.h
255 ode/src/joints/contact.cpp
256 ode/src/joints/contact.h
257 ode/src/joints/dball.cpp
258 ode/src/joints/dball.h
259 ode/src/joints/dhinge.cpp
260 ode/src/joints/dhinge.h
261 ode/src/joints/fixed.cpp
262 ode/src/joints/fixed.h
263 ode/src/joints/hinge.cpp
264 ode/src/joints/hinge.h
265 ode/src/joints/hinge2.cpp
266 ode/src/joints/hinge2.h
267 ode/src/joints/joint.cpp
268 ode/src/joints/joint.h
269 ode/src/joints/joint_internal.h
270 ode/src/joints/joints.h
271 ode/src/joints/lmotor.cpp
272 ode/src/joints/lmotor.h
273 ode/src/joints/null.cpp
274 ode/src/joints/null.h
275 ode/src/joints/piston.cpp
276 ode/src/joints/piston.h
277 ode/src/joints/plane2d.cpp
278 ode/src/joints/plane2d.h
279 ode/src/joints/pr.cpp
281 ode/src/joints/pu.cpp
283 ode/src/joints/slider.cpp
284 ode/src/joints/slider.h
285 ode/src/joints/transmission.cpp
286 ode/src/joints/transmission.h
287 ode/src/joints/universal.cpp
288 ode/src/joints/universal.h
291 if(ODE_WITH_GIMPACT AND NOT ODE_NO_TRIMESH)
294 GIMPACT/src/gim_boxpruning.cpp
295 GIMPACT/src/gim_contact.cpp
296 GIMPACT/src/gim_math.cpp
297 GIMPACT/src/gim_memory.cpp
298 GIMPACT/src/gim_tri_tri_overlap.cpp
299 GIMPACT/src/gim_trimesh.cpp
300 GIMPACT/src/gim_trimesh_capsule_collision.cpp
301 GIMPACT/src/gim_trimesh_ray_collision.cpp
302 GIMPACT/src/gim_trimesh_sphere_collision.cpp
303 GIMPACT/src/gim_trimesh_trimesh_collision.cpp
304 GIMPACT/src/gimpact.cpp
305 ode/src/collision_convex_trimesh.cpp
306 ode/src/collision_cylinder_trimesh.cpp
307 ode/src/collision_trimesh_box.cpp
308 ode/src/collision_trimesh_ccylinder.cpp
309 ode/src/collision_trimesh_gimpact.cpp
310 ode/src/collision_trimesh_internal.cpp
311 ode/src/collision_trimesh_internal_impl.h
312 ode/src/collision_trimesh_internal.h
313 ode/src/collision_trimesh_plane.cpp
314 ode/src/collision_trimesh_ray.cpp
315 ode/src/collision_trimesh_sphere.cpp
316 ode/src/collision_trimesh_trimesh.cpp
317 ode/src/gimpact_contact_export_helper.cpp
318 ode/src/gimpact_contact_export_helper.h
319 ode/src/gimpact_gim_contact_accessor.h
320 ode/src/gimpact_plane_contact_accessor.h
325 if(NOT ODE_WITH_LIBCCD_SYSTEM)
331 libccd/src/polytope.c
334 libccd/src/ccd/alloc.h
336 libccd/src/ccd/compiler.h
338 libccd/src/ccd/list.h
339 libccd/src/ccd/quat.h
340 libccd/src/ccd/polytope.h
341 libccd/src/ccd/simplex.h
342 libccd/src/ccd/support.h
343 libccd/src/ccd/vec3.h
344 libccd/src/custom/ccdcustom/quat.h
345 libccd/src/custom/ccdcustom/vec3.h
351 ode/src/collision_libccd.cpp
352 ode/src/collision_libccd.h
356 if(ODE_WITH_OPCODE AND NOT ODE_NO_TRIMESH)
359 ode/src/collision_convex_trimesh.cpp
360 ode/src/collision_cylinder_trimesh.cpp
361 ode/src/collision_trimesh_box.cpp
362 ode/src/collision_trimesh_ccylinder.cpp
363 ode/src/collision_trimesh_internal.cpp
364 ode/src/collision_trimesh_internal_impl.h
365 ode/src/collision_trimesh_internal.h
366 ode/src/collision_trimesh_opcode.cpp
367 ode/src/collision_trimesh_plane.cpp
368 ode/src/collision_trimesh_ray.cpp
369 ode/src/collision_trimesh_sphere.cpp
370 ode/src/collision_trimesh_trimesh.cpp
371 ode/src/collision_trimesh_trimesh_old.cpp
372 OPCODE/OPC_AABBCollider.cpp
373 OPCODE/OPC_AABBCollider.h
374 OPCODE/OPC_AABBTree.cpp
375 OPCODE/OPC_AABBTree.h
376 OPCODE/OPC_BaseModel.cpp
377 OPCODE/OPC_BaseModel.h
378 OPCODE/OPC_BoxBoxOverlap.h
379 OPCODE/OPC_Collider.cpp
380 OPCODE/OPC_Collider.h
381 OPCODE/OPC_Common.cpp
383 OPCODE/OPC_HybridModel.cpp
384 OPCODE/OPC_HybridModel.h
386 OPCODE/OPC_LSSAABBOverlap.h
387 OPCODE/OPC_LSSCollider.cpp
388 OPCODE/OPC_LSSCollider.h
389 OPCODE/OPC_LSSTriOverlap.h
390 OPCODE/OPC_MeshInterface.cpp
391 OPCODE/OPC_MeshInterface.h
394 OPCODE/OPC_OBBCollider.cpp
395 OPCODE/OPC_OBBCollider.h
396 OPCODE/OPC_OptimizedTree.cpp
397 OPCODE/OPC_OptimizedTree.h
398 OPCODE/OPC_Picking.cpp
400 OPCODE/OPC_PlanesAABBOverlap.h
401 OPCODE/OPC_PlanesCollider.cpp
402 OPCODE/OPC_PlanesCollider.h
403 OPCODE/OPC_PlanesTriOverlap.h
404 OPCODE/OPC_RayAABBOverlap.h
405 OPCODE/OPC_RayCollider.cpp
406 OPCODE/OPC_RayCollider.h
407 OPCODE/OPC_RayTriOverlap.h
408 OPCODE/OPC_Settings.h
409 OPCODE/OPC_SphereAABBOverlap.h
410 OPCODE/OPC_SphereCollider.cpp
411 OPCODE/OPC_SphereCollider.h
412 OPCODE/OPC_SphereTriOverlap.h
413 OPCODE/OPC_TreeBuilders.cpp
414 OPCODE/OPC_TreeBuilders.h
415 OPCODE/OPC_TreeCollider.cpp
416 OPCODE/OPC_TreeCollider.h
417 OPCODE/OPC_TriBoxOverlap.h
418 OPCODE/OPC_TriTriOverlap.h
419 OPCODE/OPC_VolumeCollider.cpp
420 OPCODE/OPC_VolumeCollider.h
424 OPCODE/Ice/IceAABB.cpp
427 OPCODE/Ice/IceBoundingSphere.h
428 OPCODE/Ice/IceContainer.cpp
429 OPCODE/Ice/IceContainer.h
431 OPCODE/Ice/IceHPoint.cpp
432 OPCODE/Ice/IceHPoint.h
433 OPCODE/Ice/IceIndexedTriangle.cpp
434 OPCODE/Ice/IceIndexedTriangle.h
436 OPCODE/Ice/IceMatrix3x3.cpp
437 OPCODE/Ice/IceMatrix3x3.h
438 OPCODE/Ice/IceMatrix4x4.cpp
439 OPCODE/Ice/IceMatrix4x4.h
440 OPCODE/Ice/IceMemoryMacros.h
441 OPCODE/Ice/IceOBB.cpp
443 OPCODE/Ice/IcePairs.h
444 OPCODE/Ice/IcePlane.cpp
445 OPCODE/Ice/IcePlane.h
446 OPCODE/Ice/IcePoint.cpp
447 OPCODE/Ice/IcePoint.h
448 OPCODE/Ice/IcePreprocessor.h
449 OPCODE/Ice/IceRandom.cpp
450 OPCODE/Ice/IceRandom.h
451 OPCODE/Ice/IceRay.cpp
453 OPCODE/Ice/IceRevisitedRadix.cpp
454 OPCODE/Ice/IceRevisitedRadix.h
455 OPCODE/Ice/IceSegment.cpp
456 OPCODE/Ice/IceSegment.h
457 OPCODE/Ice/IceTriangle.cpp
458 OPCODE/Ice/IceTriangle.h
459 OPCODE/Ice/IceTriList.h
460 OPCODE/Ice/IceTypes.h
461 OPCODE/Ice/IceUtils.cpp
462 OPCODE/Ice/IceUtils.h
473 ou/src/ou/customization.cpp
475 ou/src/ou/threadlocalstorage.cpp
478 add_library(ODE ${SRCS})
480 set_target_properties(
484 POSITION_INDEPENDENT_CODE ON
489 if(BUILD_SHARED_LIBS)
490 set_target_properties(ODE PROPERTIES DEBUG_POSTFIX d)
492 set_target_properties(
498 RELWITHDEBINFO_POSTFIX s
502 if(ODE_DOUBLE_PRECISION)
503 set_target_properties(ODE PROPERTIES OUTPUT_NAME ode_double)
505 set_target_properties(ODE PROPERTIES OUTPUT_NAME ode_single)
509 target_compile_definitions(
512 -D_OU_NAMESPACE=${_OU_NAMESPACE}
513 -D_OU_FEATURE_SET=${_OU_FEATURE_SET}
514 -D_OU_TARGET_OS=${_OU_TARGET_OS}
515 $<$<NOT:$<CONFIG:Debug>>:dNODEBUG>
520 target_compile_definitions(ODE PRIVATE -DMAC_OS_X_VERSION=${MAC_OS_X_VERSION})
524 target_compile_definitions(ODE PRIVATE -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES)
527 if(BUILD_SHARED_LIBS)
528 target_compile_definitions(ODE PRIVATE -DODE_DLL)
530 target_compile_definitions(ODE PRIVATE -DODE_LIB)
533 if(ODE_DOUBLE_PRECISION)
534 target_compile_definitions(ODE PUBLIC -DdIDEDOUBLE PRIVATE -DCCD_IDEDOUBLE)
536 target_compile_definitions(ODE PUBLIC -DdIDESINGLE PRIVATE -DCCD_IDESINGLE)
539 target_include_directories(
542 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
543 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/ode/src>
544 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
545 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/ode/src>
546 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/ode/src/joints>
547 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/ou/include>
548 $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>
551 if(ODE_16BIT_INDICES)
552 target_compile_definitions(ODE PRIVATE -DdTRIMESH_16BIT_INDICES)
555 if(NOT ODE_NO_BUILTIN_THREADING_IMPL)
556 target_compile_definitions(ODE PRIVATE -DdBUILTIN_THREADING_IMPL_ENABLED)
559 if(ODE_NO_THREADING_INTF)
560 target_compile_definitions(ODE PRIVATE -DdTHREADING_INTF_DISABLED)
563 if(ODE_WITH_GIMPACT AND NOT ODE_NO_TRIMESH)
564 target_compile_definitions(ODE PRIVATE -DdTRIMESH_ENABLED -DdTRIMESH_GIMPACT)
565 target_include_directories(ODE PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GIMPACT/include>)
569 if(ODE_WITH_LIBCCD_SYSTEM)
571 target_compile_definitions(ode PRIVATE -DdLIBCCD_ENABLED -DdLIBCCD_SYSTEM)
572 target_link_libraries(ODE ccd::ccd)
574 target_compile_definitions(ODE PRIVATE -DdLIBCCD_ENABLED -DdLIBCCD_INTERNAL)
575 target_include_directories(
578 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libccd/src>
579 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libccd/src/custom>
583 if(ODE_WITH_LIBCCD_BOX_CYL)
584 target_compile_definitions(ODE PRIVATE -DdLIBCCD_BOX_CYL)
587 if(ODE_WITH_LIBCCD_CAP_CYL)
588 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CAP_CYL)
591 if(ODE_WITH_LIBCCD_CYL_CYL)
592 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CYL_CYL)
595 if(ODE_WITH_LIBCCD_CONVEX_BOX)
596 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_BOX)
599 if(ODE_WITH_LIBCCD_CONVEX_CAP)
600 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_CAP)
603 if(ODE_WITH_LIBCCD_CONVEX_CONVEX)
604 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_CONVEX)
607 if(ODE_WITH_LIBCCD_CONVEX_CYL)
608 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_CYL)
611 if(ODE_WITH_LIBCCD_CONVEX_SPHERE)
612 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_SPHERE)
616 if(ODE_WITH_OPCODE AND NOT ODE_NO_TRIMESH)
617 target_compile_definitions(ODE PRIVATE -DdTRIMESH_ENABLED -DdTRIMESH_OPCODE)
620 target_compile_definitions(ODE PRIVATE -DdTRIMESH_OPCODE_USE_OLD_TRIMESH_TRIMESH_COLLIDER)
623 target_include_directories(
626 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/OPCODE>
627 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/OPCODE/Ice>
632 target_compile_definitions(ODE PRIVATE -DdATOMICS_ENABLED -DdTLS_ENABLED)
633 elseif(NOT ODE_NO_THREADING_INTF)
634 target_compile_definitions(ODE PRIVATE -DdATOMICS_ENABLED)
637 if(ODE_WITH_OU OR NOT ODE_NO_THREADING_INTF)
638 target_link_libraries(ODE ${CMAKE_THREAD_LIBS_INIT})
644 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development
645 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_SKIP
646 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
649 if(BUILD_SHARED_LIBS)
653 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development NAMELINK_ONLY
657 if(MSVC AND BUILD_SHARED_LIBS AND NOT CMAKE_VERSION VERSION_LESS 3.1)
658 install(FILES $<TARGET_PDB_FILE:ODE> DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug)
661 install(FILES ${HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ode COMPONENT development)
663 set(prefix ${CMAKE_INSTALL_PREFIX})
664 set(exec_prefix "\${prefix}")
665 set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
666 set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
667 configure_file(ode.pc.in ode.pc @ONLY)
668 configure_file(ode-config.in ode-config @ONLY)
670 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ode.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT development)
671 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ode-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development)
673 unset(DRAWSTUFF_RSRC)
678 include/drawstuff/drawstuff.h
679 include/drawstuff/version.h
680 drawstuff/src/drawstuff.cpp
681 drawstuff/src/internal.h
685 set(DRAWSTUFF_RSRC drawstuff/src/resources.rc)
687 APPEND DRAWSTUFF_SRCS
688 drawstuff/src/resource.h
689 drawstuff/src/windows.cpp
693 list(APPEND DRAWSTUFF_SRCS drawstuff/src/osx.cpp)
695 list(APPEND DRAWSTUFF_SRCS drawstuff/src/x11.cpp)
698 add_library(drawstuff ${DRAWSTUFF_SRCS})
699 target_compile_definitions(drawstuff PUBLIC -DDRAWSTUFF_TEXTURE_PATH="${CMAKE_CURRENT_SOURCE_DIR}/drawstuff/textures")
701 if(BUILD_SHARED_LIBS)
702 target_compile_definitions(drawstuff PRIVATE -DDS_DLL -DUSRDLL)
704 target_compile_definitions(drawstuff PRIVATE -DDS_LIB)
707 target_include_directories(drawstuff PUBLIC ${OPENGL_INCLUDE_DIR})
708 target_link_libraries(drawstuff ODE ${OPENGL_LIBRARIES})
711 target_link_libraries(drawstuff winmm)
714 target_include_directories(drawstuff PUBLIC ${GLUT_INCLUDE_DIR})
715 target_link_libraries(drawstuff ${GLUT_LIBRARIES})
718 target_include_directories(drawstuff PUBLIC ${X11_INCLUDE_DIR})
719 target_link_libraries(drawstuff ${X11_LIBRARIES})
724 ode/demo/demo_boxstack.cpp
725 ode/demo/demo_buggy.cpp
726 ode/demo/demo_cards.cpp
727 ode/demo/demo_chain1.c
728 ode/demo/demo_chain2.cpp
729 ode/demo/demo_collision.cpp
730 ode/demo/demo_convex.cpp
731 ode/demo/demo_crash.cpp
732 ode/demo/demo_cylvssphere.cpp
733 ode/demo/demo_dball.cpp
734 ode/demo/demo_dhinge.cpp
735 ode/demo/demo_feedback.cpp
736 ode/demo/demo_friction.cpp
737 ode/demo/demo_gyro2.cpp
738 ode/demo/demo_gyroscopic.cpp
739 ode/demo/demo_heightfield.cpp
740 ode/demo/demo_hinge.cpp
742 ode/demo/demo_jointPR.cpp
743 ode/demo/demo_jointPU.cpp
744 ode/demo/demo_joints.cpp
745 ode/demo/demo_kinematic.cpp
746 ode/demo/demo_motion.cpp
747 ode/demo/demo_motor.cpp
748 ode/demo/demo_ode.cpp
749 ode/demo/demo_piston.cpp
750 ode/demo/demo_plane2d.cpp
751 ode/demo/demo_rfriction.cpp
752 ode/demo/demo_slider.cpp
753 ode/demo/demo_space.cpp
754 ode/demo/demo_space_stress.cpp
755 ode/demo/demo_step.cpp
756 ode/demo/demo_transmission.cpp
759 if(NOT ODE_NO_TRIMESH)
762 ode/demo/demo_basket.cpp
763 ode/demo/demo_cyl.cpp
764 ode/demo/demo_moving_convex.cpp
765 ode/demo/demo_moving_trimesh.cpp
766 ode/demo/demo_tracks.cpp
767 ode/demo/demo_trimesh.cpp
771 foreach(MAIN_DEMO_SRC ${ALL_DEMO_SRCS})
772 get_filename_component(DEMO ${MAIN_DEMO_SRC} NAME_WE)
778 if(NOT WIN32 OR ${DEMO} STREQUAL "demo_ode")
779 add_executable(${DEMO} ${DEMO_SRC})
781 if(NOT BUILD_SHARED_LIBS)
788 add_executable(${DEMO} WIN32 ${DEMO_SRC})
790 set_target_properties(${DEMO} PROPERTIES LINK_FLAGS /ENTRY:mainCRTStartup)
793 target_link_libraries(${DEMO} drawstuff)
795 if(NOT WIN32 AND ${DEMO} STREQUAL "demo_chain1")
796 target_link_libraries(${DEMO} m)
809 tests/joints/amotor.cpp
810 tests/joints/ball.cpp
811 tests/joints/dball.cpp
812 tests/joints/fixed.cpp
813 tests/joints/hinge.cpp
814 tests/joints/hinge2.cpp
815 tests/joints/piston.cpp
818 tests/joints/slider.cpp
819 tests/joints/universal.cpp
820 tests/UnitTest++/src/AssertException.cpp
821 tests/UnitTest++/src/AssertException.h
822 tests/UnitTest++/src/CheckMacros.h
823 tests/UnitTest++/src/Checks.cpp
824 tests/UnitTest++/src/Checks.h
825 tests/UnitTest++/src/Config.h
826 tests/UnitTest++/src/DeferredTestReporter.cpp
827 tests/UnitTest++/src/DeferredTestReporter.h
828 tests/UnitTest++/src/DeferredTestResult.cpp
829 tests/UnitTest++/src/DeferredTestResult.h
830 tests/UnitTest++/src/MemoryOutStream.cpp
831 tests/UnitTest++/src/MemoryOutStream.h
832 tests/UnitTest++/src/ReportAssert.cpp
833 tests/UnitTest++/src/ReportAssert.h
834 tests/UnitTest++/src/Test.cpp
835 tests/UnitTest++/src/TestDetails.cpp
836 tests/UnitTest++/src/TestDetails.h
837 tests/UnitTest++/src/Test.h
838 tests/UnitTest++/src/TestList.cpp
839 tests/UnitTest++/src/TestList.h
840 tests/UnitTest++/src/TestMacros.h
841 tests/UnitTest++/src/TestReporter.cpp
842 tests/UnitTest++/src/TestReporter.h
843 tests/UnitTest++/src/TestReporterStdout.cpp
844 tests/UnitTest++/src/TestReporterStdout.h
845 tests/UnitTest++/src/TestResults.cpp
846 tests/UnitTest++/src/TestResults.h
847 tests/UnitTest++/src/TestRunner.cpp
848 tests/UnitTest++/src/TestRunner.h
849 tests/UnitTest++/src/TestSuite.h
850 tests/UnitTest++/src/TimeConstraint.cpp
851 tests/UnitTest++/src/TimeConstraint.h
852 tests/UnitTest++/src/TimeHelpers.h
853 tests/UnitTest++/src/UnitTest++.h
854 tests/UnitTest++/src/XmlTestReporter.cpp
855 tests/UnitTest++/src/XmlTestReporter.h
861 tests/UnitTest++/src/Win32/TimeHelpers.cpp
862 tests/UnitTest++/src/Win32/TimeHelpers.h
867 tests/UnitTest++/src/Posix/SignalTranslator.cpp
868 tests/UnitTest++/src/Posix/SignalTranslator.h
869 tests/UnitTest++/src/Posix/TimeHelpers.cpp
870 tests/UnitTest++/src/Posix/TimeHelpers.h
874 add_executable(tests ${TEST_SRCS})
875 target_include_directories(tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tests/UnitTest++/src)
876 target_link_libraries(tests ODE)
879 add_test(tests ${CMAKE_CURRENT_BINARY_DIR}/tests)
882 include(CMakePackageConfigHelpers)
884 configure_package_config_file(
885 ${CMAKE_CURRENT_SOURCE_DIR}/ode-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/ode-config.cmake
886 INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ode
889 FILES ${CMAKE_CURRENT_BINARY_DIR}/ode-config.cmake
890 DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ode-${VERSION}
891 COMPONENT development
893 write_basic_package_version_file(
894 ${CMAKE_CURRENT_BINARY_DIR}/ode-config-version.cmake
896 COMPATIBILITY ExactVersion
899 FILES ${CMAKE_CURRENT_BINARY_DIR}/ode-config-version.cmake
900 DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ode-${VERSION}
901 COMPONENT development
905 DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ode-${VERSION}
907 FILE ode-export.cmake
908 COMPONENT development
911 configure_file(cmake/cmake_uninstall.cmake.in cmake_uninstall.cmake @ONLY)
912 add_custom_target(uninstall ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
914 set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "ODE is a free, industrial quality library for simulating articulated rigid body dynamics - for example ground vehicles, legged creatures, and moving objects in VR environments. It is fast, flexible, robust and platform independent, with advanced joints, contact with friction, and built-in collision detection.")
916 set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime)
917 set(CPACK_COMPONENT_DEVELOPMENT_DESCRIPTION "Open Dynamics Engine - development files\n${CPACK_DEBIAN_PACKAGE_DESCRIPTION}")
918 set(CPACK_COMPONENT_RUNTIME_DESCRIPTION "Open Dynamics Engine - runtime library\n${CPACK_DEBIAN_PACKAGE_DESCRIPTION}")
919 set(CPACK_DEB_COMPONENT_INSTALL ON)
920 set(CPACK_DEBIAN_DEVELOPMENT_FILE_NAME "DEB-DEFAULT")
921 set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_SECTION "libdevel")
922 set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.ode.org/")
923 set(CPACK_DEBIAN_PACKAGE_NAME "libode")
924 set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
925 set(CPACK_DEBIAN_RUNTIME_FILE_NAME "DEB-DEFAULT")
926 set(CPACK_DEBIAN_RUNTIME_PACKAGE_SECTION "libs")
927 set(CPACK_DEBIAN_RUNTIME_PACKAGE_SHLIBDEPS ON)
928 set(CPACK_NSIS_PACKAGE_NAME "ODE ${VERSION}")
929 set(CPACK_NSIS_URL_INFO_ABOUT "http://www.ode.org/")
930 set(CPACK_PACKAGE_CONTACT "ode@ode.org")
931 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "High performance library for simulating rigid body dynamics")
932 set(CPACK_PACKAGE_DISPLAY_NAME "ODE ${VERSION}")
933 set(CPACK_PACKAGE_INSTALL_DIRECTORY "ode-${VERSION}")
934 set(CPACK_PACKAGE_NAME "ode")
935 set(CPACK_PACKAGE_VENDOR "")
936 set(CPACK_PACKAGE_VERSION ${VERSION})
937 set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
938 set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
939 set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
940 set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING)
941 set(CPACK_RPM_COMPONENT_INSTALL ON)
942 set(CPACK_RPM_DEVELOPMENT_FILE_NAME "RPM-DEFAULT")
943 set(CPACK_RPM_development_PACKAGE_DESCRIPTION "The ode-devel package contains libraries and header files for developing applications that use ode or ode-double.")
944 set(CPACK_RPM_development_PACKAGE_NAME "ode-devel")
945 set(CPACK_RPM_development_PACKAGE_SUMMARY "Development files for ODE")
946 set(CPACK_RPM_PACKAGE_DESCRIPTION "ODE is an open source, high performance library for simulating rigid body dynamics. It is fully featured, stable, mature and platform independent with an easy to use C/C++ API. It has advanced joint types and integrated collision detection with friction. ODE is useful for simulating vehicles, objects in virtual reality environments and virtual creatures. It is currently used in many computer games, 3D authoring tools and simulation tools.")
947 set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
948 set(CPACK_RPM_PACKAGE_LICENSE "BSD or LGPLv2+")
949 set(CPACK_RPM_PACKAGE_NAME "ode")
950 set(CPACK_RPM_PACKAGE_SUMMARY "High performance library for simulating rigid body dynamics")
951 set(CPACK_RPM_PACKAGE_URL "http://www.ode.org/")
952 set(CPACK_RPM_RUNTIME_FILE_NAME "RPM-DEFAULT")
954 if(ODE_DOUBLE_PRECISION)
955 set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_CONFLICTS "libode-sp-dev")
956 set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libode6")
957 set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "libode-dev")
958 set(CPACK_DEBIAN_RUNTIME_PACKAGE_CONFLICTS "libode6sp")
959 set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "libode6")
960 set(CPACK_RPM_development_PACKAGE_REQUIRES "ode-double")
961 set(CPACK_RPM_runtime_PACKAGE_CONFLICTS "ode")
962 set(CPACK_RPM_runtime_PACKAGE_DESCRIPTION "The ode-double package contains a version of the ODE library for simulating rigid body dynamics compiled with double precision.")
963 set(CPACK_RPM_runtime_PACKAGE_NAME "ode-double")
964 set(CPACK_RPM_runtime_PACKAGE_SUMMARY "ODE physics library compiled with double precision")
966 set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_CONFLICTS "libode-dev")
967 set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libode6sp")
968 set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "libode-sp-dev")
969 set(CPACK_DEBIAN_RUNTIME_PACKAGE_CONFLICTS "libode6")
970 set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "libode6sp")
971 set(CPACK_RPM_development_PACKAGE_REQUIRES "ode")
972 set(CPACK_RPM_runtime_PACKAGE_CONFLICTS "ode-double")
973 set(CPACK_RPM_runtime_PACKAGE_NAME "ode")