Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 29, 2012, 10:30:42 PM (11 years ago)
Author:
landauf
Message:

moved settings for executables in visual studio to TargetUtilities to make them work for orxonox-main and test-executables
define test-executables with ORXONOX_ADD_EXECUTABLE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/testing/cmake/tools/TargetUtilities.cmake

    r8729 r9474  
    8282MACRO(ORXONOX_ADD_EXECUTABLE _target_name)
    8383  TU_ADD_TARGET(${_target_name} EXECUTABLE "WIN32" ${ARGN})
     84 
     85  # When using Visual Studio we want to use the output directory as working
     86  # directory and we also want to specify where the external dlls
     87  # (lua, ogre, etc.) are. The problem hereby is that these information cannot
     88  # be specified in CMake because they are not stored in the actual project file.
     89  # This workaround will create a configured *.vcproj.user file that holds the
     90  # right values. When starting the solution for the first time,
     91  # these get written to the *vcproj.yourPCname.yourname.user
     92  IF(MSVC)
     93    IF(CMAKE_CL_64)
     94      SET(MSVC_PLATFORM "x64")
     95    ELSE()
     96      SET(MSVC_PLATFORM "Win32")
     97    ENDIF()
     98    IF(MSVC10)
     99      CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/src/template.vcxproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/${_target_name}.vcxproj.user")
     100    ELSE()
     101      STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?).*$" "\\1"
     102             VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}")
     103      CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/src/template.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/${_target_name}.vcproj.user")
     104    ENDIF()
     105  ENDIF(MSVC)
    84106ENDMACRO(ORXONOX_ADD_EXECUTABLE)
    85107
Note: See TracChangeset for help on using the changeset viewer.