Changeset 8478
- Timestamp:
- 06/20/08 18:09:10
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
OpenSceneGraph-TrainingMaterials/trunk/Sources/Exercises/CMakeLists.txt
r8427 r8478 13 13 14 14 15 if(COMMAND cmake_policy) 16 # Works around warnings libraries linked against that don't 17 # have absolute paths (e.g. -lpthreads) 18 cmake_policy(SET CMP0003 NEW) 19 20 # Works around warnings about escaped quotes in ADD_DEFINITIONS 21 # statements. 22 cmake_policy(SET CMP0005 OLD) 23 endif(COMMAND cmake_policy) 24 25 15 26 PROJECT(EXECERCISES) 16 27 … … 41 52 SET(OSG_PLUGINS osgPlugins) 42 53 ENDIF(APPEND_OPENSCENEGRAPH_VERSION) 43 44 # Automatically detected build options45 EXEC_PROGRAM(osgversion ARGS Matrix::value_type OUTPUT_VARIABLE OSG_USE_FLOAT_MATRIX)46 IF(OSG_USE_FLOAT_MATRIX MATCHES "float")47 ADD_DEFINITIONS(-DOSG_USE_FLOAT_MATRIX)48 ENDIF(OSG_USE_FLOAT_MATRIX MATCHES "float")49 50 EXEC_PROGRAM(osgversion ARGS Plane::value_type OUTPUT_VARIABLE OSG_USE_FLOAT_PLANE)51 IF(OSG_USE_FLOAT_PLANE MATCHES "float")52 ADD_DEFINITIONS(-DOSG_USE_FLOAT_PLANE)53 ENDIF(OSG_USE_FLOAT_PLANE MATCHES "float")54 55 EXEC_PROGRAM(osgversion ARGS BoundingSphere::value_type OUTPUT_VARIABLE OSG_USE_FLOAT_BOUNDINGSPHERE)56 IF(OSG_USE_FLOAT_BOUNDINGSPHERE MATCHES "double")57 ADD_DEFINITIONS(-DOSG_USE_DOUBLE_BOUNDINGSPHERE)58 ENDIF(OSG_USE_FLOAT_BOUNDINGSPHERE MATCHES "double")59 60 EXEC_PROGRAM(osgversion ARGS BoundingBox::value_type OUTPUT_VARIABLE OSG_USE_FLOAT_BOUNDINGBOX)61 IF(OSG_USE_FLOAT_BOUNDINGBOX MATCHES "double")62 ADD_DEFINITIONS(-DOSG_USE_DOUBLE_BOUNDINGBOX)63 ENDIF(OSG_USE_FLOAT_BOUNDINGBOX MATCHES "double")64 65 66 54 67 55 … … 99 87 100 88 # Okay, here's the problem: On some platforms, linking against OpenThreads 101 # is not enough and explicit linking to the underlying thread library 89 # is not enough and explicit linking to the underlying thread library 102 90 # is also required (e.g. FreeBSD). But OpenThreads may be built with different 103 # backends (Pthreads, Sproc, Windows) so we don't know what the underlying 104 # thread library is because some platforms support multiple backends (e.g. 105 # IRIX supports Sproc and Pthreads). Linking all libraries won't work 91 # backends (Pthreads, Sproc, Windows) so we don't know what the underlying 92 # thread library is because some platforms support multiple backends (e.g. 93 # IRIX supports Sproc and Pthreads). Linking all libraries won't work 106 94 # because the libraries may be incompatible. 107 # So the current solution is to attempt best guess linking and exempt certain 95 # So the current solution is to attempt best guess linking and exempt certain 108 96 # cases. With IRIX, we're going to hope explicit linking to the underlying 109 97 # library is not necessary. We currently don't case for pthreads on Windows … … 112 100 IF(CMAKE_SYSTEM MATCHES IRIX) 113 101 # Erase CMAKE_THREAD_LIBS_INIT and hope it works 114 SET(CMAKE_THREAD_LIBS_INIT "" CACHE INTERNAL "") 102 SET(CMAKE_THREAD_LIBS_INIT "" CACHE INTERNAL "") 115 103 ENDIF(CMAKE_SYSTEM MATCHES IRIX) 116 104 … … 135 123 ${OPENGL_INCLUDE_DIR} 136 124 ) 137 125 138 126 # Common global definitions 139 127 #ADD_DEFINITIONS(-D) … … 246 234 SET(LIB_POSTFIX "") 247 235 ENDIF(NOT DEFINED LIB_POSTFIX) 248 236 249 237 #SET(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin/${CMAKE_SYSTEM_NAME}) 250 238 SET(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin) … … 386 374 ENDIF(OSG_AGGRESSIVE_WARNING_FLAGS) 387 375 388 # Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4 376 # Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4 389 377 # and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support. 390 378 IF(APPLE) 391 379 # These are just defaults/recommendations, but how we want to build 392 380 # out of the box. But the user needs to be able to change these options. 393 # So we must only set the values the first time CMake is run, or we 381 # So we must only set the values the first time CMake is run, or we 394 382 # will overwrite any changes the user sets. 395 383 # FORCE is used because the options are not reflected in the UI otherwise.
