Update minimum required CMake version
[ode.git] / CMakeLists.txt
blob2d23e468ed5a8d45dbd040163e57b69a277b10c7
1 cmake_minimum_required(VERSION 2.8.12)
3 project(ODE)
5 include(CheckFunctionExists)
6 include(CheckIncludeFiles)
7 include(CMakeDependentOption)
8 include(GNUInstallDirs)
10 set(VERSION_MAJOR 0)
11 set(VERSION_MINOR 16)
12 set(VERSION_PATCH 0)
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)
39 else()
40         option(ODE_DOUBLE_PRECISION "Use double-precision math." ON)
41 endif()
43 find_package(OpenGL)
44 find_package(Threads)
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)
51 endif()
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)
68 if(APPLE)
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)
73         endif()
74         check_function_exists(OSAtomicAnd32OrigBarrier MAC_OS_X_VERSION_1050)
75         if(MAC_OS_X_VERSION_1050)
76                 set(MAC_OS_X_VERSION 1050)
77         endif()
78 endif()
79 if(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|x86.*|x86_64.*|amd64.*|AMD64.*")
80         set(PENTIUM ON)
81 endif()
82 if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64.*|amd64.*|AMD64.*")
83         set(X86_64_SYSTEM ON)
84 endif()
85 if(ODE_WITH_OU)
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)
89 else()
90         set(_OU_FEATURE_SET _OU_FEATURE_SET_BASICS)
91 endif()
92 set(_OU_NAMESPACE odeou)
93 if(WIN32 OR CYGWIN)
94         set(_OU_TARGET_OS _OU_TARGET_OS_WINDOWS)
95 elseif(APPLE)
96         set(_OU_TARGET_OS _OU_TARGET_OS_MAC)
97 elseif(QNXNTO)
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)
101 else()
102         set(_OU_TARGET_OS _OU_TARGET_OS_GENUNIX)
103 endif()
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)
110 else()
111         set(CCD_PRECISION CCD_SINGLE)
112         set(ODE_PRECISION dSINGLE)
113 endif()
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)
122 set(
123         HDRS
124         include/ode/collision.h
125         include/ode/collision_space.h
126         include/ode/collision_trimesh.h
127         include/ode/common.h
128         include/ode/compatibility.h
129         include/ode/contact.h
130         include/ode/cooperative.h
131         include/ode/error.h
132         include/ode/export-dif.h
133         include/ode/mass.h
134         include/ode/matrix.h
135         include/ode/matrix_coop.h
136         include/ode/memory.h
137         include/ode/misc.h
138         include/ode/objects.h
139         include/ode/ode.h
140         include/ode/odeconfig.h
141         include/ode/odecpp.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
149         include/ode/timer.h
150         ${CMAKE_CURRENT_BINARY_DIR}/include/ode/precision.h
151         ${CMAKE_CURRENT_BINARY_DIR}/include/ode/version.h
154 set(
155         SRCS
156         ode/src/array.cpp
157         ode/src/array.h
158         ode/src/box.cpp
159         ode/src/capsule.cpp
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
179         ode/src/common.h
180         ode/src/convex.cpp
181         ode/src/coop_matrix_types.h
182         ode/src/cylinder.cpp
183         ode/src/default_threading.cpp
184         ode/src/default_threading.h
185         ode/src/error.cpp
186         ode/src/error.h
187         ode/src/export-dif.cpp
188         ode/src/fastdot.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
202         ode/src/lcp.cpp
203         ode/src/lcp.h
204         ode/src/mass.cpp
205         ode/src/mat.cpp
206         ode/src/mat.h
207         ode/src/matrix.cpp
208         ode/src/matrix.h
209         ode/src/memory.cpp
210         ode/src/misc.cpp
211         ode/src/nextafterf.c
212         ode/src/objects.cpp
213         ode/src/objects.h
214         ode/src/obstack.cpp
215         ode/src/obstack.h
216         ode/src/ode.cpp
217         ode/src/odeinit.cpp
218         ode/src/odemath.cpp
219         ode/src/odemath.h
220         ode/src/odeou.h
221         ode/src/odetls.h
222         ode/src/plane.cpp
223         ode/src/quickstep.cpp
224         ode/src/quickstep.h
225         ode/src/ray.cpp
226         ode/src/resource_control.cpp
227         ode/src/resource_control.h
228         ode/src/rotation.cpp
229         ode/src/simple_cooperative.cpp
230         ode/src/simple_cooperative.h
231         ode/src/sphere.cpp
232         ode/src/step.cpp
233         ode/src/step.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
247         ode/src/timer.cpp
248         ode/src/typedefs.h
249         ode/src/util.cpp
250         ode/src/util.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
280         ode/src/joints/pr.h
281         ode/src/joints/pu.cpp
282         ode/src/joints/pu.h
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)
292         list(
293                 APPEND SRCS
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
321         )
322 endif()
324 if(ODE_WITH_LIBCCD)
325         if(NOT ODE_WITH_LIBCCD_SYSTEM)
326                 list(
327                         APPEND SRCS
328                         libccd/src/alloc.c
329                         libccd/src/ccd.c
330                         libccd/src/mpr.c
331                         libccd/src/polytope.c
332                         libccd/src/support.c
333                         libccd/src/vec3.c
334                         libccd/src/ccd/alloc.h
335                         libccd/src/ccd/ccd.h
336                         libccd/src/ccd/compiler.h
337                         libccd/src/ccd/dbg.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
346                 )
347         endif()
348         
349         list(
350                 APPEND SRCS
351                 ode/src/collision_libccd.cpp
352                 ode/src/collision_libccd.h
353         )
354 endif()
356 if(ODE_WITH_OPCODE AND NOT ODE_NO_TRIMESH)
357         list(
358                 APPEND SRCS
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
382                 OPCODE/OPC_Common.h
383                 OPCODE/OPC_HybridModel.cpp
384                 OPCODE/OPC_HybridModel.h
385                 OPCODE/OPC_IceHook.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
392                 OPCODE/OPC_Model.cpp
393                 OPCODE/OPC_Model.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
399                 OPCODE/OPC_Picking.h
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
421                 OPCODE/Opcode.cpp
422                 OPCODE/Opcode.h
423                 OPCODE/Stdafx.h
424                 OPCODE/Ice/IceAABB.cpp
425                 OPCODE/Ice/IceAABB.h
426                 OPCODE/Ice/IceAxes.h
427                 OPCODE/Ice/IceBoundingSphere.h
428                 OPCODE/Ice/IceContainer.cpp
429                 OPCODE/Ice/IceContainer.h
430                 OPCODE/Ice/IceFPU.h
431                 OPCODE/Ice/IceHPoint.cpp
432                 OPCODE/Ice/IceHPoint.h
433                 OPCODE/Ice/IceIndexedTriangle.cpp
434                 OPCODE/Ice/IceIndexedTriangle.h
435                 OPCODE/Ice/IceLSS.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
442                 OPCODE/Ice/IceOBB.h
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
452                 OPCODE/Ice/IceRay.h
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
463         )
464 endif()
466 list(
467         APPEND SRCS
468         ode/src/odeou.cpp
469         ode/src/odeou.h
470         ode/src/odetls.cpp
471         ode/src/odetls.h
472         ou/src/ou/atomic.cpp
473         ou/src/ou/customization.cpp
474         ou/src/ou/malloc.cpp
475         ou/src/ou/threadlocalstorage.cpp
478 add_library(ODE ${SRCS})
480 set_target_properties(
481         ODE
482         PROPERTIES
483         OUTPUT_NAME ode
484         POSITION_INDEPENDENT_CODE ON
485         VERSION ${VERSION}
488 if(WIN32)
489         if(BUILD_SHARED_LIBS)
490                 set_target_properties(ODE PROPERTIES DEBUG_POSTFIX d)
491         else()
492                 set_target_properties(
493                         ODE
494                         PROPERTIES
495                         DEBUG_POSTFIX sd
496                         MINSIZEREL_POSTFIX s
497                         RELEASE_POSTFIX s
498                         RELWITHDEBINFO_POSTFIX s
499                 )
500         endif()
501         
502         if(ODE_DOUBLE_PRECISION)
503                 set_target_properties(ODE PROPERTIES OUTPUT_NAME ode_double)
504         else()
505                 set_target_properties(ODE PROPERTIES OUTPUT_NAME ode_single)
506         endif()
507 endif()
509 target_compile_definitions(
510         ODE
511         PRIVATE
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>
516         -DdOU_ENABLED
519 if(APPLE)
520         target_compile_definitions(ODE PRIVATE -DMAC_OS_X_VERSION=${MAC_OS_X_VERSION})
521 endif()
523 if(WIN32)
524         target_compile_definitions(ODE PRIVATE -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES)
525 endif()
527 if(BUILD_SHARED_LIBS)
528         target_compile_definitions(ODE PRIVATE -DODE_DLL)
529 else()
530         target_compile_definitions(ODE PRIVATE -DODE_LIB)
531 endif()
533 if(ODE_DOUBLE_PRECISION)
534         target_compile_definitions(ODE PUBLIC -DdIDEDOUBLE PRIVATE -DCCD_IDEDOUBLE)
535 else()
536         target_compile_definitions(ODE PUBLIC -DdIDESINGLE PRIVATE -DCCD_IDESINGLE)
537 endif()
539 target_include_directories(
540         ODE
541         PUBLIC
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)
553 endif()
555 if(NOT ODE_NO_BUILTIN_THREADING_IMPL)
556         target_compile_definitions(ODE PRIVATE -DdBUILTIN_THREADING_IMPL_ENABLED)
557 endif()
559 if(ODE_NO_THREADING_INTF)
560         target_compile_definitions(ODE PRIVATE -DdTHREADING_INTF_DISABLED)
561 endif()
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>)
566 endif()
568 if(ODE_WITH_LIBCCD)
569         if(ODE_WITH_LIBCCD_SYSTEM)
570                 find_package(ccd)
571                 target_compile_definitions(ode PRIVATE -DdLIBCCD_ENABLED -DdLIBCCD_SYSTEM)
572                 target_link_libraries(ODE ccd::ccd)
573         else()
574                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_ENABLED -DdLIBCCD_INTERNAL)
575                 target_include_directories(
576                         ODE
577                         PRIVATE
578                         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libccd/src>
579                         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libccd/src/custom>
580                 )
581         endif()
582         
583         if(ODE_WITH_LIBCCD_BOX_CYL)
584                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_BOX_CYL)
585         endif()
586         
587         if(ODE_WITH_LIBCCD_CAP_CYL)
588                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CAP_CYL)
589         endif()
590         
591         if(ODE_WITH_LIBCCD_CYL_CYL)
592                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CYL_CYL)
593         endif()
594         
595         if(ODE_WITH_LIBCCD_CONVEX_BOX)
596                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_BOX)
597         endif()
598         
599         if(ODE_WITH_LIBCCD_CONVEX_CAP)
600                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_CAP)
601         endif()
602         
603         if(ODE_WITH_LIBCCD_CONVEX_CONVEX)
604                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_CONVEX)
605         endif()
606         
607         if(ODE_WITH_LIBCCD_CONVEX_CYL)
608                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_CYL)
609         endif()
610         
611         if(ODE_WITH_LIBCCD_CONVEX_SPHERE)
612                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_SPHERE)
613         endif()
614 endif()
616 if(ODE_WITH_OPCODE AND NOT ODE_NO_TRIMESH)
617         target_compile_definitions(ODE PRIVATE -DdTRIMESH_ENABLED -DdTRIMESH_OPCODE)
618         
619         if(ODE_OLD_TRIMESH)
620                 target_compile_definitions(ODE PRIVATE -DdTRIMESH_OPCODE_USE_OLD_TRIMESH_TRIMESH_COLLIDER)
621         endif()
622         
623         target_include_directories(
624                 ODE
625                 PRIVATE
626                 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/OPCODE>
627                 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/OPCODE/Ice>
628         )
629 endif()
631 if(ODE_WITH_OU)
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)
635 endif()
637 if(ODE_WITH_OU OR NOT ODE_NO_THREADING_INTF)
638         target_link_libraries(ODE ${CMAKE_THREAD_LIBS_INIT})
639 endif()
641 if(NOT CMAKE_VERSION VERSION_LESS 3.12)
642         install(
643                 TARGETS ODE
644                 EXPORT ODE
645                 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development
646                 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_COMPONENT development
647                 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
648         )
649 else()
650         install(
651                 TARGETS ODE
652                 EXPORT ODE
653                 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development
654                 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_SKIP
655                 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
656         )
657         if(BUILD_SHARED_LIBS)
658                 install(
659                         TARGETS ODE
660                         EXPORT ODE
661                         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development NAMELINK_ONLY
662                 )
663         endif()
664 endif()
666 if(MSVC AND BUILD_SHARED_LIBS AND NOT CMAKE_VERSION VERSION_LESS 3.1)
667         install(FILES $<TARGET_PDB_FILE:ODE> DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug)
668 endif()
670 install(FILES ${HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ode COMPONENT development)
672 file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}")
673 string(REGEX REPLACE "/$" "" PACKAGE_RELATIVE_PATH "${PACKAGE_RELATIVE_PATH}")
674 set(prefix "\${pcfiledir}/${PACKAGE_RELATIVE_PATH}")
675 set(exec_prefix "\${prefix}")
676 set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
677 set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
678 configure_file(ode.pc.in ode.pc @ONLY)
679 configure_file(ode-config.in ode-config @ONLY)
681 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ode.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT development)
682 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ode-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development)
684 unset(DRAWSTUFF_RSRC)
686 if(ODE_WITH_DEMOS)
687         set(
688                 DRAWSTUFF_SRCS
689                 include/drawstuff/drawstuff.h
690                 include/drawstuff/version.h
691                 drawstuff/src/drawstuff.cpp
692                 drawstuff/src/internal.h
693         )
694         
695         if(WIN32)
696                 set(DRAWSTUFF_RSRC drawstuff/src/resources.rc)
697                 list(
698                         APPEND DRAWSTUFF_SRCS
699                         drawstuff/src/resource.h
700                         drawstuff/src/windows.cpp
701                         ${DRAWSTUFF_RSRC}
702                 )
703         elseif(APPLE)
704                 list(APPEND DRAWSTUFF_SRCS drawstuff/src/osx.cpp)
705         else()
706                 list(APPEND DRAWSTUFF_SRCS drawstuff/src/x11.cpp)
707         endif()
708         
709         add_library(drawstuff ${DRAWSTUFF_SRCS})
710         target_compile_definitions(drawstuff PUBLIC -DDRAWSTUFF_TEXTURE_PATH="${CMAKE_CURRENT_SOURCE_DIR}/drawstuff/textures")
711         
712         if(BUILD_SHARED_LIBS)
713                 target_compile_definitions(drawstuff PRIVATE -DDS_DLL -DUSRDLL)
714         else()
715                 target_compile_definitions(drawstuff PRIVATE -DDS_LIB)
716         endif()
717         
718         target_include_directories(drawstuff PUBLIC ${OPENGL_INCLUDE_DIR})
719         target_link_libraries(drawstuff ODE ${OPENGL_LIBRARIES})
720         
721         if(WIN32)
722                 target_link_libraries(drawstuff winmm)
723         elseif(APPLE)
724                 find_package(GLUT)
725                 target_include_directories(drawstuff PUBLIC ${GLUT_INCLUDE_DIR})
726                 target_link_libraries(drawstuff ${GLUT_LIBRARIES})
727         else()
728                 find_package(X11)
729                 target_include_directories(drawstuff PUBLIC ${X11_INCLUDE_DIR})
730                 target_link_libraries(drawstuff ${X11_LIBRARIES})
731         endif()
732         
733         set(
734                 ALL_DEMO_SRCS
735                 ode/demo/demo_boxstack.cpp
736                 ode/demo/demo_buggy.cpp
737                 ode/demo/demo_cards.cpp
738                 ode/demo/demo_chain1.c
739                 ode/demo/demo_chain2.cpp
740                 ode/demo/demo_collision.cpp
741                 ode/demo/demo_convex.cpp
742                 ode/demo/demo_crash.cpp
743                 ode/demo/demo_cylvssphere.cpp
744                 ode/demo/demo_dball.cpp
745                 ode/demo/demo_dhinge.cpp
746                 ode/demo/demo_feedback.cpp
747                 ode/demo/demo_friction.cpp
748                 ode/demo/demo_gyro2.cpp
749                 ode/demo/demo_gyroscopic.cpp
750                 ode/demo/demo_heightfield.cpp
751                 ode/demo/demo_hinge.cpp
752                 ode/demo/demo_I.cpp
753                 ode/demo/demo_jointPR.cpp
754                 ode/demo/demo_jointPU.cpp
755                 ode/demo/demo_joints.cpp
756                 ode/demo/demo_kinematic.cpp
757                 ode/demo/demo_motion.cpp
758                 ode/demo/demo_motor.cpp
759                 ode/demo/demo_ode.cpp
760                 ode/demo/demo_piston.cpp
761                 ode/demo/demo_plane2d.cpp
762                 ode/demo/demo_rfriction.cpp
763                 ode/demo/demo_slider.cpp
764                 ode/demo/demo_space.cpp
765                 ode/demo/demo_space_stress.cpp
766                 ode/demo/demo_step.cpp
767                 ode/demo/demo_transmission.cpp
768         )
769         
770         if(NOT ODE_NO_TRIMESH)
771                 list(
772                         APPEND ALL_DEMO_SRCS
773                         ode/demo/demo_basket.cpp
774                         ode/demo/demo_cyl.cpp
775                         ode/demo/demo_moving_convex.cpp
776                         ode/demo/demo_moving_trimesh.cpp
777                         ode/demo/demo_tracks.cpp
778                         ode/demo/demo_trimesh.cpp
779                 )
780         endif()
781         
782         foreach(MAIN_DEMO_SRC ${ALL_DEMO_SRCS})
783                 get_filename_component(DEMO ${MAIN_DEMO_SRC} NAME_WE)
784                 set(
785                         DEMO_SRC
786                         ${MAIN_DEMO_SRC}
787                 )
789                 if(NOT WIN32 OR ${DEMO} STREQUAL "demo_ode")
790                         add_executable(${DEMO} ${DEMO_SRC})
791                 else()
792                         if(NOT BUILD_SHARED_LIBS)
793                                 list(
794                                         APPEND DEMO_SRC 
795                                         ${DRAWSTUFF_RSRC}
796                                 )
797                         endif()
799                         add_executable(${DEMO} WIN32 ${DEMO_SRC})
800                         if(WIN32 AND MSVC)
801                                 set_target_properties(${DEMO} PROPERTIES LINK_FLAGS /ENTRY:mainCRTStartup)
802                         endif()
803                 endif()
804                 target_link_libraries(${DEMO} drawstuff)
805                 
806                 if(NOT WIN32 AND ${DEMO} STREQUAL "demo_chain1")
807                         target_link_libraries(${DEMO} m)
808                 endif()
809         endforeach()
810 endif()
812 if(ODE_WITH_TESTS)
813         set(
814                 TEST_SRCS
815                 tests/collision.cpp
816                 tests/collision_point_depth.cpp
817                 tests/friction.cpp
818                 tests/joint.cpp
819                 tests/main.cpp
820                 tests/odemath.cpp
821                 tests/joints/amotor.cpp
822                 tests/joints/ball.cpp
823                 tests/joints/dball.cpp
824                 tests/joints/fixed.cpp
825                 tests/joints/hinge.cpp
826                 tests/joints/hinge2.cpp
827                 tests/joints/piston.cpp
828                 tests/joints/pr.cpp
829                 tests/joints/pu.cpp
830                 tests/joints/slider.cpp
831                 tests/joints/universal.cpp
832                 tests/UnitTest++/src/AssertException.cpp
833                 tests/UnitTest++/src/AssertException.h
834                 tests/UnitTest++/src/CheckMacros.h
835                 tests/UnitTest++/src/Checks.cpp
836                 tests/UnitTest++/src/Checks.h
837                 tests/UnitTest++/src/Config.h
838                 tests/UnitTest++/src/DeferredTestReporter.cpp
839                 tests/UnitTest++/src/DeferredTestReporter.h
840                 tests/UnitTest++/src/DeferredTestResult.cpp
841                 tests/UnitTest++/src/DeferredTestResult.h
842                 tests/UnitTest++/src/MemoryOutStream.cpp
843                 tests/UnitTest++/src/MemoryOutStream.h
844                 tests/UnitTest++/src/ReportAssert.cpp
845                 tests/UnitTest++/src/ReportAssert.h
846                 tests/UnitTest++/src/Test.cpp
847                 tests/UnitTest++/src/TestDetails.cpp
848                 tests/UnitTest++/src/TestDetails.h
849                 tests/UnitTest++/src/Test.h
850                 tests/UnitTest++/src/TestList.cpp
851                 tests/UnitTest++/src/TestList.h
852                 tests/UnitTest++/src/TestMacros.h
853                 tests/UnitTest++/src/TestReporter.cpp
854                 tests/UnitTest++/src/TestReporter.h
855                 tests/UnitTest++/src/TestReporterStdout.cpp
856                 tests/UnitTest++/src/TestReporterStdout.h
857                 tests/UnitTest++/src/TestResults.cpp
858                 tests/UnitTest++/src/TestResults.h
859                 tests/UnitTest++/src/TestRunner.cpp
860                 tests/UnitTest++/src/TestRunner.h
861                 tests/UnitTest++/src/TestSuite.h
862                 tests/UnitTest++/src/TimeConstraint.cpp
863                 tests/UnitTest++/src/TimeConstraint.h
864                 tests/UnitTest++/src/TimeHelpers.h
865                 tests/UnitTest++/src/UnitTest++.h
866                 tests/UnitTest++/src/XmlTestReporter.cpp
867                 tests/UnitTest++/src/XmlTestReporter.h
868         )
869         
870         if(WIN32)
871                 list(
872                         APPEND TEST_SRCS
873                         tests/UnitTest++/src/Win32/TimeHelpers.cpp
874                         tests/UnitTest++/src/Win32/TimeHelpers.h
875                 )
876         else()
877                 list(
878                         APPEND TEST_SRCS
879                         tests/UnitTest++/src/Posix/SignalTranslator.cpp
880                         tests/UnitTest++/src/Posix/SignalTranslator.h
881                         tests/UnitTest++/src/Posix/TimeHelpers.cpp
882                         tests/UnitTest++/src/Posix/TimeHelpers.h
883                 )
884         endif()
885         
886         add_executable(tests ${TEST_SRCS})
887         target_include_directories(tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tests/UnitTest++/src)
888         target_link_libraries(tests ODE)
889         
890         enable_testing()
891         add_test(tests ${CMAKE_CURRENT_BINARY_DIR}/tests)
892 endif()
894 include(CMakePackageConfigHelpers)
896 configure_package_config_file(
897   ${CMAKE_CURRENT_SOURCE_DIR}/ode-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/ode-config.cmake
898   INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ode
900 install(
901         FILES ${CMAKE_CURRENT_BINARY_DIR}/ode-config.cmake
902         DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ode-${VERSION}
903         COMPONENT development
905 write_basic_package_version_file(
906         ${CMAKE_CURRENT_BINARY_DIR}/ode-config-version.cmake
907         VERSION ${VERSION}
908         COMPATIBILITY ExactVersion
910 install(
911         FILES ${CMAKE_CURRENT_BINARY_DIR}/ode-config-version.cmake
912         DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ode-${VERSION}
913         COMPONENT development
915 install(
916         EXPORT ODE
917         DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ode-${VERSION}
918         NAMESPACE ODE::
919         FILE ode-export.cmake
920         COMPONENT development
923 configure_file(cmake/cmake_uninstall.cmake.in cmake_uninstall.cmake @ONLY)
924 add_custom_target(uninstall ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
926 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.")
928 set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime)
929 set(CPACK_COMPONENT_DEVELOPMENT_DESCRIPTION "Open Dynamics Engine - development files\n${CPACK_DEBIAN_PACKAGE_DESCRIPTION}")
930 set(CPACK_COMPONENT_RUNTIME_DESCRIPTION "Open Dynamics Engine - runtime library\n${CPACK_DEBIAN_PACKAGE_DESCRIPTION}")
931 set(CPACK_DEB_COMPONENT_INSTALL ON)
932 set(CPACK_DEBIAN_DEVELOPMENT_FILE_NAME "DEB-DEFAULT")
933 set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_SECTION "libdevel")
934 set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.ode.org/")
935 set(CPACK_DEBIAN_PACKAGE_NAME "libode")
936 set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
937 set(CPACK_DEBIAN_RUNTIME_FILE_NAME "DEB-DEFAULT")
938 set(CPACK_DEBIAN_RUNTIME_PACKAGE_SECTION "libs")
939 set(CPACK_DEBIAN_RUNTIME_PACKAGE_SHLIBDEPS ON)
940 set(CPACK_NSIS_PACKAGE_NAME "ODE ${VERSION}")
941 set(CPACK_NSIS_URL_INFO_ABOUT "http://www.ode.org/")
942 set(CPACK_PACKAGE_CONTACT "ode@ode.org")
943 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "High performance library for simulating rigid body dynamics")
944 set(CPACK_PACKAGE_DISPLAY_NAME "ODE ${VERSION}")
945 set(CPACK_PACKAGE_INSTALL_DIRECTORY "ode-${VERSION}")
946 set(CPACK_PACKAGE_NAME "ode")
947 set(CPACK_PACKAGE_VENDOR "")
948 set(CPACK_PACKAGE_VERSION ${VERSION})
949 set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
950 set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
951 set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
952 set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING)
953 set(CPACK_RPM_COMPONENT_INSTALL ON)
954 set(CPACK_RPM_DEVELOPMENT_FILE_NAME "RPM-DEFAULT")
955 set(CPACK_RPM_development_PACKAGE_DESCRIPTION "The ode-devel package contains libraries and header files for developing applications that use ode or ode-double.")
956 set(CPACK_RPM_development_PACKAGE_NAME "ode-devel")
957 set(CPACK_RPM_development_PACKAGE_SUMMARY "Development files for ODE")
958 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.")
959 set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
960 set(CPACK_RPM_PACKAGE_LICENSE "BSD or LGPLv2+")
961 set(CPACK_RPM_PACKAGE_NAME "ode")
962 set(CPACK_RPM_PACKAGE_SUMMARY "High performance library for simulating rigid body dynamics")
963 set(CPACK_RPM_PACKAGE_URL "http://www.ode.org/")
964 set(CPACK_RPM_RUNTIME_FILE_NAME "RPM-DEFAULT")
966 if(ODE_DOUBLE_PRECISION)
967         set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_CONFLICTS "libode-sp-dev")
968         set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libode6")
969         set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "libode-dev")
970         set(CPACK_DEBIAN_RUNTIME_PACKAGE_CONFLICTS "libode6sp")
971         set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "libode6")
972         set(CPACK_RPM_development_PACKAGE_REQUIRES "ode-double")
973         set(CPACK_RPM_runtime_PACKAGE_CONFLICTS "ode")
974         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.")
975         set(CPACK_RPM_runtime_PACKAGE_NAME "ode-double")
976         set(CPACK_RPM_runtime_PACKAGE_SUMMARY "ODE physics library compiled with double precision")
977 else()
978         set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_CONFLICTS "libode-dev")
979         set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libode6sp")
980         set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "libode-sp-dev")
981         set(CPACK_DEBIAN_RUNTIME_PACKAGE_CONFLICTS "libode6")
982         set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "libode6sp")
983         set(CPACK_RPM_development_PACKAGE_REQUIRES "ode")
984         set(CPACK_RPM_runtime_PACKAGE_CONFLICTS "ode-double")
985         set(CPACK_RPM_runtime_PACKAGE_NAME "ode")
986 endif()
988 include(CPack)