Changeset 8478

Show
Ignore:
Timestamp:
06/20/08 18:09:10
Author:
robert
Message:

Removed now redudent OSG type checks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenSceneGraph-TrainingMaterials/trunk/Sources/Exercises/CMakeLists.txt

    r8427 r8478  
    1313 
    1414 
     15if(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) 
     23endif(COMMAND cmake_policy) 
     24 
     25 
    1526PROJECT(EXECERCISES) 
    1627 
     
    4152   SET(OSG_PLUGINS osgPlugins) 
    4253ENDIF(APPEND_OPENSCENEGRAPH_VERSION) 
    43  
    44 # Automatically detected build options 
    45 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  
    6654 
    6755 
     
    9987 
    10088# 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 
    10290# 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 
    10694# 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 
    10896# cases. With IRIX, we're going to hope explicit linking to the underlying 
    10997# library is not necessary. We currently don't case for pthreads on Windows 
     
    112100IF(CMAKE_SYSTEM MATCHES IRIX) 
    113101    # 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 "") 
    115103ENDIF(CMAKE_SYSTEM MATCHES IRIX) 
    116104 
     
    135123    ${OPENGL_INCLUDE_DIR} 
    136124) 
    137      
     125 
    138126# Common global definitions 
    139127#ADD_DEFINITIONS(-D) 
     
    246234    SET(LIB_POSTFIX "") 
    247235ENDIF(NOT DEFINED LIB_POSTFIX) 
    248      
     236 
    249237#SET(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin/${CMAKE_SYSTEM_NAME}) 
    250238SET(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin) 
     
    386374ENDIF(OSG_AGGRESSIVE_WARNING_FLAGS) 
    387375 
    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 
    389377# and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support. 
    390378IF(APPLE) 
    391379    # These are just defaults/recommendations, but how we want to build 
    392380    # 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 
    394382    # will overwrite any changes the user sets. 
    395383    # FORCE is used because the options are not reflected in the UI otherwise.