瀏覽代碼

ENH: fix install test with xcode, the xcode generator does not support library versioning yet

Bill Hoffman 21 年之前
父節點
當前提交
f50e904faf
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. 5 3
      Modules/Platform/Darwin.cmake
  2. 1 0
      Source/cmGlobalXCodeGenerator.cxx

+ 5 - 3
Modules/Platform/Darwin.cmake

@@ -12,9 +12,11 @@ IF("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
     "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress")
     "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -flat_namespace -undefined suppress")
 ENDIF("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
 ENDIF("${CMAKE_BACKWARDS_COMPATIBILITY}" MATCHES "^1\\.[0-6]$")
 
 
-# Enable shared library versioning.
-SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
-SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-install_name")
+IF(NOT XCODE)
+# Enable shar   ed library versioning.
+  SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
+  SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-install_name")
+ENDIF(NOT XCODE)
 
 
 # OSX does not really implement an rpath, but it does allow a path to
 # OSX does not really implement an rpath, but it does allow a path to
 # be specified in the soname field of a dylib.
 # be specified in the soname field of a dylib.

+ 1 - 0
Source/cmGlobalXCodeGenerator.cxx

@@ -42,6 +42,7 @@ void cmGlobalXCodeGenerator::EnableLanguage(std::vector<std::string>const&
                                             lang,
                                             lang,
                                             cmMakefile * mf)
                                             cmMakefile * mf)
 { 
 { 
+  mf->AddDefinition("XCODE","1");
   mf->AddDefinition("CMAKE_CFG_INTDIR",".");
   mf->AddDefinition("CMAKE_CFG_INTDIR",".");
   mf->AddDefinition("CMAKE_GENERATOR_CC", "gcc");
   mf->AddDefinition("CMAKE_GENERATOR_CC", "gcc");
   mf->AddDefinition("CMAKE_GENERATOR_CXX", "g++");
   mf->AddDefinition("CMAKE_GENERATOR_CXX", "g++");