Re: [cmake-developers] [PATCH] Proposed fix for bug 15183

2016-01-30 Thread Gregor Jasny via cmake-developers
Hello,

On 13/01/16 12:13, Marko Kylmämaa wrote:
> I would like to propose the following fix for bug 15183 (
> https://cmake.org/Bug/view.php?id=15183)
> 
> For some reason the XcodeGenerator seemed to be setting the INSTALL_PATH
> variable regardless of if it was initialized or not (which is done only for
> shared libraries). This seems almost certainly undesirable so I've moved
> the code inside the shared library check.

Thank you for the patch. It improves the situation but does not fix it
completely. Nevertheless I will push it to -next as soon as unit test
are green locally.

The case where it does not work is the following:

> cmake_minimum_required(VERSION 3.4 FATAL_ERROR)
> 
> add_library(mystatic STATIC main.c)
> add_library(myshared SHARED main.c)

The myshared library has "@rpath" in the install dir attribute. I guess
the MACOSX_RPATH target property interferes here. I will have a look at
this but certainly the second part of the fix will miss the CMake 3.5
freeze.

Thanks,
Gregor
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


[cmake-developers] [PATCH] Proposed fix for bug 15183

2016-01-13 Thread Marko Kylmämaa
Hello,

I would like to propose the following fix for bug 15183 (
https://cmake.org/Bug/view.php?id=15183)

For some reason the XcodeGenerator seemed to be setting the INSTALL_PATH
variable regardless of if it was initialized or not (which is done only for
shared libraries). This seems almost certainly undesirable so I've moved
the code inside the shared library check.

The fix is based on v3.4.1 tag.

---
 Source/cmGlobalXCodeGenerator.cxx | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Source/cmGlobalXCodeGenerator.cxx
b/Source/cmGlobalXCodeGenerator.cxx
index 33babec..089bb47 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2329,10 +2329,10 @@ void
cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
 this->CreateString(format));
 }

-  // Create the INSTALL_PATH attribute.
-  std::string install_name_dir;
   if(target.GetType() == cmTarget::SHARED_LIBRARY)
 {
+ // Create the INSTALL_PATH attribute.
+ std::string install_name_dir;
 // Get the install_name directory for the build tree.
 install_name_dir = gtgt->GetInstallNameDirForBuildTree(configName);
 // Xcode doesn't create the correct install_name in some cases.
@@ -2356,9 +2356,9 @@ void
cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
   extraLinkOptions += " -install_name ";
   extraLinkOptions += XCodeEscapePath(install_name.c_str());
   }
+ buildSettings->AddAttribute("INSTALL_PATH",
+ this->CreateString(install_name_dir.c_str()));
 }
-  buildSettings->AddAttribute("INSTALL_PATH",
-
 this->CreateString(install_name_dir.c_str()));

   // Create the LD_RUNPATH_SEARCH_PATHS
   cmComputeLinkInformation* pcli = gtgt->GetLinkInformation(configName);
-- 
2.5.4 (Apple Git-61)



*Marko KylmamaaCTO*
*Reforged Studios* 
*Cell:* +1-949-872-9650
*Skype:* mkylmamaa
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers