Merged in alexvaillancourt_cmakeInstallPdb (pull request #17)
[ode.git] / CMakeLists.txt
blob8a3bb8f7f7878dd3d1ebfeb9f8461c935e7618dc
1 cmake_minimum_required(VERSION 2.8.12)
3 if(POLICY CMP0042)
4         cmake_policy(SET CMP0042 NEW)
5 endif()
7 if(POLICY CMP0072)
8         cmake_policy(SET CMP0072 NEW)
9 endif()
11 if(POLICY CMP0075)
12         cmake_policy(SET CMP0075 NEW)
13 endif()
15 project(ODE)
17 include(CheckFunctionExists)
18 include(CheckIncludeFiles)
19 include(CMakeDependentOption)
20 include(CMakePushCheckState)
21 include(GNUInstallDirs)
23 set(SOVERSION_MAJOR 8)
24 set(SOVERSION_MINOR 0)
25 set(SOVERSION_PATCH 0)
26 set(SOVERSION ${SOVERSION_MAJOR}.${SOVERSION_MINOR}.${SOVERSION_PATCH})
28 set(VERSION_MAJOR 0)
29 set(VERSION_MINOR 16)
30 set(VERSION_PATCH 0)
31 set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
33 option(BUILD_SHARED_LIBS "Build shared libraries." ON)
34 option(ODE_16BIT_INDICES "Use 16-bit indices for trimeshes (default is 32-bit)." OFF)
35 option(ODE_NO_BUILTIN_THREADING_IMPL "Disable built-in multithreaded threading implementation." OFF)
36 option(ODE_NO_THREADING_INTF "Disable threading interface support (external implementations cannot be assigned." OFF)
37 option(ODE_OLD_TRIMESH "Use old OPCODE trimesh-trimesh collider." OFF)
38 option(ODE_WITH_DEMOS "Builds the demo applications and DrawStuff library." ON)
39 option(ODE_WITH_GIMPACT "Use GIMPACT for trimesh collisions (experimental)." OFF)
40 option(ODE_WITH_LIBCCD "Use libccd for handling some collision tests absent in ODE." OFF)
41 option(ODE_WITH_OPCODE "Use old OPCODE trimesh-trimesh collider." ON)
42 option(ODE_WITH_OU "Use TLS for global caches (allows threaded collision checks for separated spaces)." OFF)
43 option(ODE_WITH_TESTS "Builds the unit test application." ON)
44 option(ODE_WIN32_LIB_OUTPUT_NAME_BASED_ON_FLOAT_SIZE "The output name of the library will be based on the size of float, on Windows." ON)
45 option(ODE_WIN32_INSTALL_STATIC_LIBS_PDB "Install the PDB files for the static libraries (.lib) on Windows." OFF)
47 cmake_dependent_option(ODE_WITH_LIBCCD_BOX_CYL "Use libccd for box-cylinder." ON "ODE_WITH_LIBCCD" OFF)
48 cmake_dependent_option(ODE_WITH_LIBCCD_CAP_CYL "Use libccd for capsule-cylinder." ON "ODE_WITH_LIBCCD" OFF)
49 cmake_dependent_option(ODE_WITH_LIBCCD_CYL_CYL "Use libccd for cylinder-cylinder." ON "ODE_WITH_LIBCCD" OFF)
50 cmake_dependent_option(ODE_WITH_LIBCCD_CONVEX_BOX "Use libccd for convex-box." ON "ODE_WITH_LIBCCD" OFF)
51 cmake_dependent_option(ODE_WITH_LIBCCD_CONVEX_CAP "Use libccd for convex-capsule." ON "ODE_WITH_LIBCCD" OFF)
52 cmake_dependent_option(ODE_WITH_LIBCCD_CONVEX_CONVEX "Use libccd for convex-convex." ON "ODE_WITH_LIBCCD" OFF)
53 cmake_dependent_option(ODE_WITH_LIBCCD_CONVEX_CYL "Use libccd for convex-cylinder." ON "ODE_WITH_LIBCCD" OFF)
54 cmake_dependent_option(ODE_WITH_LIBCCD_CONVEX_SPHERE "Use libccd for convex-sphere." ON "ODE_WITH_LIBCCD" OFF)
55 cmake_dependent_option(ODE_WITH_LIBCCD_SYSTEM "Use system libccd." OFF "ODE_WITH_LIBCCD" OFF)
57 if(CMAKE_SIZEOF_VOID_P EQUAL 4)
58         option(ODE_DOUBLE_PRECISION "Use double-precision math." OFF)
59 else()
60         option(ODE_DOUBLE_PRECISION "Use double-precision math." ON)
61 endif()
63 set(ODE_WIN32_STATIC_LIB_POSTFIX_DEBUG "sd" CACHE STRING "The postfix to use when building the library as a static .lib on Windows in DEBUG.")
64 set(ODE_WIN32_STATIC_LIB_POSTFIX_MINSIZEREL "s" CACHE STRING "The postfix to use when building the library as a static .lib on Windows in MINSIZEREL.")
65 set(ODE_WIN32_STATIC_LIB_POSTFIX_RELEASE "s" CACHE STRING "The postfix to use when building the library as a static .lib on Windows in RELEASE.")
66 set(ODE_WIN32_STATIC_LIB_POSTFIX_RELWITHDEBINFO "s" CACHE STRING "The postfix to use when building the library as a static .lib on Windows in RELWITHDEBINFO.")
68 cmake_push_check_state(RESET)
70 if(ODE_WITH_DEMOS)
71         find_package(OpenGL REQUIRED)
72         list(APPEND CMAKE_REQUIRED_INCLUDES ${OPENGL_INCLUDE_DIR})
73         list(APPEND CMAKE_REQUIRED_LIBRARIES ${OPENGL_LIBRARIES})
74 endif()
76 if(ODE_WITH_OU OR NOT ODE_NO_THREADING_INTF)
77         find_package(Threads REQUIRED)
78         list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
79 endif()
81 if(APPLE)
82         check_include_files("OpenGL/gl.h;OpenGL/glu.h" HAVE_APPLE_OPENGL_FRAMEWORK)
83 endif()
84 check_include_files(alloca.h HAVE_ALLOCA_H)
85 check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
86 check_include_files(inttypes.h HAVE_INTTYPES_H)
87 check_function_exists(isnan HAVE_ISNAN)
88 check_function_exists(isnanf HAVE_ISNANF)
89 check_include_files(malloc.h HAVE_MALLOC_H)
90 check_function_exists(pthread_attr_setstacklazy HAVE_PTHREAD_ATTR_SETSTACKLAZY)
91 check_function_exists(pthread_condattr_setclock HAVE_PTHREAD_CONDATTR_SETCLOCK)
92 check_include_files(stdint.h HAVE_STDINT_H)
93 check_include_files(sys/time.h HAVE_SYS_TIME_H)
94 check_include_files(sys/types.h HAVE_SYS_TYPES_H)
95 check_include_files(unistd.h HAVE_UNISTD_H)
96 check_function_exists(_isnan HAVE__ISNAN)
97 check_function_exists(_isnanf HAVE__ISNANF)
98 check_function_exists(__isnan HAVE___ISNAN)
99 check_function_exists(__isnanf HAVE___ISNANF)
100 if(APPLE)
101         set(MAC_OS_X_VERSION 1000)
102         check_function_exists(OSAtomicAdd32Barrier MAC_OS_X_VERSION_1040)
103         if(MAC_OS_X_VERSION_1040)
104                 set(MAC_OS_X_VERSION 1040)
105         endif()
106         check_function_exists(OSAtomicAnd32OrigBarrier MAC_OS_X_VERSION_1050)
107         if(MAC_OS_X_VERSION_1050)
108                 set(MAC_OS_X_VERSION 1050)
109         endif()
110 endif()
111 if(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|x86.*|x86_64.*|amd64.*|AMD64.*")
112         set(PENTIUM ON)
113 endif()
114 if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64.*|amd64.*|AMD64.*")
115         set(X86_64_SYSTEM ON)
116 endif()
117 if(ODE_WITH_OU)
118         set(_OU_FEATURE_SET _OU_FEATURE_SET_TLS)
119 elseif(NOT ODE_NO_THREADING_INTF)
120         set(_OU_FEATURE_SET _OU_FEATURE_SET_ATOMICS)
121 else()
122         set(_OU_FEATURE_SET _OU_FEATURE_SET_BASICS)
123 endif()
124 set(_OU_NAMESPACE odeou)
125 if(WIN32 OR CYGWIN)
126         set(_OU_TARGET_OS _OU_TARGET_OS_WINDOWS)
127 elseif(APPLE)
128         set(_OU_TARGET_OS _OU_TARGET_OS_MAC)
129 elseif(QNXNTO)
130         set(_OU_TARGET_OS _OU_TARGET_OS_QNX)
131 elseif(CMAKE_SYSTEM MATCHES "SunOS-4")
132         set(_OU_TARGET_OS _OU_TARGET_OS_SUNOS)
133 else()
134         set(_OU_TARGET_OS _OU_TARGET_OS_GENUNIX)
135 endif()
137 cmake_pop_check_state()
139 configure_file(config.h.cmake.in ode/src/config.h)
141 if(ODE_DOUBLE_PRECISION)
142         set(CCD_PRECISION CCD_DOUBLE)
143         set(ODE_PRECISION dDOUBLE)
144 else()
145         set(CCD_PRECISION CCD_SINGLE)
146         set(ODE_PRECISION dSINGLE)
147 endif()
149 configure_file(libccd/src/ccd/precision.h.in include/ccd/precision.h)
150 configure_file(include/ode/precision.h.in include/ode/precision.h)
152 set(ODE_VERSION ${VERSION})
154 configure_file(include/ode/version.h.in include/ode/version.h)
156 set(
157         HDRS
158         include/ode/collision.h
159         include/ode/collision_space.h
160         include/ode/collision_trimesh.h
161         include/ode/common.h
162         include/ode/compatibility.h
163         include/ode/contact.h
164         include/ode/cooperative.h
165         include/ode/error.h
166         include/ode/export-dif.h
167         include/ode/mass.h
168         include/ode/matrix.h
169         include/ode/matrix_coop.h
170         include/ode/memory.h
171         include/ode/misc.h
172         include/ode/objects.h
173         include/ode/ode.h
174         include/ode/odeconfig.h
175         include/ode/odecpp.h
176         include/ode/odecpp_collision.h
177         include/ode/odeinit.h
178         include/ode/odemath.h
179         include/ode/odemath_legacy.h
180         include/ode/rotation.h
181         include/ode/threading.h
182         include/ode/threading_impl.h
183         include/ode/timer.h
184         ${CMAKE_CURRENT_BINARY_DIR}/include/ode/precision.h
185         ${CMAKE_CURRENT_BINARY_DIR}/include/ode/version.h
188 set(
189         SRCS
190         ode/src/array.cpp
191         ode/src/array.h
192         ode/src/box.cpp
193         ode/src/capsule.cpp
194         ode/src/collision_cylinder_box.cpp
195         ode/src/collision_cylinder_plane.cpp
196         ode/src/collision_cylinder_sphere.cpp
197         ode/src/collision_kernel.cpp
198         ode/src/collision_kernel.h
199         ode/src/collision_quadtreespace.cpp
200         ode/src/collision_sapspace.cpp
201         ode/src/collision_space.cpp
202         ode/src/collision_space_internal.h
203         ode/src/collision_std.h
204         ode/src/collision_transform.cpp
205         ode/src/collision_transform.h
206         ode/src/collision_trimesh_colliders.h
207         ode/src/collision_trimesh_disabled.cpp
208         ode/src/collision_trimesh_gimpact.h
209         ode/src/collision_trimesh_internal.h
210         ode/src/collision_trimesh_opcode.h
211         ode/src/collision_util.cpp
212         ode/src/collision_util.h
213         ode/src/common.h
214         ode/src/convex.cpp
215         ode/src/coop_matrix_types.h
216         ode/src/cylinder.cpp
217         ode/src/default_threading.cpp
218         ode/src/default_threading.h
219         ode/src/error.cpp
220         ode/src/error.h
221         ode/src/export-dif.cpp
222         ode/src/fastdot.cpp
223         ode/src/fastdot_impl.h
224         ode/src/fastldltfactor.cpp
225         ode/src/fastldltfactor_impl.h
226         ode/src/fastldltsolve.cpp
227         ode/src/fastldltsolve_impl.h
228         ode/src/fastlsolve.cpp
229         ode/src/fastlsolve_impl.h
230         ode/src/fastltsolve.cpp
231         ode/src/fastltsolve_impl.h
232         ode/src/fastvecscale.cpp
233         ode/src/fastvecscale_impl.h
234         ode/src/heightfield.cpp
235         ode/src/heightfield.h
236         ode/src/lcp.cpp
237         ode/src/lcp.h
238         ode/src/mass.cpp
239         ode/src/mat.cpp
240         ode/src/mat.h
241         ode/src/matrix.cpp
242         ode/src/matrix.h
243         ode/src/memory.cpp
244         ode/src/misc.cpp
245         ode/src/nextafterf.c
246         ode/src/objects.cpp
247         ode/src/objects.h
248         ode/src/obstack.cpp
249         ode/src/obstack.h
250         ode/src/ode.cpp
251         ode/src/odeinit.cpp
252         ode/src/odemath.cpp
253         ode/src/odemath.h
254         ode/src/odeou.h
255         ode/src/odetls.h
256         ode/src/plane.cpp
257         ode/src/quickstep.cpp
258         ode/src/quickstep.h
259         ode/src/ray.cpp
260         ode/src/resource_control.cpp
261         ode/src/resource_control.h
262         ode/src/rotation.cpp
263         ode/src/simple_cooperative.cpp
264         ode/src/simple_cooperative.h
265         ode/src/sphere.cpp
266         ode/src/step.cpp
267         ode/src/step.h
268         ode/src/threaded_solver_ldlt.h
269         ode/src/threading_atomics_provs.h
270         ode/src/threading_base.cpp
271         ode/src/threading_base.h
272         ode/src/threading_fake_sync.h
273         ode/src/threading_impl.cpp
274         ode/src/threading_impl.h
275         ode/src/threading_impl_posix.h
276         ode/src/threading_impl_templates.h
277         ode/src/threading_impl_win.h
278         ode/src/threading_pool_posix.cpp
279         ode/src/threading_pool_win.cpp
280         ode/src/threadingutils.h
281         ode/src/timer.cpp
282         ode/src/typedefs.h
283         ode/src/util.cpp
284         ode/src/util.h
285         ode/src/joints/amotor.cpp
286         ode/src/joints/amotor.h
287         ode/src/joints/ball.cpp
288         ode/src/joints/ball.h
289         ode/src/joints/contact.cpp
290         ode/src/joints/contact.h
291         ode/src/joints/dball.cpp
292         ode/src/joints/dball.h
293         ode/src/joints/dhinge.cpp
294         ode/src/joints/dhinge.h
295         ode/src/joints/fixed.cpp
296         ode/src/joints/fixed.h
297         ode/src/joints/hinge.cpp
298         ode/src/joints/hinge.h
299         ode/src/joints/hinge2.cpp
300         ode/src/joints/hinge2.h
301         ode/src/joints/joint.cpp
302         ode/src/joints/joint.h
303         ode/src/joints/joint_internal.h
304         ode/src/joints/joints.h
305         ode/src/joints/lmotor.cpp
306         ode/src/joints/lmotor.h
307         ode/src/joints/null.cpp
308         ode/src/joints/null.h
309         ode/src/joints/piston.cpp
310         ode/src/joints/piston.h
311         ode/src/joints/plane2d.cpp
312         ode/src/joints/plane2d.h
313         ode/src/joints/pr.cpp
314         ode/src/joints/pr.h
315         ode/src/joints/pu.cpp
316         ode/src/joints/pu.h
317         ode/src/joints/slider.cpp
318         ode/src/joints/slider.h
319         ode/src/joints/transmission.cpp
320         ode/src/joints/transmission.h
321         ode/src/joints/universal.cpp
322         ode/src/joints/universal.h
325 if(ODE_WITH_GIMPACT AND NOT ODE_NO_TRIMESH)
326         list(
327                 APPEND SRCS
328                 GIMPACT/src/gim_boxpruning.cpp
329                 GIMPACT/src/gim_contact.cpp
330                 GIMPACT/src/gim_math.cpp
331                 GIMPACT/src/gim_memory.cpp
332                 GIMPACT/src/gim_tri_tri_overlap.cpp
333                 GIMPACT/src/gim_trimesh.cpp
334                 GIMPACT/src/gim_trimesh_capsule_collision.cpp
335                 GIMPACT/src/gim_trimesh_ray_collision.cpp
336                 GIMPACT/src/gim_trimesh_sphere_collision.cpp
337                 GIMPACT/src/gim_trimesh_trimesh_collision.cpp
338                 GIMPACT/src/gimpact.cpp
339                 ode/src/collision_convex_trimesh.cpp
340                 ode/src/collision_cylinder_trimesh.cpp
341                 ode/src/collision_trimesh_box.cpp
342                 ode/src/collision_trimesh_ccylinder.cpp
343                 ode/src/collision_trimesh_gimpact.cpp
344                 ode/src/collision_trimesh_internal.cpp
345                 ode/src/collision_trimesh_internal_impl.h
346                 ode/src/collision_trimesh_internal.h
347                 ode/src/collision_trimesh_plane.cpp
348                 ode/src/collision_trimesh_ray.cpp
349                 ode/src/collision_trimesh_sphere.cpp
350                 ode/src/collision_trimesh_trimesh.cpp
351                 ode/src/gimpact_contact_export_helper.cpp
352                 ode/src/gimpact_contact_export_helper.h
353                 ode/src/gimpact_gim_contact_accessor.h
354                 ode/src/gimpact_plane_contact_accessor.h
355         )
356 endif()
358 if(ODE_WITH_LIBCCD)
359         if(NOT ODE_WITH_LIBCCD_SYSTEM)
360                 list(
361                         APPEND SRCS
362                         libccd/src/alloc.c
363                         libccd/src/ccd.c
364                         libccd/src/mpr.c
365                         libccd/src/polytope.c
366                         libccd/src/support.c
367                         libccd/src/vec3.c
368                         libccd/src/ccd/alloc.h
369                         libccd/src/ccd/ccd.h
370                         libccd/src/ccd/compiler.h
371                         libccd/src/ccd/dbg.h
372                         libccd/src/ccd/list.h
373                         libccd/src/ccd/quat.h
374                         libccd/src/ccd/polytope.h
375                         libccd/src/ccd/simplex.h
376                         libccd/src/ccd/support.h
377                         libccd/src/ccd/vec3.h
378                         libccd/src/custom/ccdcustom/quat.h
379                         libccd/src/custom/ccdcustom/vec3.h
380                 )
381         endif()
382         
383         list(
384                 APPEND SRCS
385                 ode/src/collision_libccd.cpp
386                 ode/src/collision_libccd.h
387         )
388 endif()
390 if(ODE_WITH_OPCODE AND NOT ODE_NO_TRIMESH)
391         list(
392                 APPEND SRCS
393                 ode/src/collision_convex_trimesh.cpp
394                 ode/src/collision_cylinder_trimesh.cpp
395                 ode/src/collision_trimesh_box.cpp
396                 ode/src/collision_trimesh_ccylinder.cpp
397                 ode/src/collision_trimesh_internal.cpp
398                 ode/src/collision_trimesh_internal_impl.h
399                 ode/src/collision_trimesh_internal.h
400                 ode/src/collision_trimesh_opcode.cpp
401                 ode/src/collision_trimesh_plane.cpp
402                 ode/src/collision_trimesh_ray.cpp
403                 ode/src/collision_trimesh_sphere.cpp
404                 ode/src/collision_trimesh_trimesh.cpp
405                 ode/src/collision_trimesh_trimesh_old.cpp
406                 OPCODE/OPC_AABBCollider.cpp
407                 OPCODE/OPC_AABBCollider.h
408                 OPCODE/OPC_AABBTree.cpp
409                 OPCODE/OPC_AABBTree.h
410                 OPCODE/OPC_BaseModel.cpp
411                 OPCODE/OPC_BaseModel.h
412                 OPCODE/OPC_BoxBoxOverlap.h
413                 OPCODE/OPC_Collider.cpp
414                 OPCODE/OPC_Collider.h
415                 OPCODE/OPC_Common.cpp
416                 OPCODE/OPC_Common.h
417                 OPCODE/OPC_HybridModel.cpp
418                 OPCODE/OPC_HybridModel.h
419                 OPCODE/OPC_IceHook.h
420                 OPCODE/OPC_LSSAABBOverlap.h
421                 OPCODE/OPC_LSSCollider.cpp
422                 OPCODE/OPC_LSSCollider.h
423                 OPCODE/OPC_LSSTriOverlap.h
424                 OPCODE/OPC_MeshInterface.cpp
425                 OPCODE/OPC_MeshInterface.h
426                 OPCODE/OPC_Model.cpp
427                 OPCODE/OPC_Model.h
428                 OPCODE/OPC_OBBCollider.cpp
429                 OPCODE/OPC_OBBCollider.h
430                 OPCODE/OPC_OptimizedTree.cpp
431                 OPCODE/OPC_OptimizedTree.h
432                 OPCODE/OPC_Picking.cpp
433                 OPCODE/OPC_Picking.h
434                 OPCODE/OPC_PlanesAABBOverlap.h
435                 OPCODE/OPC_PlanesCollider.cpp
436                 OPCODE/OPC_PlanesCollider.h
437                 OPCODE/OPC_PlanesTriOverlap.h
438                 OPCODE/OPC_RayAABBOverlap.h
439                 OPCODE/OPC_RayCollider.cpp
440                 OPCODE/OPC_RayCollider.h
441                 OPCODE/OPC_RayTriOverlap.h
442                 OPCODE/OPC_Settings.h
443                 OPCODE/OPC_SphereAABBOverlap.h
444                 OPCODE/OPC_SphereCollider.cpp
445                 OPCODE/OPC_SphereCollider.h
446                 OPCODE/OPC_SphereTriOverlap.h
447                 OPCODE/OPC_TreeBuilders.cpp
448                 OPCODE/OPC_TreeBuilders.h
449                 OPCODE/OPC_TreeCollider.cpp
450                 OPCODE/OPC_TreeCollider.h
451                 OPCODE/OPC_TriBoxOverlap.h
452                 OPCODE/OPC_TriTriOverlap.h
453                 OPCODE/OPC_VolumeCollider.cpp
454                 OPCODE/OPC_VolumeCollider.h
455                 OPCODE/Opcode.cpp
456                 OPCODE/Opcode.h
457                 OPCODE/Stdafx.h
458                 OPCODE/Ice/IceAABB.cpp
459                 OPCODE/Ice/IceAABB.h
460                 OPCODE/Ice/IceAxes.h
461                 OPCODE/Ice/IceBoundingSphere.h
462                 OPCODE/Ice/IceContainer.cpp
463                 OPCODE/Ice/IceContainer.h
464                 OPCODE/Ice/IceFPU.h
465                 OPCODE/Ice/IceHPoint.cpp
466                 OPCODE/Ice/IceHPoint.h
467                 OPCODE/Ice/IceIndexedTriangle.cpp
468                 OPCODE/Ice/IceIndexedTriangle.h
469                 OPCODE/Ice/IceLSS.h
470                 OPCODE/Ice/IceMatrix3x3.cpp
471                 OPCODE/Ice/IceMatrix3x3.h
472                 OPCODE/Ice/IceMatrix4x4.cpp
473                 OPCODE/Ice/IceMatrix4x4.h
474                 OPCODE/Ice/IceMemoryMacros.h
475                 OPCODE/Ice/IceOBB.cpp
476                 OPCODE/Ice/IceOBB.h
477                 OPCODE/Ice/IcePairs.h
478                 OPCODE/Ice/IcePlane.cpp
479                 OPCODE/Ice/IcePlane.h
480                 OPCODE/Ice/IcePoint.cpp
481                 OPCODE/Ice/IcePoint.h
482                 OPCODE/Ice/IcePreprocessor.h
483                 OPCODE/Ice/IceRandom.cpp
484                 OPCODE/Ice/IceRandom.h
485                 OPCODE/Ice/IceRay.cpp
486                 OPCODE/Ice/IceRay.h
487                 OPCODE/Ice/IceRevisitedRadix.cpp
488                 OPCODE/Ice/IceRevisitedRadix.h
489                 OPCODE/Ice/IceSegment.cpp
490                 OPCODE/Ice/IceSegment.h
491                 OPCODE/Ice/IceTriangle.cpp
492                 OPCODE/Ice/IceTriangle.h
493                 OPCODE/Ice/IceTriList.h
494                 OPCODE/Ice/IceTypes.h
495                 OPCODE/Ice/IceUtils.cpp
496                 OPCODE/Ice/IceUtils.h
497         )
498 endif()
500 list(
501         APPEND SRCS
502         ode/src/odeou.cpp
503         ode/src/odeou.h
504         ode/src/odetls.cpp
505         ode/src/odetls.h
506         ou/src/ou/atomic.cpp
507         ou/src/ou/customization.cpp
508         ou/src/ou/malloc.cpp
509         ou/src/ou/threadlocalstorage.cpp
512 # Makes life with Visual Studio easier (includes also the headers in the project):
513 source_group( "SRCS" FILES ${SRCS} )
514 source_group( "HDRS" FILES ${HDRS} )
515 add_library(ODE ${SRCS} ${HDRS})
517 set_target_properties(
518         ODE
519         PROPERTIES
520         OUTPUT_NAME ode
521         POSITION_INDEPENDENT_CODE ON
522         SOVERSION ${SOVERSION_MAJOR}
523         VERSION ${SOVERSION}
526 if(WIN32)
527         if(BUILD_SHARED_LIBS)
528                 set_target_properties(ODE PROPERTIES DEBUG_POSTFIX d)
529         else()
530                 if(ODE_WIN32_STATIC_LIB_POSTFIX_DEBUG)
531                         set_target_properties(ODE PROPERTIES DEBUG_POSTFIX ${ODE_WIN32_STATIC_LIB_POSTFIX_DEBUG})
532                         if(ODE_WIN32_INSTALL_STATIC_LIBS_PDB)
533                                 get_target_property(output_name_ ODE OUTPUT_NAME)
534                                 set_target_properties(ODE PROPERTIES COMPILE_PDB_NAME_DEBUG ${output_name_}${ODE_WIN32_STATIC_LIB_POSTFIX_DEBUG})
535                         endif()
536                 endif()
537                 if(ODE_WIN32_STATIC_LIB_POSTFIX_MINSIZEREL)
538                         set_target_properties(ODE PROPERTIES MINSIZEREL_POSTFIX ${ODE_WIN32_STATIC_LIB_POSTFIX_MINSIZEREL} )
539                 endif()
540                 if(ODE_WIN32_STATIC_LIB_POSTFIX_RELEASE)
541                         set_target_properties(ODE PROPERTIES RELEASE_POSTFIX ${ODE_WIN32_STATIC_LIB_POSTFIX_RELEASE})
542                 endif()
543                 if(ODE_WIN32_STATIC_LIB_POSTFIX_RELWITHDEBINFO)
544                         set_target_properties(ODE PROPERTIES RELWITHDEBINFO_POSTFIX ${ODE_WIN32_STATIC_LIB_POSTFIX_RELWITHDEBINFO})
545                         if(ODE_WIN32_INSTALL_STATIC_LIBS_PDB)
546                                 get_target_property(output_name_ ODE OUTPUT_NAME)
547                                 set_target_properties(ODE PROPERTIES COMPILE_PDB_NAME_RELWITHDEBINFO ${output_name_}${ODE_WIN32_STATIC_LIB_POSTFIX_RELWITHDEBINFO})
548                         endif()
549                 endif()
550         endif()
551         
552         if(ODE_WIN32_LIB_OUTPUT_NAME_BASED_ON_FLOAT_SIZE)
553                 if(ODE_DOUBLE_PRECISION)
554                         set_target_properties(ODE PROPERTIES OUTPUT_NAME ode_double)
555                 else()
556                         set_target_properties(ODE PROPERTIES OUTPUT_NAME ode_single)
557                 endif()
558         endif()
559 endif()
561 target_compile_definitions(
562         ODE
563         PRIVATE
564         -D_OU_NAMESPACE=${_OU_NAMESPACE}
565         -D_OU_FEATURE_SET=${_OU_FEATURE_SET}
566         -D_OU_TARGET_OS=${_OU_TARGET_OS}
567         $<$<NOT:$<CONFIG:Debug>>:dNODEBUG>
568         -DdOU_ENABLED
571 if(APPLE)
572         target_compile_definitions(ODE PRIVATE -DMAC_OS_X_VERSION=${MAC_OS_X_VERSION})
573         if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
574                 find_library(CORESERVICES_FW NAMES CoreServices)
575                 if (CORESERVICES_FW)
576                         target_link_libraries(ODE PRIVATE ${CORESERVICES_FW})
577                 endif()
578         endif()
579 endif()
581 if(WIN32)
582         target_compile_definitions(ODE PRIVATE -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES)
583 endif()
585 if(BUILD_SHARED_LIBS)
586         target_compile_definitions(ODE PRIVATE -DODE_DLL)
587 else()
588         target_compile_definitions(ODE PRIVATE -DODE_LIB)
589 endif()
591 if(ODE_DOUBLE_PRECISION)
592         target_compile_definitions(ODE PUBLIC -DdIDEDOUBLE PRIVATE -DCCD_IDEDOUBLE)
593 else()
594         target_compile_definitions(ODE PUBLIC -DdIDESINGLE PRIVATE -DCCD_IDESINGLE)
595 endif()
597 target_include_directories(
598         ODE
599         PUBLIC
600         $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
601         $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/ode/src>
602         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
603         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/ode/src>
604         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/ode/src/joints>
605         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/ou/include>
606         $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>
609 if(ODE_16BIT_INDICES)
610         target_compile_definitions(ODE PRIVATE -DdTRIMESH_16BIT_INDICES)
611 endif()
613 if(NOT ODE_NO_BUILTIN_THREADING_IMPL)
614         target_compile_definitions(ODE PRIVATE -DdBUILTIN_THREADING_IMPL_ENABLED)
615 endif()
617 if(ODE_NO_THREADING_INTF)
618         target_compile_definitions(ODE PRIVATE -DdTHREADING_INTF_DISABLED)
619 endif()
621 if(ODE_WITH_GIMPACT AND NOT ODE_NO_TRIMESH)
622         target_compile_definitions(ODE PRIVATE -DdTRIMESH_ENABLED -DdTRIMESH_GIMPACT)
623         target_include_directories(ODE PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/GIMPACT/include>)
624 endif()
626 if(ODE_WITH_LIBCCD)
627         if(ODE_WITH_LIBCCD_SYSTEM)
628                 find_package(ccd REQUIRED)
629                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_ENABLED -DdLIBCCD_SYSTEM)
630                 target_include_directories(
631                         ODE
632                         PRIVATE
633                         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libccd/src/custom>
634                 )
635                 if(TARGET ccd::ccd)
636                         target_link_libraries(ODE PRIVATE ccd::ccd)
637                 else()
638                         target_link_libraries(ODE PRIVATE ccd)
639                 endif()
640         else()
641                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_ENABLED -DdLIBCCD_INTERNAL)
642                 target_include_directories(
643                         ODE
644                         PRIVATE
645                         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libccd/src>
646                         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libccd/src/custom>
647                 )
648         endif()
649         
650         if(ODE_WITH_LIBCCD_BOX_CYL)
651                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_BOX_CYL)
652         endif()
653         
654         if(ODE_WITH_LIBCCD_CAP_CYL)
655                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CAP_CYL)
656         endif()
657         
658         if(ODE_WITH_LIBCCD_CYL_CYL)
659                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CYL_CYL)
660         endif()
661         
662         if(ODE_WITH_LIBCCD_CONVEX_BOX)
663                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_BOX)
664         endif()
665         
666         if(ODE_WITH_LIBCCD_CONVEX_CAP)
667                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_CAP)
668         endif()
669         
670         if(ODE_WITH_LIBCCD_CONVEX_CONVEX)
671                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_CONVEX)
672         endif()
673         
674         if(ODE_WITH_LIBCCD_CONVEX_CYL)
675                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_CYL)
676         endif()
677         
678         if(ODE_WITH_LIBCCD_CONVEX_SPHERE)
679                 target_compile_definitions(ODE PRIVATE -DdLIBCCD_CONVEX_SPHERE)
680         endif()
681 endif()
683 if(ODE_WITH_OPCODE AND NOT ODE_NO_TRIMESH)
684         target_compile_definitions(ODE PRIVATE -DdTRIMESH_ENABLED -DdTRIMESH_OPCODE)
685         
686         if(ODE_OLD_TRIMESH)
687                 target_compile_definitions(ODE PRIVATE -DdTRIMESH_OPCODE_USE_OLD_TRIMESH_TRIMESH_COLLIDER)
688         endif()
689         
690         target_include_directories(
691                 ODE
692                 PRIVATE
693                 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/OPCODE>
694                 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/OPCODE/Ice>
695         )
696 endif()
698 if(ODE_WITH_OU)
699         target_compile_definitions(ODE PRIVATE -DdATOMICS_ENABLED -DdTLS_ENABLED)
700 elseif(NOT ODE_NO_THREADING_INTF)
701         target_compile_definitions(ODE PRIVATE -DdATOMICS_ENABLED)
702 endif()
704 if(ODE_WITH_OU OR NOT ODE_NO_THREADING_INTF)
705         target_link_libraries(ODE PRIVATE ${CMAKE_THREAD_LIBS_INIT})
706 endif()
708 if(NOT CMAKE_VERSION VERSION_LESS 3.12)
709         install(
710                 TARGETS ODE
711                 EXPORT ODE
712                 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development
713                 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_COMPONENT development
714                 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
715         )
716 else()
717         install(
718                 TARGETS ODE
719                 EXPORT ODE
720                 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development
721                 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_SKIP
722                 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
723         )
724         if(BUILD_SHARED_LIBS)
725                 install(
726                         TARGETS ODE
727                         EXPORT ODE
728                         LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development NAMELINK_ONLY
729                 )
730         endif()
731 endif()
733 if(MSVC AND BUILD_SHARED_LIBS AND NOT CMAKE_VERSION VERSION_LESS 3.1)
734         install(FILES $<TARGET_PDB_FILE:ODE> DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug)
735 endif()
737 if(MSVC
738         AND NOT BUILD_SHARED_LIBS
739         AND NOT CMAKE_VERSION VERSION_LESS 3.1
740         AND ODE_WIN32_INSTALL_STATIC_LIBS_PDB)
742         get_target_property(compile_pdb_name_ ODE COMPILE_PDB_NAME_DEBUG)
743         install(
744                 FILES $<TARGET_FILE_DIR:ODE>/${compile_pdb_name_}.pdb
745                 DESTINATION ${CMAKE_INSTALL_LIBDIR}
746                 CONFIGURATIONS Debug
747                 COMPONENT debug)
748         get_target_property(compile_pdb_name_ ODE COMPILE_PDB_NAME_RELWITHDEBINFO)
749         install(
750                 FILES $<TARGET_FILE_DIR:ODE>/${compile_pdb_name_}.pdb
751                 DESTINATION ${CMAKE_INSTALL_LIBDIR}
752                 CONFIGURATIONS RelWithDebInfo
753                 COMPONENT debug)
754 endif()
756 install(FILES ${HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ode COMPONENT development)
758 file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}")
759 string(REGEX REPLACE "/$" "" PACKAGE_RELATIVE_PATH "${PACKAGE_RELATIVE_PATH}")
760 set(prefix "\${pcfiledir}/${PACKAGE_RELATIVE_PATH}")
761 set(exec_prefix "\${prefix}")
762 set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
763 set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
764 configure_file(ode.pc.in ode.pc @ONLY)
765 set(prefix "\$(cd \"\$(dirname \"\$0\")\"; pwd -P)/..")
766 configure_file(ode-config.in ode-config @ONLY)
768 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ode.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT development)
769 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/ode-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development)
771 unset(DRAWSTUFF_RSRC)
773 if(ODE_WITH_DEMOS)
774         set(
775                 DRAWSTUFF_SRCS
776                 include/drawstuff/drawstuff.h
777                 include/drawstuff/version.h
778                 drawstuff/src/drawstuff.cpp
779                 drawstuff/src/internal.h
780         )
781         
782         if(WIN32)
783                 set(DRAWSTUFF_RSRC drawstuff/src/resources.rc)
784                 list(
785                         APPEND DRAWSTUFF_SRCS
786                         drawstuff/src/resource.h
787                         drawstuff/src/windows.cpp
788                         ${DRAWSTUFF_RSRC}
789                 )
790         elseif(APPLE)
791                 list(APPEND DRAWSTUFF_SRCS drawstuff/src/osx.cpp)
792         else()
793                 list(APPEND DRAWSTUFF_SRCS drawstuff/src/x11.cpp)
794         endif()
795         
796         add_library(drawstuff ${DRAWSTUFF_SRCS})
797         target_compile_definitions(drawstuff PUBLIC -DDRAWSTUFF_TEXTURE_PATH="${CMAKE_CURRENT_SOURCE_DIR}/drawstuff/textures")
798         
799         if(BUILD_SHARED_LIBS)
800                 target_compile_definitions(drawstuff PRIVATE -DDS_DLL -DUSRDLL)
801         else()
802                 target_compile_definitions(drawstuff PRIVATE -DDS_LIB)
803         endif()
804         
805         target_link_libraries(drawstuff PUBLIC ODE)
806         
807         target_include_directories(drawstuff PRIVATE ${OPENGL_INCLUDE_DIRS})
808         target_link_libraries(drawstuff PRIVATE ${OPENGL_LIBRARIES})
809         
810         if(WIN32)
811                 target_link_libraries(drawstuff PRIVATE winmm)
812         elseif(APPLE)
813                 find_package(GLUT REQUIRED)
814                 target_include_directories(drawstuff PRIVATE ${GLUT_INCLUDE_DIR})
815                 target_link_libraries(drawstuff PRIVATE ${GLUT_LIBRARIES})
816         else()
817                 find_package(X11 REQUIRED)
818                 target_include_directories(drawstuff PRIVATE ${X11_INCLUDE_DIR})
819                 target_link_libraries(drawstuff PRIVATE ${X11_LIBRARIES})
820         endif()
821         
822         set(
823                 ALL_DEMO_SRCS
824                 ode/demo/demo_boxstack.cpp
825                 ode/demo/demo_buggy.cpp
826                 ode/demo/demo_cards.cpp
827                 ode/demo/demo_chain1.c
828                 ode/demo/demo_chain2.cpp
829                 ode/demo/demo_collision.cpp
830                 ode/demo/demo_convex.cpp
831                 ode/demo/demo_crash.cpp
832                 ode/demo/demo_cylvssphere.cpp
833                 ode/demo/demo_dball.cpp
834                 ode/demo/demo_dhinge.cpp
835                 ode/demo/demo_feedback.cpp
836                 ode/demo/demo_friction.cpp
837                 ode/demo/demo_gyro2.cpp
838                 ode/demo/demo_gyroscopic.cpp
839                 ode/demo/demo_heightfield.cpp
840                 ode/demo/demo_hinge.cpp
841                 ode/demo/demo_I.cpp
842                 ode/demo/demo_jointPR.cpp
843                 ode/demo/demo_jointPU.cpp
844                 ode/demo/demo_joints.cpp
845                 ode/demo/demo_kinematic.cpp
846                 ode/demo/demo_motion.cpp
847                 ode/demo/demo_motor.cpp
848                 ode/demo/demo_ode.cpp
849                 ode/demo/demo_piston.cpp
850                 ode/demo/demo_plane2d.cpp
851                 ode/demo/demo_rfriction.cpp
852                 ode/demo/demo_slider.cpp
853                 ode/demo/demo_space.cpp
854                 ode/demo/demo_space_stress.cpp
855                 ode/demo/demo_step.cpp
856                 ode/demo/demo_transmission.cpp
857         )
858         
859         if(NOT ODE_NO_TRIMESH)
860                 list(
861                         APPEND ALL_DEMO_SRCS
862                         ode/demo/demo_basket.cpp
863                         ode/demo/demo_cyl.cpp
864                         ode/demo/demo_moving_convex.cpp
865                         ode/demo/demo_moving_trimesh.cpp
866                         ode/demo/demo_tracks.cpp
867                         ode/demo/demo_trimesh.cpp
868                         ode/demo/demo_trimesh_collision.cpp
869                 )
870         endif()
871         
872         foreach(MAIN_DEMO_SRC ${ALL_DEMO_SRCS})
873                 get_filename_component(DEMO ${MAIN_DEMO_SRC} NAME_WE)
874                 set(
875                         DEMO_SRC
876                         ${MAIN_DEMO_SRC}
877                 )
879                 if(NOT WIN32 OR ${DEMO} STREQUAL "demo_ode")
880                         add_executable(${DEMO} ${DEMO_SRC})
881                 else()
882                         if(NOT BUILD_SHARED_LIBS)
883                                 list(
884                                         APPEND DEMO_SRC 
885                                         ${DRAWSTUFF_RSRC}
886                                 )
887                         endif()
889                         add_executable(${DEMO} WIN32 ${DEMO_SRC})
890                         if(WIN32 AND MSVC)
891                                 set_target_properties(${DEMO} PROPERTIES LINK_FLAGS /ENTRY:mainCRTStartup)
892                         endif()
893                 endif()
894                 target_link_libraries(${DEMO} drawstuff)
895                 
896                 if(NOT WIN32 AND ${DEMO} STREQUAL "demo_chain1")
897                         target_link_libraries(${DEMO} m)
898                 endif()
899         endforeach()
900 endif()
902 if(ODE_WITH_TESTS)
903         set(
904                 TEST_SRCS
905                 tests/collision.cpp
906                 tests/collision_point_depth.cpp
907                 tests/friction.cpp
908                 tests/joint.cpp
909                 tests/main.cpp
910                 tests/odemath.cpp
911                 tests/joints/amotor.cpp
912                 tests/joints/ball.cpp
913                 tests/joints/dball.cpp
914                 tests/joints/fixed.cpp
915                 tests/joints/hinge.cpp
916                 tests/joints/hinge2.cpp
917                 tests/joints/piston.cpp
918                 tests/joints/pr.cpp
919                 tests/joints/pu.cpp
920                 tests/joints/slider.cpp
921                 tests/joints/universal.cpp
922                 tests/UnitTest++/src/AssertException.cpp
923                 tests/UnitTest++/src/AssertException.h
924                 tests/UnitTest++/src/CheckMacros.h
925                 tests/UnitTest++/src/Checks.cpp
926                 tests/UnitTest++/src/Checks.h
927                 tests/UnitTest++/src/Config.h
928                 tests/UnitTest++/src/DeferredTestReporter.cpp
929                 tests/UnitTest++/src/DeferredTestReporter.h
930                 tests/UnitTest++/src/DeferredTestResult.cpp
931                 tests/UnitTest++/src/DeferredTestResult.h
932                 tests/UnitTest++/src/MemoryOutStream.cpp
933                 tests/UnitTest++/src/MemoryOutStream.h
934                 tests/UnitTest++/src/ReportAssert.cpp
935                 tests/UnitTest++/src/ReportAssert.h
936                 tests/UnitTest++/src/Test.cpp
937                 tests/UnitTest++/src/TestDetails.cpp
938                 tests/UnitTest++/src/TestDetails.h
939                 tests/UnitTest++/src/Test.h
940                 tests/UnitTest++/src/TestList.cpp
941                 tests/UnitTest++/src/TestList.h
942                 tests/UnitTest++/src/TestMacros.h
943                 tests/UnitTest++/src/TestReporter.cpp
944                 tests/UnitTest++/src/TestReporter.h
945                 tests/UnitTest++/src/TestReporterStdout.cpp
946                 tests/UnitTest++/src/TestReporterStdout.h
947                 tests/UnitTest++/src/TestResults.cpp
948                 tests/UnitTest++/src/TestResults.h
949                 tests/UnitTest++/src/TestRunner.cpp
950                 tests/UnitTest++/src/TestRunner.h
951                 tests/UnitTest++/src/TestSuite.h
952                 tests/UnitTest++/src/TimeConstraint.cpp
953                 tests/UnitTest++/src/TimeConstraint.h
954                 tests/UnitTest++/src/TimeHelpers.h
955                 tests/UnitTest++/src/UnitTest++.h
956                 tests/UnitTest++/src/XmlTestReporter.cpp
957                 tests/UnitTest++/src/XmlTestReporter.h
958         )
959         
960         if(WIN32)
961                 list(
962                         APPEND TEST_SRCS
963                         tests/UnitTest++/src/Win32/TimeHelpers.cpp
964                         tests/UnitTest++/src/Win32/TimeHelpers.h
965                 )
966         else()
967                 list(
968                         APPEND TEST_SRCS
969                         tests/UnitTest++/src/Posix/SignalTranslator.cpp
970                         tests/UnitTest++/src/Posix/SignalTranslator.h
971                         tests/UnitTest++/src/Posix/TimeHelpers.cpp
972                         tests/UnitTest++/src/Posix/TimeHelpers.h
973                 )
974         endif()
975         
976         add_executable(tests ${TEST_SRCS})
977         target_include_directories(tests PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/tests/UnitTest++/src)
978         target_link_libraries(tests ODE)
979         
980         enable_testing()
981         add_test(tests ${CMAKE_CURRENT_BINARY_DIR}/tests)
982 endif()
984 include(CMakePackageConfigHelpers)
986 configure_package_config_file(
987   ${CMAKE_CURRENT_SOURCE_DIR}/ode-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/ode-config.cmake
988   INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ode
990 install(
991         FILES ${CMAKE_CURRENT_BINARY_DIR}/ode-config.cmake
992         DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ode-${VERSION}
993         COMPONENT development
995 write_basic_package_version_file(
996         ${CMAKE_CURRENT_BINARY_DIR}/ode-config-version.cmake
997         VERSION ${VERSION}
998         COMPATIBILITY ExactVersion
1000 install(
1001         FILES ${CMAKE_CURRENT_BINARY_DIR}/ode-config-version.cmake
1002         DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ode-${VERSION}
1003         COMPONENT development
1005 install(
1006         EXPORT ODE
1007         DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ode-${VERSION}
1008         NAMESPACE ODE::
1009         FILE ode-export.cmake
1010         COMPONENT development
1013 configure_file(cmake/cmake_uninstall.cmake.in cmake_uninstall.cmake @ONLY)
1014 add_custom_target(uninstall ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
1016 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.")
1018 set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime)
1019 set(CPACK_COMPONENT_DEVELOPMENT_DESCRIPTION "Open Dynamics Engine - development files\n${CPACK_DEBIAN_PACKAGE_DESCRIPTION}")
1020 set(CPACK_COMPONENT_RUNTIME_DESCRIPTION "Open Dynamics Engine - runtime library\n${CPACK_DEBIAN_PACKAGE_DESCRIPTION}")
1021 set(CPACK_DEB_COMPONENT_INSTALL ON)
1022 set(CPACK_DEBIAN_DEVELOPMENT_FILE_NAME "DEB-DEFAULT")
1023 set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_SECTION "libdevel")
1024 set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.ode.org/")
1025 set(CPACK_DEBIAN_PACKAGE_NAME "libode")
1026 set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
1027 set(CPACK_DEBIAN_RUNTIME_FILE_NAME "DEB-DEFAULT")
1028 set(CPACK_DEBIAN_RUNTIME_PACKAGE_SECTION "libs")
1029 set(CPACK_DEBIAN_RUNTIME_PACKAGE_SHLIBDEPS ON)
1030 set(CPACK_NSIS_PACKAGE_NAME "ODE ${VERSION}")
1031 set(CPACK_NSIS_URL_INFO_ABOUT "http://www.ode.org/")
1032 set(CPACK_PACKAGE_CONTACT "ode@ode.org")
1033 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "High performance library for simulating rigid body dynamics")
1034 set(CPACK_PACKAGE_DISPLAY_NAME "ODE ${VERSION}")
1035 set(CPACK_PACKAGE_INSTALL_DIRECTORY "ode-${VERSION}")
1036 set(CPACK_PACKAGE_NAME "ode")
1037 set(CPACK_PACKAGE_VENDOR "")
1038 set(CPACK_PACKAGE_VERSION ${VERSION})
1039 set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
1040 set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
1041 set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
1042 set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING)
1043 set(CPACK_RPM_COMPONENT_INSTALL ON)
1044 set(CPACK_RPM_DEVELOPMENT_FILE_NAME "RPM-DEFAULT")
1045 set(CPACK_RPM_development_PACKAGE_DESCRIPTION "The ode-devel package contains libraries and header files for developing applications that use ode or ode-double.")
1046 set(CPACK_RPM_development_PACKAGE_NAME "ode-devel")
1047 set(CPACK_RPM_development_PACKAGE_SUMMARY "Development files for ODE")
1048 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.")
1049 set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
1050 set(CPACK_RPM_PACKAGE_LICENSE "BSD or LGPLv2+")
1051 set(CPACK_RPM_PACKAGE_NAME "ode")
1052 set(CPACK_RPM_PACKAGE_SUMMARY "High performance library for simulating rigid body dynamics")
1053 set(CPACK_RPM_PACKAGE_URL "http://www.ode.org/")
1054 set(CPACK_RPM_RUNTIME_FILE_NAME "RPM-DEFAULT")
1056 if(ODE_DOUBLE_PRECISION)
1057         set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_CONFLICTS "libode-sp-dev")
1058         set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libode6")
1059         set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "libode-dev")
1060         set(CPACK_DEBIAN_RUNTIME_PACKAGE_CONFLICTS "libode6sp")
1061         set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "libode6")
1062         set(CPACK_RPM_development_PACKAGE_REQUIRES "ode-double")
1063         set(CPACK_RPM_runtime_PACKAGE_CONFLICTS "ode")
1064         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.")
1065         set(CPACK_RPM_runtime_PACKAGE_NAME "ode-double")
1066         set(CPACK_RPM_runtime_PACKAGE_SUMMARY "ODE physics library compiled with double precision")
1067 else()
1068         set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_CONFLICTS "libode-dev")
1069         set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "libode6sp")
1070         set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "libode-sp-dev")
1071         set(CPACK_DEBIAN_RUNTIME_PACKAGE_CONFLICTS "libode6")
1072         set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "libode6sp")
1073         set(CPACK_RPM_development_PACKAGE_REQUIRES "ode")
1074         set(CPACK_RPM_runtime_PACKAGE_CONFLICTS "ode-double")
1075         set(CPACK_RPM_runtime_PACKAGE_NAME "ode")
1076 endif()
1078 include(CPack)