@@ -83,48 +83,24 @@ list(APPEND libs Qt5::Core Qt5::Widgets Qt5::OpenGL Qt5::Network)
83
83
84
84
# ODE
85
85
if (BUILD_ODE)
86
- # build ODE, because some versions of it cause grSim to segfault somewhere
87
- # could be because in some packages the double precision is turned off
88
- include (ExternalProject)
89
-
90
- ExternalProject_Add(ode_external
91
- GIT_REPOSITORY https://bitbucket.org/odedevs/ode.git
92
- GIT_TAG 0.16.4
93
- CMAKE_ARGS
94
- -DCMAKE_INSTALL_PREFIX:PATH =<INSTALL_DIR>
95
- -DCMAKE_TOOLCHAIN_FILE:PATH =${CMAKE_TOOLCHAIN_FILE}
96
- -DCMAKE_C_COMPILER:PATH =${CMAKE_C_COMPILER}
97
- -DCMAKE_CXX_COMPILER:PATH =${CMAKE_CXX_COMPILER}
98
- -DCMAKE_MAKE_PROGRAM:PATH =${CMAKE_MAKE_PROGRAM}
99
- # necessary, because it does not build the static libs if this is ON
100
- -DBUILD_SHARED_LIBS=OFF
101
- # if this is OFF grSim just dies instantly and INSTALL.md says it should be ON
102
- -DODE_DOUBLE_PRECISION=ON
103
- -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
104
- STEP_TARGETS install
105
- )
106
-
107
- set (ODE_LIB_SUBPATH "${CMAKE_INSTALL_LIBDIR} /${CMAKE_STATIC_LIBRARY_PREFIX} ode${CMAKE_STATIC_LIBRARY_SUFFIX} " )
108
-
109
- # the byproducts are available after the install step
110
- ExternalProject_Add_Step(ode_external out
111
- DEPENDEES install
112
- BYPRODUCTS
113
- "<INSTALL_DIR>/${ODE_LIB_SUBPATH} "
114
- )
115
-
116
- ExternalProject_Get_Property(ode_external install_dir)
117
- set (ODE_LIBRARY "${install_dir} /${ODE_LIB_SUBPATH} " )
118
- list (APPEND libs ${ODE_LIBRARY} )
119
- target_include_directories (${app} PRIVATE "${install_dir} /include" )
120
-
86
+ include (BuildODE)
121
87
add_dependencies (${app} ode_external)
122
- elseif (WIN32 )
123
- find_package (ODE CONFIG REQUIRED)
124
- list (APPEND libs ODE::ODE)
125
88
else ()
126
- find_package (ODE REQUIRED)
127
- list (APPEND libs ode::ode)
89
+ if (WIN32 )
90
+ find_package (ODE CONFIG)
91
+ set (ODE_LIB_NAME ODE::ODE)
92
+ else ()
93
+ find_package (ODE)
94
+ set (ODE_LIB_NAME ode::ode)
95
+ endif ()
96
+
97
+ if (ODE_FOUND)
98
+ list (APPEND libs ${ODE_LIB_NAME} )
99
+ else ()
100
+ # if ODE could not be found just build it
101
+ include (BuildODE)
102
+ add_dependencies (${app} ode_external)
103
+ endif ()
128
104
endif ()
129
105
130
106
# VarTypes
0 commit comments