Show
Ignore:
Timestamp:
03/23/09 17:01:02 (6 years ago)
Author:
robert
Message:

From Philip Lowman, "Here's the promised cleanup of the OSG's CMakeLists.txt files for the src/ folder. I'll submit the others separately.

Also, there was also a small bug in osgDB's CMakeLists.txt that was causing an error when I tested with CMake 2.4.4.

IF(${OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX} STREQUAL "quicktime")
was changed to
IF(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX STREQUAL "quicktime")
"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgWrappers/CMakeLists.txt

    r9878 r9949  
    11PROJECT(OSG_WRAPPERS) 
    22 
    3 IF   (NOT DYNAMIC_OPENSCENEGRAPH) 
     3IF(NOT DYNAMIC_OPENSCENEGRAPH) 
    44    ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) 
    5 ENDIF(NOT DYNAMIC_OPENSCENEGRAPH) 
     5ENDIF() 
    66 
    77SET(LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH}/${OSG_PLUGINS}") 
     
    1010 
    1111IF(MSVC80) 
    12   IF(NOT OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS) 
    13     SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO") 
    14   ENDIF(NOT OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS) 
    15 ENDIF(MSVC80) 
     12    IF(NOT OSG_MSVC_GENERATE_PLUGINS_AND_WRAPPERS_MANIFESTS) 
     13        SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO") 
     14    ENDIF() 
     15ENDIF() 
    1616 
    1717MACRO(ADD_WRAPPER_LIB SUBDIR EXPORTDEF) 
     
    4242            SET(LISTNAME ${ARG}) 
    4343            REMOVE(CURRLIST ${CURRLIST} ) 
    44              
    45         ELSE(${EXPRESSION}) 
     44        ELSE() 
    4645            SET(CURRLIST ${CURRLIST} ${ARG})     
    47              
    48         ENDIF(${EXPRESSION}) 
    49     ENDFOREACH(ARG) 
     46        ENDIF() 
     47    ENDFOREACH() 
    5048    SET(${LISTNAME} ${CURRLIST}) 
    5149    #MESSAGE(STATUS "STORED LIST [${LISTNAME}] = (${CURRLIST})") 
     
    5553    FOREACH(EXF ${EXCLUDE}) 
    5654        REMOVE(SRC_FILES ${OPENSCENEGRAPH_DIR}/src/${SUBDIR}/${EXF}) 
    57     ENDFOREACH(EXF) 
     55    ENDFOREACH() 
    5856         
    5957    FOREACH(DEF ${DEFINE}) 
    6058        SET(DEFSTR "${DEFSTR} /D \"${DEF}\"") 
    6159        #MESSAGE(STATUS "add symbol : " ${DEF}) 
    62     ENDFOREACH(DEF) 
     60    ENDFOREACH() 
    6361     
    6462    IF(NOT DEFSTR STREQUAL "") 
    6563        SET_SOURCE_FILES_PROPERTIES(${SRC_FILES} PROPERTIES COMPILE_FLAGS ${DEFSTR}) 
    6664        #MESSAGE(STATUS "*********  ADD COMPILE FLAGS ${DEFSTR} **********") 
    67     ENDIF(NOT DEFSTR STREQUAL "") 
     65    ENDIF() 
    6866     
    6967    #ADD_LIBRARY(${TARGET_NAME} SHARED ${SRC_FILES} ) 
    70         ADD_LIBRARY(${TARGET_NAME} MODULE ${SRC_FILES} ) 
     68    ADD_LIBRARY(${TARGET_NAME} MODULE ${SRC_FILES} ) 
    7169         
    7270    #not sure if needed, but for plugins only msvc need the d suffix 
    7371    IF(NOT MSVC) 
    7472        SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES DEBUG_POSTFIX "") 
    75   ELSE(NOT MSVC) 
     73    ELSE() 
    7674        IF(OSG_MSVC_VERSIONED_DLL)  
    77                         
    78                 #this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR 
    79                 #the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property 
    80                 #because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there, 
    81                 #it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented 
    82                 #changing bin to something else breaks this hack 
    83                 #the dll are placed in bin/${OSG_PLUGINS}  
    84                  
    85                 IF(NOT MSVC_IDE) 
    86                     SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/") 
    87                 ELSE(NOT MSVC_IDE) 
    88                     SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES PREFIX "../../bin/${OSG_PLUGINS}/" IMPORT_PREFIX "../") 
    89                 ENDIF(NOT MSVC_IDE) 
    90                  
    91                  
    92         ELSE(OSG_MSVC_VERSIONED_DLL) 
     75            #this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR 
     76            #the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property 
     77            #because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there, 
     78            #it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented 
     79            #changing bin to something else breaks this hack 
     80            #the dll are placed in bin/${OSG_PLUGINS}  
    9381             
     82            IF(NOT MSVC_IDE) 
     83                SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/") 
     84            ELSE() 
     85                SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES PREFIX "../../bin/${OSG_PLUGINS}/" IMPORT_PREFIX "../") 
     86            ENDIF() 
     87 
     88        ELSE() 
    9489            #in standard mode (unversioned) the .lib and .dll are placed in lib/<debug or release>/${OSG_PLUGINS}. 
    9590            #here the PREFIX property has been used, the same result would be accomplidhe by prepending ${OSG_PLUGINS}/ to OUTPUT_NAME target property 
    96              
    9791            SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES PREFIX "${OSG_PLUGINS}/") 
    98         ENDIF(OSG_MSVC_VERSIONED_DLL) 
    99     ENDIF(NOT MSVC) 
     92        ENDIF() 
     93    ENDIF() 
    10094 
    10195    SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES DEFINE_SYMBOL "${EXPORTDEF}" PROJECT_LABEL "Wrapper ${SUBDIR}") 
     
    10599        LINK_EXTERNAL(${TARGET_NAME} ${OPENGL_LIBRARIES})  
    106100 
    107     ELSE(MSVC AND OSG_MSVC_VERSIONED_DLL) 
     101    ELSE() 
    108102        TARGET_LINK_LIBRARIES(${TARGET_NAME} ${LINK}) 
    109     ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL) 
     103    ENDIF() 
    110104    #MESSAGE(STATUS "--TARGET_LINK_LIBRARIES-->${TARGET_NAME}<->${LINK}<-") 
    111105     
     106    #FIXME: Deprecated 
    112107    REMOVE(DEFINE ${DEFINE})     
    113108    REMOVE(LINK ${LINK})     
     
    115110     
    116111    IF(WIN32) 
    117         INSTALL(TARGETS ${TARGET_NAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib/${OSG_PLUGINS} LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT libopenscenegraph-wrappers) 
    118     ELSE(WIN32) 
    119         INSTALL(TARGETS ${TARGET_NAME} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT libopenscenegraph-wrappers) 
    120     ENDIF(WIN32) 
    121      
     112        INSTALL(TARGETS ${TARGET_NAME} 
     113            RUNTIME DESTINATION bin 
     114            ARCHIVE DESTINATION lib/${OSG_PLUGINS} 
     115            LIBRARY DESTINATION bin/${OSG_PLUGINS} 
     116            COMPONENT libopenscenegraph-wrappers) 
     117    ELSE() 
     118        INSTALL(TARGETS ${TARGET_NAME} 
     119            RUNTIME DESTINATION bin 
     120            ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} 
     121            LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} 
     122            COMPONENT libopenscenegraph-wrappers) 
     123    ENDIF() 
    122124ENDMACRO(ADD_WRAPPER_LIB) 
    123  
    124  
    125125 
    126126SET(OSGWRAPPER_LIB_LIST  
     
    145145 
    146146SET(OSGWRAPPER_DIR ${CMAKE_CURRENT_SOURCE_DIR}) 
     147 
    147148IF(MSVC) 
    148149    SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR}) 
    149 ENDIF(MSVC) 
    150 FOREACH(LIB ${OSGWRAPPER_LIB_LIST} ) 
    151     ADD_WRAPPER_LIB(${LIB}  OSGWRAPPERS_LIBRARY LINK OpenThreads osg osgGA ${LIB} osgIntrospection)     
    152 ENDFOREACH(LIB ${OSGWRAPPER_LIB_LIST} ) 
     150ENDIF() 
     151 
     152FOREACH(LIB ${OSGWRAPPER_LIB_LIST}) 
     153    ADD_WRAPPER_LIB(${LIB} OSGWRAPPERS_LIBRARY LINK OpenThreads osg osgGA ${LIB} osgIntrospection)     
     154ENDFOREACH()