Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5636 for code/branches


Ignore:
Timestamp:
Aug 12, 2009, 2:21:56 PM (15 years ago)
Author:
rgrieder
Message:

Fixed plugins for msvc (sry fabian, forgot to tell you about this issue).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/libraries/cmake/TargetUtilities.cmake

    r5626 r5636  
    150150  # PLUGIN A
    151151  IF(_arg_PLUGIN)
    152     SET(_arg_PLUGIN MODULE)
    153     SET(_arg_SHARED)
     152    SET(_arg_SHARED MODULE)
    154153    SET(_arg_STATIC)
    155154  ENDIF()
     
    157156  # Add the library/executable
    158157  IF("${_target_type}" STREQUAL "LIBRARY")
    159     ADD_LIBRARY(${_target_name} ${_arg_STATIC} ${_arg_SHARED} ${_arg_PLUGIN}
     158    ADD_LIBRARY(${_target_name} ${_arg_STATIC} ${_arg_SHARED}
    160159                ${_arg_EXCLUDE_FROM_ALL} ${_${_target_name}_files})
    161160  ELSE()
     
    167166  IF (_arg_PLUGIN)
    168167    SET_TARGET_PROPERTIES(${_target_name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_PLUGIN_OUTPUT_DIRECTORY})
    169     SET_TARGET_PROPERTIES(${_target_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_PLUGIN_OUTPUT_DIRECTORY})
    170168    ADD_PLUGIN(${_target_name})
    171169  ENDIF()
     
    207205      RUNTIME DESTINATION ${ORXONOX_RUNTIME_INSTALL_PATH}
    208206      LIBRARY DESTINATION ${_library_destination}
    209       #ARCHIVE DESTINATION ${ORXONOX_ARCHIVE_INSTALL_PATH}
    210207    )
    211208  ENDIF()
     
    217214# This helps finding dynamically loadable plugins at runtime
    218215
    219 FUNCTION(ADD_PLUGIN _name)
     216FUNCTION(ADD_PLUGIN _target)
    220217  # We use the properties to get the name because the librarys name may differ from
    221   # the targets name (for example orxonox <-> liborxonox)
    222 
    223   GET_TARGET_PROPERTY(_target_loc ${_name} LOCATION)
     218  # the target name (for example orxonox <-> liborxonox)
     219
     220  GET_TARGET_PROPERTY(_target_loc ${_target} LOCATION)
    224221  GET_FILENAME_COMPONENT(_target_name ${_target_loc} NAME_WE)
    225222
    226   SET(_plugin_filename "${CMAKE_PLUGIN_OUTPUT_DIRECTORY}/${_target_name}.plugin")
    227 
    228   FILE(WRITE ${_plugin_filename})
    229 
    230   INSTALL(
    231     FILES ${_plugin_filename}
    232     DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH}
    233   )
     223  IF(CMAKE_CONFIGURATION_TYPES)
     224    FOREACH(_config ${CMAKE_CONFIGURATION_TYPES})
     225      SET(_plugin_filename ${CMAKE_PLUGIN_OUTPUT_DIRECTORY}/${_config}/${_target_name}.plugin)
     226
     227      FILE(WRITE ${_plugin_filename})
     228
     229      INSTALL(
     230        FILES ${_plugin_filename}
     231        DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH}
     232        CONFIGURATIONS ${_config}
     233      )
     234    ENDFOREACH()
     235  ELSE()
     236    SET(_plugin_filename ${CMAKE_PLUGIN_OUTPUT_DIRECTORY}/${_target_name}.plugin)
     237
     238    FILE(WRITE ${_plugin_filename})
     239
     240    INSTALL(
     241      FILES ${_plugin_filename}
     242      DESTINATION ${ORXONOX_PLUGIN_INSTALL_PATH}
     243    )
     244  ENDIF()
    234245ENDFUNCTION(ADD_PLUGIN)
Note: See TracChangeset for help on using the changeset viewer.