Ticket #32302: patch-CMake_Templates_SDK_CMakeLists.txt.in.diff

File patch-CMake_Templates_SDK_CMakeLists.txt.in.diff, 2.1 KB (added by marin.saric@…, 13 years ago)
  • CMake/Templates/SDK_CMakeLists.txt.in

    old new  
    3636
    3737project(OGRE)
    3838
     39set(MACPORTS @MACPORTS@ CACHE BOOL "Build OGRE Samples for MacPorts")
     40set(MACPORTS_CMAKE_MODULE_PATH "@MACPORTS_CMAKE_MODULE_PATH@" CACHE STRING
     41  "The path to MacPorts user-installed CMake modules")
     42set(MACPORTS_CONFIGFILE_PATH "@CMAKE_INSTALL_PREFIX@/@OGRE_CFG_INSTALL_PATH@" CACHE STRING
     43  "The path to the MacPorts install of config files")
     44
    3945# Find actual Ogre root
    4046if (WIN32 OR APPLE)
    4147  get_filename_component(OGRE_ROOT_DIR "${OGRE_SOURCE_DIR}" ABSOLUTE)
    42   set(OGRE_TEMPLATES_DIR "${OGRE_ROOT_DIR}/cmake")
    43   set(OGRE_WORK_DIR "${OGRE_ROOT_DIR}")
    44   set(CMAKE_MODULE_PATH "${OGRE_ROOT_DIR}/cmake")
     48  if (NOT MACPORTS)
     49    set(OGRE_TEMPLATES_DIR "${OGRE_ROOT_DIR}/cmake")
     50    set(OGRE_WORK_DIR "${OGRE_ROOT_DIR}")
     51    set(CMAKE_MODULE_PATH "${OGRE_ROOT_DIR}/cmake")
     52  else()
     53    set(OGRE_TEMPLATES_DIR "@MACPORTS_CMAKE_TEMPLATES_DIR@")
     54    set(OGRE_WORK_DIR "${OGRE_ROOT_DIR}")
     55    list(APPEND CMAKE_MODULE_PATH ${MACPORTS_CMAKE_MODULE_PATH})
     56  endif()
    4557elseif (UNIX)
    4658  get_filename_component(OGRE_ROOT_DIR "${OGRE_SOURCE_DIR}/../.." ABSOLUTE)
    4759  set(OGRE_TEMPLATES_DIR "${OGRE_ROOT_DIR}/lib/OGRE/cmake")
     
    166178    include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/OGRE/iPhone")
    167179  else ()
    168180    # Set 10.5 as the base SDK by default
    169     set(XCODE_ATTRIBUTE_SDKROOT macosx)
    170     set(CMAKE_OSX_SYSROOT macosx)
     181    #set(XCODE_ATTRIBUTE_SDKROOT macosx)
     182    #set(CMAKE_OSX_SYSROOT macosx)
    171183    set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
    172     set(CMAKE_OSX_ARCHITECTURES $(ARCHS_STANDARD_32_64_BIT))
    173     include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/OGRE/OSX")
     184
     185    if (NOT CMAKE_OSX_ARCHITECTURES)
     186      if (ARCHS_STANDARD_32_64_BIT)
     187        set(CMAKE_OSX_ARCHITECTURES $(ARCHS_STANDARD_32_64_BIT))
     188      endif()
     189    endif()
     190
     191    if (NOT MACPORTS)
     192      include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/OGRE/OSX")
     193    else()
     194      include_directories("${OGRE_CONFIG_INCLUDE_DIR}/OSX")
     195    endif()
    174196  endif ()
    175197endif (APPLE)
    176198