Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9474


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

Location:
code/branches/testing
Files:
3 edited
2 moved

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
  • code/branches/testing/src/CMakeLists.txt

    r9473 r9474  
    7878
    7979
    80 # When using Visual Studio we want to use the output directory as working
    81 # directory and we also want to specify where the external dlls
    82 # (lua, ogre, etc.) are. The problem hereby is that these information cannot
    83 # be specified in CMake because they are not stored in the actual project file.
    84 # This workaround will create a configured *.vcproj.user file that holds the
    85 # right values. When starting the solution for the first time,
    86 # these get written to the *vcproj.yourPCname.yourname.user
    8780IF(MSVC)
    8881  IF(CMAKE_CL_64)
     
    9083  ELSE()
    9184    SET(MSVC_PLATFORM "Win32")
    92   ENDIF()
    93   IF(MSVC10)
    94     CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox-main.vcxproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox-main.vcxproj.user")
    95   ELSE()
    96     STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?).*$" "\\1"
    97            VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}")
    98     CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox-main.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox-main.vcproj.user")
    9985  ENDIF()
    10086ENDIF(MSVC)
  • code/branches/testing/test/util/CMakeLists.txt

    r9221 r9474  
    1 ADD_EXECUTABLE(
     1ORXONOX_ADD_EXECUTABLE(
    22    util_test
    33    EXCLUDE_FROM_ALL
     4        NO_INSTALL
     5  LINK_LIBRARIES
     6    util
     7        gmock_orxonox
     8  SOURCE_FILES
    49    ${GMOCK_MAIN}
    510    ConvertTest.cc
     
    1520    VA_NARGSTest.cc
    1621)
    17 TARGET_LINK_LIBRARIES(util_test util gmock_orxonox)
    1822ADD_DEPENDENCIES(test util_test)
    1923
    2024ADD_TEST(util_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/util_test)
    21 
    22 #-----------------
    23 
    24 IF(MSVC)
    25   IF(CMAKE_CL_64)
    26     SET(MSVC_PLATFORM "x64")
    27   ELSE()
    28     SET(MSVC_PLATFORM "Win32")
    29   ENDIF()
    30   IF(MSVC10)
    31     CONFIGURE_FILE("../../src/orxonox-main.vcxproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/util_test.vcxproj.user")
    32   ELSE()
    33     STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?).*$" "\\1"
    34            VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}")
    35     CONFIGURE_FILE("../../src/orxonox-main.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/util_test.vcproj.user")
    36   ENDIF()
    37 ENDIF(MSVC)
Note: See TracChangeset for help on using the changeset viewer.