|
| 1 | +# ############################################################################ |
| 2 | +# Conditional defines |
| 3 | +# ############################################################################ |
| 4 | + |
| 5 | +if(SmallChange_FOUND) |
| 6 | + add_definitions(-DHAVE_SMALLCHANGE_LIBRARY) |
| 7 | +endif() |
| 8 | +if(SIMVoleon_FOUND) |
| 9 | + add_definitions(-DHAVE_SIMVOLEON_LIBRARY) |
| 10 | +endif() |
| 11 | + |
| 12 | +check_include_file(windows.h HAVE_WINDOWS_H) |
| 13 | +if(HAVE_WINDOWS_H) |
| 14 | + add_definitions(-DHAVE_WINDOWS_H) |
| 15 | +endif() |
| 16 | +# Checks specific OpenGL configurations |
| 17 | +if(HAVE_WINDOWS_H) |
| 18 | + check_include_files("windows.h;GL/gl.h" HAVE_GL_GL_H) |
| 19 | + if(HAVE_GL_GL_H) |
| 20 | + add_definitions(-DHAVE_GL_GL_H) |
| 21 | + endif() |
| 22 | +elseif(APPLE AND NOT COIN_BUILD_MAC_X11) |
| 23 | + check_include_file(OpenGL/gl.h HAVE_OPENGL_GL_H) |
| 24 | + if(HAVE_OPENGL_GL_H) |
| 25 | + add_definitions(-DHAVE_OPENGL_GL_H) |
| 26 | + endif() |
| 27 | +else() |
| 28 | + check_include_files("GL/gl.h" HAVE_GL_GL_H) |
| 29 | + if(HAVE_GL_GL_H) |
| 30 | + add_definitions(-DHAVE_GL_GL_H) |
| 31 | + endif() |
| 32 | +endif() |
| 33 | + |
| 34 | +set(CMAKE_REQUIRED_LIBRARIES Coin::Coin So${Gui}::So${Gui}) |
| 35 | + |
| 36 | +check_cxx_source_compiles(" |
| 37 | + #include <Inventor/collision/SoIntersectionDetectionAction.h> |
| 38 | + int main() { SoIntersectionDetectionAction ida; ida.setDraggersEnabled(FALSE); return 0; } |
| 39 | +" HAVE_SOINTERSECTIONDETECTIONACTION) |
| 40 | +check_cxx_source_compiles(" |
| 41 | + #include <Inventor/nodes/SoImage.h> |
| 42 | + int main() { SoImage * p = new SoImage; return 0; } |
| 43 | +" HAVE_SOIMAGE) |
| 44 | +check_cxx_source_compiles(" |
| 45 | + #include <Inventor/annex/HardCopy/SoHardCopy.h> |
| 46 | + int main() { const char * v = SoHardCopy::getVersion(); return 0; } |
| 47 | +" HAVE_HARDCOPY) |
| 48 | +check_cxx_source_compiles(" |
| 49 | + #include <Inventor/actions/SoGLRenderAction.h> |
| 50 | + int main() { int i = SoGLRenderAction::SORTED_OBJECT_SORTED_TRIANGLE_BLEND; return 0; } |
| 51 | +" HAVE_SOGLRENDERACTION_SORTED_OBJECT_SORTED_TRIANGLE_BLEND) |
| 52 | +check_cxx_source_compiles(" |
| 53 | + #include <Inventor/nodes/SoExtSelection.h> |
| 54 | + int main() { SoExtSelection * p = new SoExtSelection; return 0; } |
| 55 | +" HAVE_SOEXTSELECTION) |
| 56 | +check_cxx_source_compiles(" |
| 57 | + #include <Inventor/nodes/SoExtSelection.h> |
| 58 | + int main() { SoExtSelection * p = new SoExtSelection; p->lassoMode = SoExtSelection::VISIBLE_SHAPES; return 0; } |
| 59 | +" HAVE_SOEXTSELECTION_LASSOMODE) |
| 60 | +check_cxx_source_compiles(" |
| 61 | + #include <Inventor/nodes/SoBumpMap.h> |
| 62 | + int main() { SoBumpMap * p = new SoBumpMap; return 0; } |
| 63 | +" HAVE_SOBUMPMAP) |
| 64 | +check_cxx_source_compiles(" |
| 65 | + #include <Inventor/nodes/SoBumpMapTransform.h> |
| 66 | + int main() { SoBumpMapTransform * p = new SoBumpMapTransform; return 0; } |
| 67 | +" HAVE_SOBUMPMAPTRANSFORM) |
| 68 | +check_cxx_source_compiles(" |
| 69 | + #include <Inventor/nodes/SoShaderProgram.h> |
| 70 | + int main() { SoShaderProgram * p = new SoShaderProgram; return 0; } |
| 71 | +" HAVE_SOSHADERPROGRAM) |
| 72 | +check_cxx_source_compiles(" |
| 73 | + #include <Inventor/nodes/SoFragmentShader.h> |
| 74 | + int main() { SoFragmentShader * p = new SoFragmentShader; return 0; } |
| 75 | +" HAVE_SOFRAGMENTSHADER) |
| 76 | +check_cxx_source_compiles(" |
| 77 | + #include <Inventor/nodes/SoVertexShader.h> |
| 78 | + int main() { SoVertexShader * p = new SoVertexShader; return 0; } |
| 79 | +" HAVE_SOVERTEXSHADER) |
| 80 | +check_cxx_source_compiles(" |
| 81 | + #include <Inventor/nodes/SoTextureUnit.h> |
| 82 | + int main() { SoTextureUnit * p = new SoTextureUnit; return 0; } |
| 83 | +" HAVE_SOTEXTUREUNIT) |
| 84 | +check_cxx_source_compiles(" |
| 85 | + #include <Inventor/nodes/SoTextureScalePolicy.h> |
| 86 | + int main() { SoTextureScalePolicy * p = new SoTextureScalePolicy; return 0; } |
| 87 | +" HAVE_SOTEXTURESCALEPOLICY) |
| 88 | +check_cxx_source_compiles(" |
| 89 | + #include <Inventor/nodes/SoSceneTexture2.h> |
| 90 | + int main() { SoSceneTexture2 * p = new SoSceneTexture2; return 0; } |
| 91 | +" HAVE_SOSCENETEXTURE2) |
| 92 | +check_cxx_source_compiles(" |
| 93 | + #include <Inventor/nodes/SoPolygonOffset.h> |
| 94 | + int main() { SoPolygonOffset * p = new SoPolygonOffset; return 0; } |
| 95 | +" HAVE_SOPOLYGONOFFSET) |
| 96 | +check_cxx_source_compiles(" |
| 97 | + #include <Inventor/nodes/SoMarkerSet.h> |
| 98 | + int main() { SoMarkerSet * p = new SoMarkerSet; return 0; } |
| 99 | +" HAVE_SOMARKERSET) |
| 100 | + |
| 101 | +check_cxx_source_compiles(" |
| 102 | + #include <Inventor/${Gui}/viewers/So${Gui}ExaminerViewer.h> |
| 103 | + int main() { So${Gui}ExaminerViewer * viewer = (So${Gui}ExaminerViewer *) 0; viewer->setFullScreen(FALSE); return 0; } |
| 104 | +" HAVE_SOCOMPONENT_SETFULLSCREEN) |
| 105 | +check_cxx_source_compiles(" |
| 106 | + #include <Inventor/${Gui}/viewers/So${Gui}ExaminerViewer.h> |
| 107 | + int main() { So${Gui}ExaminerViewer * viewer = (So${Gui}ExaminerViewer *) 0; viewer->setStereoViewing(FALSE); return 0; } |
| 108 | +" HAVE_VIEWER_STEREO_VIEWING) |
| 109 | +check_cxx_source_compiles(" |
| 110 | + #include <Inventor/${Gui}/viewers/So${Gui}ExaminerViewer.h> |
| 111 | + int main() { So${Gui}ExaminerViewer * viewer = (So${Gui}ExaminerViewer *) 0; viewer->setQuadBufferStereo(0); return 0; } |
| 112 | +" HAVE_VIEWER_QUADBUFFER_STEREO) |
| 113 | +check_cxx_source_compiles(" |
| 114 | + #include <Inventor/${Gui}/So${Gui}RenderArea.h> |
| 115 | + int main() { So${Gui}RenderArea * viewer = (So${Gui}RenderArea *) 0; viewer->setAccumulationBuffer(FALSE); return 0; } |
| 116 | +" HAVE_SOGUIGLWIDGET_ACCUMULATIONBUFFER) |
| 117 | + |
| 118 | +unset(CMAKE_REQUIRED_LIBRARIES) |
| 119 | + |
| 120 | +if(HAVE_SOPOLYGONOFFSET) |
| 121 | + add_definitions(-DHAVE_SOPOLYGONOFFSET) |
| 122 | +endif() |
| 123 | + |
| 124 | +if(HAVE_SOMARKERSET) |
| 125 | + add_definitions(-DHAVE_SOMARKERSET) |
| 126 | +endif() |
| 127 | + |
| 128 | +if(HAVE_SOIMAGE) |
| 129 | + add_definitions(-DHAVE_SOIMAGE) |
| 130 | +endif() |
| 131 | + |
| 132 | +if(HAVE_SOTEXTURESCALEPOLICY) |
| 133 | + add_definitions(-DHAVE_SOTEXTURESCALEPOLICY) |
| 134 | +endif() |
| 135 | + |
| 136 | +if(HAVE_SOTEXTUREUNIT) |
| 137 | + add_definitions(-DHAVE_SOTEXTUREUNIT) |
| 138 | +endif() |
| 139 | + |
| 140 | +if(HAVE_SOBUMPMAP) |
| 141 | + add_definitions(-DHAVE_SOBUMPMAP) |
| 142 | +endif() |
| 143 | + |
| 144 | +if(HAVE_SOBUMPMAPTRANSFORM) |
| 145 | + add_definitions(-DHAVE_SOBUMPMAPTRANSFORM) |
| 146 | +endif() |
| 147 | + |
| 148 | +if(HAVE_SOSCENETEXTURE2) |
| 149 | + add_definitions(-DHAVE_SOSCENETEXTURE2) |
| 150 | +endif() |
| 151 | + |
| 152 | +if(HAVE_SOEXTSELECTION) |
| 153 | + add_definitions(-DHAVE_SOEXTSELECTION) |
| 154 | +endif() |
| 155 | + |
| 156 | +if(HAVE_SOEXTSELECTION_LASSOMODE) |
| 157 | + add_definitions(-DHAVE_SOEXTSELECTION_LASSOMODE) |
| 158 | +endif() |
| 159 | + |
| 160 | +if(HAVE_SOSHADERPROGRAM) |
| 161 | + add_definitions(-DHAVE_SOSHADERPROGRAM) |
| 162 | +endif() |
| 163 | + |
| 164 | +if(HAVE_SOFRAGMENTSHADER) |
| 165 | + add_definitions(-DHAVE_SOFRAGMENTSHADER) |
| 166 | +endif() |
| 167 | + |
| 168 | +if(HAVE_SOVERTEXSHADER) |
| 169 | + add_definitions(-DHAVE_SOVERTEXSHADER) |
| 170 | +endif() |
| 171 | + |
| 172 | +if(HAVE_SOGLRENDERACTION_SORTED_OBJECT_SORTED_TRIANGLE_BLEND) |
| 173 | + add_definitions(-DHAVE_SOGLRENDERACTION_SORTED_OBJECT_SORTED_TRIANGLE_BLEND) |
| 174 | +endif() |
| 175 | + |
| 176 | +if(HAVE_SOCOMPONENT_SETFULLSCREEN) |
| 177 | + add_definitions(-DHAVE_SOCOMPONENT_SETFULLSCREEN) |
| 178 | +endif() |
| 179 | + |
| 180 | +if(HAVE_VIEWER_STEREO_VIEWING) |
| 181 | + add_definitions(-DHAVE_VIEWER_STEREO_VIEWING) |
| 182 | +endif() |
| 183 | + |
| 184 | +if(HAVE_VIEWER_QUADBUFFER_STEREO) |
| 185 | + add_definitions(-DHAVE_VIEWER_QUADBUFFER_STEREO) |
| 186 | +endif() |
| 187 | + |
| 188 | +if(HAVE_SOGUIGLWIDGET_ACCUMULATIONBUFFER) |
| 189 | + add_definitions(-DHAVE_SOGUIGLWIDGET_ACCUMULATIONBUFFER) |
| 190 | +endif() |
| 191 | + |
| 192 | +if(HAVE_SOINTERSECTIONDETECTIONACTION) |
| 193 | + add_definitions(-DHAVE_SOINTERSECTIONDETECTIONACTION) |
| 194 | +endif() |
| 195 | + |
| 196 | +if(HAVE_HARDCOPY) |
| 197 | + add_definitions(-DHAVE_HARDCOPY) |
| 198 | +endif() |
0 commit comments