diff options
-rw-r--r-- | CMakeCPack.cmake | 2 | ||||
-rw-r--r-- | Modules/CMakeMinGWFindMake.cmake | 4 | ||||
-rw-r--r-- | Modules/CPackWIX.cmake | 26 | ||||
-rw-r--r-- | Modules/SelectLibraryConfigurations.cmake | 74 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 141 | ||||
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.h | 6 | ||||
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 20 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmOrderDirectories.cxx | 22 | ||||
-rw-r--r-- | Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/CPackWiXGenerator/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/MacRuntimePath/A/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/MacRuntimePath/A/framework2.cpp | 8 | ||||
-rw-r--r-- | Tests/MacRuntimePath/A/framework2.h | 17 | ||||
-rw-r--r-- | Tests/MacRuntimePath/B/CMakeLists.txt | 3 |
17 files changed, 266 insertions, 82 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake index a27d000..2495c44 100644 --- a/CMakeCPack.cmake +++ b/CMakeCPack.cmake @@ -113,6 +113,8 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") include(Utilities/Release/Cygwin/CMakeLists.txt) endif() + set(CPACK_WIX_UPGRADE_GUID "8ffd1d72-b7f1-11e2-8ee5-00238bca4991") + # Set the options file that needs to be included inside CMakeCPackOptions.cmake set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake) configure_file("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in" diff --git a/Modules/CMakeMinGWFindMake.cmake b/Modules/CMakeMinGWFindMake.cmake index efba20a..d7298dc 100644 --- a/Modules/CMakeMinGWFindMake.cmake +++ b/Modules/CMakeMinGWFindMake.cmake @@ -14,7 +14,9 @@ find_program(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin" - c:/MinGW/bin /MinGW/bin) + c:/MinGW/bin /MinGW/bin + "[HKEY_CURRENT_USER\\Software\\CodeBlocks;Path]/MinGW/bin" + ) find_program(CMAKE_SH sh.exe ) if(CMAKE_SH) message(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n") diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake index 0c0a8f1..fce25f0 100644 --- a/Modules/CPackWIX.cmake +++ b/Modules/CPackWIX.cmake @@ -76,6 +76,32 @@ # This image must be 493 by 312 pixels. # ##end +# +##variable +# CPACK_WIX_PROGRAM_MENU_FOLDER - Start menu folder name for launcher. +# +# If this variable is not set, it will be initialized with CPACK_PACKAGE_NAME +# +##end +##variable +# CPACK_WIX_CULTURES - Language(s) of the installer +# +# Languages are compiled into the WixUI extension library. To use them, +# simply provide the name of the culture. If you specify more than one +# culture identifier in a comma or semicolon delimited list, the first one +# that is found will be used. You can find a list of supported languages at: +# http://wix.sourceforge.net/manual-wix3/WixUI_localization.htm +# +##end +##variable +# CPACK_WIX_TEMPLATE - Template file for WiX generation +# +# If this variable is set, the specified template will be used to generate the WiX wxs file. +# This should be used if further customization of the output is required. +# +# If this variable is not set, the default MSI template included with CMake will be used. +# +##end #============================================================================= # Copyright 2012 Kitware, Inc. diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake index 5bca064..297e1d3 100644 --- a/Modules/SelectLibraryConfigurations.cmake +++ b/Modules/SelectLibraryConfigurations.cmake @@ -3,16 +3,18 @@ # This macro takes a library base name as an argument, and will choose good # values for basename_LIBRARY, basename_LIBRARIES, basename_LIBRARY_DEBUG, and # basename_LIBRARY_RELEASE depending on what has been found and set. If only -# basename_LIBRARY_RELEASE is defined, basename_LIBRARY, basename_LIBRARY_DEBUG, -# and basename_LIBRARY_RELEASE will be set to the release value. If only -# basename_LIBRARY_DEBUG is defined, then basename_LIBRARY, -# basename_LIBRARY_DEBUG and basename_LIBRARY_RELEASE will take the debug value. +# basename_LIBRARY_RELEASE is defined, basename_LIBRARY will be set to the +# release value, and basename_LIBRARY_DEBUG will be set to +# basename_LIBRARY_DEBUG-NOTFOUND. If only basename_LIBRARY_DEBUG is defined, +# then basename_LIBRARY will take the debug value, and basename_LIBRARY_RELEASE +# will be set to basename_LIBRARY_RELEASE-NOTFOUND. # # If the generator supports configuration types, then basename_LIBRARY and # basename_LIBRARIES will be set with debug and optimized flags specifying the # library to be used for the given configuration. If no build type has been set # or the generator in use does not support configuration types, then -# basename_LIBRARY and basename_LIBRARIES will take only the release values. +# basename_LIBRARY and basename_LIBRARIES will take only the release value, or +# the debug value if the release one is not set. #============================================================================= # Copyright 2009 Will Dicharry <wdicharry@stellarscience.com> @@ -31,57 +33,41 @@ # This macro was adapted from the FindQt4 CMake module and is maintained by Will # Dicharry <wdicharry@stellarscience.com>. -# Utility macro to check if one variable exists while another doesn't, and set -# one that doesn't exist to the one that exists. -macro( _set_library_name basename GOOD BAD ) - if( ${basename}_LIBRARY_${GOOD} AND NOT ${basename}_LIBRARY_${BAD} ) - set( ${basename}_LIBRARY_${BAD} ${${basename}_LIBRARY_${GOOD}} ) - set( ${basename}_LIBRARY ${${basename}_LIBRARY_${GOOD}} ) - set( ${basename}_LIBRARIES ${${basename}_LIBRARY_${GOOD}} ) - endif() -endmacro() - macro( select_library_configurations basename ) - # if only the release version was found, set the debug to be the release - # version. - _set_library_name( ${basename} RELEASE DEBUG ) - # if only the debug version was found, set the release value to be the - # debug value. - _set_library_name( ${basename} DEBUG RELEASE ) - - # Set a default case, which will come into effect if - # -no build type is set and the generator only supports one build type - # at a time (i.e. CMAKE_CONFIGURATION_TYPES is false) - # -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are the same - # -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are both empty - set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) - set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} ) + if(NOT ${basename}_LIBRARY_RELEASE) + set(${basename}_LIBRARY_RELEASE "${basename}_LIBRARY_RELEASE-NOTFOUND" CACHE FILEPATH "Path to a library.") + endif() + if(NOT ${basename}_LIBRARY_DEBUG) + set(${basename}_LIBRARY_DEBUG "${basename}_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "Path to a library.") + endif() if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND - NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE ) + NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE AND + ( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) ) # if the generator supports configuration types or CMAKE_BUILD_TYPE # is set, then set optimized and debug options. - if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) - set( ${basename}_LIBRARY "" ) - foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE ) - list( APPEND ${basename}_LIBRARY optimized "${_libname}" ) - endforeach() - foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG ) - list( APPEND ${basename}_LIBRARY debug "${_libname}" ) - endforeach() - set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" ) - endif() + set( ${basename}_LIBRARY "" ) + foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE ) + list( APPEND ${basename}_LIBRARY optimized "${_libname}" ) + endforeach() + foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG ) + list( APPEND ${basename}_LIBRARY debug "${_libname}" ) + endforeach() + elseif( ${basename}_LIBRARY_RELEASE ) + set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) + elseif( ${basename}_LIBRARY_DEBUG ) + set( ${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG} ) + else() + set( ${basename}_LIBRARY "${basename}_LIBRARY-NOTFOUND") endif() - set( ${basename}_LIBRARY ${${basename}_LIBRARY} CACHE FILEPATH - "The ${basename} library" ) + set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" ) if( ${basename}_LIBRARY ) set( ${basename}_FOUND TRUE ) endif() - mark_as_advanced( ${basename}_LIBRARY - ${basename}_LIBRARY_RELEASE + mark_as_advanced( ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ) endmacro() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 3a519b0..2e6cd12 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -2,5 +2,5 @@ set(CMake_VERSION_MAJOR 2) set(CMake_VERSION_MINOR 8) set(CMake_VERSION_PATCH 11) -set(CMake_VERSION_TWEAK 20130719) +set(CMake_VERSION_TWEAK 20130722) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index e8b0ea9..cc9dec7 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -100,6 +100,11 @@ bool cmCPackWIXGenerator::RunLightCommand(const std::string& objectFiles) command << " -nologo"; command << " -out " << QuotePath(packageFileNames.at(0)); command << " -ext WixUIExtension"; + const char* const cultures = GetOption("CPACK_WIX_CULTURES"); + if(cultures) + { + command << " -cultures:" << cultures; + } command << " " << objectFiles; return RunWiXCommand(command.str()); @@ -224,6 +229,9 @@ bool cmCPackWIXGenerator::CreateWiXVariablesIncludeFile() CopyDefinition(includeFile, "CPACK_WIX_PRODUCT_ICON"); CopyDefinition(includeFile, "CPACK_WIX_UI_BANNER"); CopyDefinition(includeFile, "CPACK_WIX_UI_DIALOG"); + SetOptionIfNotSet("CPACK_WIX_PROGRAM_MENU_FOLDER", + GetOption("CPACK_PACKAGE_NAME")); + CopyDefinition(includeFile, "CPACK_WIX_PROGRAM_MENU_FOLDER"); return true; } @@ -339,25 +347,114 @@ bool cmCPackWIXGenerator::CreateWiXSourceFiles() featureDefinitions.BeginElement("FeatureRef"); featureDefinitions.AddAttribute("Id", "ProductFeature"); + const char *cpackPackageExecutables = GetOption("CPACK_PACKAGE_EXECUTABLES"); + std::vector<std::string> cpackPkgExecutables; + std::string regKey; + if ( cpackPackageExecutables ) + { + cmSystemTools::ExpandListArgument(cpackPackageExecutables, + cpackPkgExecutables); + if ( cpackPkgExecutables.size() % 2 != 0 ) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, + "CPACK_PACKAGE_EXECUTABLES should contain pairs of <executable> and " + "<icon name>." << std::endl); + cpackPkgExecutables.clear(); + } + + const char *cpackVendor = GetOption("CPACK_PACKAGE_VENDOR"); + const char *cpackPkgName = GetOption("CPACK_PACKAGE_NAME"); + if (!cpackVendor || !cpackPkgName) + { + cmCPackLogger(cmCPackLog::LOG_WARNING, "CPACK_PACKAGE_VENDOR and " + "CPACK_PACKAGE_NAME must be defined for shortcut creation" << std::endl); + cpackPkgExecutables.clear(); + } + else + { + regKey = std::string("Software/") + cpackVendor + "/" + cpackPkgName; + } + } + + std::vector<std::string> dirIdExecutables; AddDirectoryAndFileDefinitons( toplevel, "INSTALL_ROOT", directoryDefinitions, fileDefinitions, featureDefinitions, - directoryCounter, fileCounter); + directoryCounter, fileCounter, cpackPkgExecutables, dirIdExecutables); - featureDefinitions.EndElement(); - featureDefinitions.EndElement(); - fileDefinitions.EndElement(); + directoryDefinitions.EndElement(); + directoryDefinitions.EndElement(); - for(size_t i = 1; i < install_root.size(); ++i) + if (dirIdExecutables.size() > 0 && dirIdExecutables.size() % 3 == 0) { - directoryDefinitions.EndElement(); - } + fileDefinitions.BeginElement("DirectoryRef"); + fileDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER"); + fileDefinitions.BeginElement("Component"); + fileDefinitions.AddAttribute("Id", "SHORTCUT"); + fileDefinitions.AddAttribute("Guid", "*"); - directoryDefinitions.EndElement(); - directoryDefinitions.EndElement(); + std::vector<std::string>::iterator it; + for ( it = dirIdExecutables.begin() ; + it != dirIdExecutables.end(); + ++it) + { + std::string fileName = *it++; + std::string iconName = *it++; + std::string directoryId = *it; + + fileDefinitions.BeginElement("Shortcut"); + std::string shortcutName = fileName; // the iconName is mor likely to contain blanks early on + std::string::size_type const dotPos = shortcutName.find('.'); + if(std::string::npos == dotPos) + { shortcutName = shortcutName.substr(0, dotPos); } + fileDefinitions.AddAttribute("Id", "SHORTCUT_" + shortcutName); + fileDefinitions.AddAttribute("Name", iconName); + std::string target = "[" + directoryId + "]" + fileName; + fileDefinitions.AddAttribute("Target", target); + fileDefinitions.AddAttribute("WorkingDirectory", directoryId); + fileDefinitions.EndElement(); + } + fileDefinitions.BeginElement("Shortcut"); + fileDefinitions.AddAttribute("Id", "UNINSTALL"); + std::string pkgName = GetOption("CPACK_PACKAGE_NAME"); + fileDefinitions.AddAttribute("Name", "Uninstall " + pkgName); + fileDefinitions.AddAttribute("Description", "Uninstalls " + pkgName); + fileDefinitions.AddAttribute("Target", "[SystemFolder]msiexec.exe"); + fileDefinitions.AddAttribute("Arguments", "/x [ProductCode]"); + fileDefinitions.EndElement(); + fileDefinitions.BeginElement("RemoveFolder"); + fileDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER"); + fileDefinitions.AddAttribute("On", "uninstall"); + fileDefinitions.EndElement(); + fileDefinitions.BeginElement("RegistryValue"); + fileDefinitions.AddAttribute("Root", "HKCU"); + fileDefinitions.AddAttribute("Key", regKey); + fileDefinitions.AddAttribute("Name", "installed"); + fileDefinitions.AddAttribute("Type", "integer"); + fileDefinitions.AddAttribute("Value", "1"); + fileDefinitions.AddAttribute("KeyPath", "yes"); + + featureDefinitions.BeginElement("ComponentRef"); + featureDefinitions.AddAttribute("Id", "SHORTCUT"); + featureDefinitions.EndElement(); + directoryDefinitions.BeginElement("Directory"); + directoryDefinitions.AddAttribute("Id", "ProgramMenuFolder"); + directoryDefinitions.BeginElement("Directory"); + directoryDefinitions.AddAttribute("Id", "PROGRAM_MENU_FOLDER"); + const char *startMenuFolder = GetOption("CPACK_WIX_PROGRAM_MENU_FOLDER"); + directoryDefinitions.AddAttribute("Name", startMenuFolder); + } + + featureDefinitions.EndElement(); + featureDefinitions.EndElement(); + fileDefinitions.EndElement(); directoryDefinitions.EndElement(); std::string wixTemplate = FindTemplate("WIX.template.in"); + if(GetOption("CPACK_WIX_TEMPLATE") != 0) + { + wixTemplate = GetOption("CPACK_WIX_TEMPLATE"); + } if(wixTemplate.empty()) { cmCPackLogger(cmCPackLog::LOG_ERROR, @@ -435,7 +532,9 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( cmWIXSourceWriter& fileDefinitions, cmWIXSourceWriter& featureDefinitions, size_t& directoryCounter, - size_t& fileCounter) + size_t& fileCounter, + const std::vector<std::string>& pkgExecutables, + std::vector<std::string>& dirIdExecutables) { cmsys::Directory dir; dir.Load(topdir.c_str()); @@ -467,8 +566,9 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( fileDefinitions, featureDefinitions, directoryCounter, - fileCounter); - + fileCounter, + pkgExecutables, + dirIdExecutables); directoryDefinitions.EndElement(); } else @@ -499,6 +599,23 @@ void cmCPackWIXGenerator::AddDirectoryAndFileDefinitons( featureDefinitions.BeginElement("ComponentRef"); featureDefinitions.AddAttribute("Id", componentId); featureDefinitions.EndElement(); + + std::vector<std::string>::const_iterator it; + for (it = pkgExecutables.begin() ; + it != pkgExecutables.end() ; + ++it) + { + std::string execName = *it++; + std::string iconName = *it; + + if (cmSystemTools::LowerCase(fileName) == + cmSystemTools::LowerCase(execName) + ".exe") + { + dirIdExecutables.push_back(fileName); + dirIdExecutables.push_back(iconName); + dirIdExecutables.push_back(directoryId); + } + } } } } diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h index 0e95d70..aaccf9d 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.h +++ b/Source/CPack/WiX/cmCPackWIXGenerator.h @@ -83,7 +83,11 @@ private: cmWIXSourceWriter& fileDefinitions, cmWIXSourceWriter& featureDefinitions, size_t& directoryCounter, - size_t& fileCounter); + size_t& fileCounter, + const std::vector<std::string>& pkgExecutables, + std::vector<std::string>& dirIdExecutables + ); + bool RequireOption(const std::string& name, std::string& value) const; diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index ab9eb14..fb7b5b6 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1345,12 +1345,23 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item) return; } + std::string fw_path = this->SplitFramework.match(1); + std::string fw = this->SplitFramework.match(2); + std::string full_fw = fw_path; + full_fw += "/"; + full_fw += fw; + full_fw += ".framework"; + full_fw += "/"; + full_fw += fw; + // Add the directory portion to the framework search path. - this->AddFrameworkPath(this->SplitFramework.match(1)); + this->AddFrameworkPath(fw_path); + + // add runtime information + this->AddLibraryRuntimeInfo(full_fw); // Add the item using the -framework option. this->Items.push_back(Item("-framework", false)); - std::string fw = this->SplitFramework.match(2); fw = this->LocalGenerator->EscapeForShell(fw.c_str()); this->Items.push_back(Item(fw, false)); } @@ -1813,9 +1824,10 @@ cmComputeLinkInformation::AddLibraryRuntimeInfo(std::string const& fullPath) if(fullPath.find(".framework") != std::string::npos) { cmsys::RegularExpression splitFramework; - splitFramework.compile("^(.*)/(.*).framework/.*/(.*)$"); + splitFramework.compile("^(.*)/(.*).framework/(.*)$"); if(splitFramework.find(fullPath) && - (splitFramework.match(2) == splitFramework.match(3))) + (std::string::npos != + splitFramework.match(3).find(splitFramework.match(2)))) { is_shared_library = true; } diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 9596ebc..245883c 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -824,13 +824,19 @@ cmGlobalNinjaGenerator cmLocalNinjaGenerator *ng = static_cast<cmLocalNinjaGenerator *>(this->LocalGenerators[0]); + // for frameworks, we want the real name, not smple name + // frameworks always appear versioned, and the build.ninja + // will always attempt to manage symbolic links instead + // of letting cmOSXBundleGenerator do it. + bool realname = target->IsFrameworkOnApple(); + switch (target->GetType()) { case cmTarget::EXECUTABLE: case cmTarget::SHARED_LIBRARY: case cmTarget::STATIC_LIBRARY: case cmTarget::MODULE_LIBRARY: outputs.push_back(ng->ConvertToNinjaPath( - target->GetFullPath(configName).c_str())); + target->GetFullPath(configName, false, realname).c_str())); break; case cmTarget::OBJECT_LIBRARY: diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index fa7e396..57adeba 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -265,7 +265,8 @@ cmNinjaNormalTargetGenerator rspcontent); } - if (this->TargetNameOut != this->TargetNameReal) { + if (this->TargetNameOut != this->TargetNameReal && + !this->GetTarget()->IsFrameworkOnApple()) { std::string cmakeCommand = this->GetLocalGenerator()->ConvertToOutputFormat( this->GetMakefile()->GetRequiredDefinition("CMAKE_COMMAND"), @@ -599,7 +600,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() rspfile, commandLineLengthLimit); - if (targetOutput != targetOutputReal) { + if (targetOutput != targetOutputReal && + !this->GetTarget()->IsFrameworkOnApple()) { if (targetType == cmTarget::EXECUTABLE) { globalGenerator->WriteBuild(this->GetBuildFileStream(), "Create executable symlink " + targetOutput, diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 93885b2..0220825 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -40,9 +40,10 @@ public: if(file.rfind(".framework") != std::string::npos) { cmsys::RegularExpression splitFramework; - splitFramework.compile("^(.*)/(.*).framework/.*/(.*)$"); + splitFramework.compile("^(.*)/(.*).framework/(.*)$"); if(splitFramework.find(file) && - (splitFramework.match(2) == splitFramework.match(3))) + (std::string::npos != + splitFramework.match(3).find(splitFramework.match(2)))) { this->Directory = splitFramework.match(1); this->FileName = @@ -318,7 +319,6 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath, // Add the runtime library at most once. if(this->EmmittedConstraintSOName.insert(fullPath).second) { - std::string soname2 = soname ? soname : ""; // Implicit link directories need special handling. if(!this->ImplicitDirectories.empty()) { @@ -327,16 +327,12 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath, if(fullPath.rfind(".framework") != std::string::npos) { cmsys::RegularExpression splitFramework; - splitFramework.compile("^(.*)/(.*).framework/(.*)/(.*)$"); + splitFramework.compile("^(.*)/(.*).framework/(.*)$"); if(splitFramework.find(fullPath) && - (splitFramework.match(2) == splitFramework.match(4))) + (std::string::npos != + splitFramework.match(3).find(splitFramework.match(2)))) { dir = splitFramework.match(1); - soname2 = splitFramework.match(2); - soname2 += ".framework/"; - soname2 += splitFramework.match(3); - soname2 += "/"; - soname2 += splitFramework.match(4); } } @@ -344,16 +340,14 @@ void cmOrderDirectories::AddRuntimeLibrary(std::string const& fullPath, this->ImplicitDirectories.end()) { this->ImplicitDirEntries.push_back( - new cmOrderDirectoriesConstraintSOName(this, fullPath, - soname2.c_str())); + new cmOrderDirectoriesConstraintSOName(this, fullPath, soname)); return; } } // Construct the runtime information entry for this library. this->ConstraintEntries.push_back( - new cmOrderDirectoriesConstraintSOName(this, fullPath, - soname2.c_str())); + new cmOrderDirectoriesConstraintSOName(this, fullPath, soname)); } else { diff --git a/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt index 5bf0f8a..6d1628a 100644 --- a/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt +++ b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt @@ -29,7 +29,7 @@ if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug) endif () -check_slc(empty "") +check_slc(empty "empty_LIBRARY-NOTFOUND") set(OPTONLY_LIBRARY_RELEASE "opt") check_slc(OPTONLY "opt") diff --git a/Tests/CPackWiXGenerator/CMakeLists.txt b/Tests/CPackWiXGenerator/CMakeLists.txt index ce02f11..475e60d 100644 --- a/Tests/CPackWiXGenerator/CMakeLists.txt +++ b/Tests/CPackWiXGenerator/CMakeLists.txt @@ -35,6 +35,8 @@ set(CPACK_PACKAGE_VERSION_PATCH "0") set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example") set(CPACK_WIX_UPGRADE_GUID "BF20CE5E-7F7C-401D-8F7C-AB45E8D170E6") +set(CPACK_WIX_UNINSTALL "1") +set(CPACK_PACKAGE_EXECUTABLES "mylibapp; CPack Wix Test") include(CPack) diff --git a/Tests/MacRuntimePath/A/CMakeLists.txt b/Tests/MacRuntimePath/A/CMakeLists.txt index 6e6de42..5fc54f4 100644 --- a/Tests/MacRuntimePath/A/CMakeLists.txt +++ b/Tests/MacRuntimePath/A/CMakeLists.txt @@ -14,6 +14,10 @@ set_target_properties(shared2 PROPERTIES add_library(framework SHARED framework.cpp framework.h) set_target_properties(framework PROPERTIES MACOSX_RPATH 1 FRAMEWORK 1) +# another framework +add_library(framework2 SHARED framework2.cpp framework2.h) +set_target_properties(framework2 PROPERTIES MACOSX_RPATH 1 FRAMEWORK 1) + # executable to test a shared library dependency with install rpaths add_executable(test1 test1.cpp) target_link_libraries(test1 shared) @@ -60,4 +64,5 @@ export(TARGETS shared shared2 framework FILE "${CMAKE_CURRENT_BINARY_DIR}/exp.cm install(TARGETS shared EXPORT MyExport DESTINATION lib) install(TARGETS shared2 EXPORT MyExport DESTINATION lib2) install(TARGETS framework EXPORT MyExport DESTINATION lib-fw) +install(TARGETS framework2 EXPORT MyExport DESTINATION lib-fw2) install(EXPORT MyExport DESTINATION lib FILE exp.cmake) diff --git a/Tests/MacRuntimePath/A/framework2.cpp b/Tests/MacRuntimePath/A/framework2.cpp new file mode 100644 index 0000000..d3c2c45 --- /dev/null +++ b/Tests/MacRuntimePath/A/framework2.cpp @@ -0,0 +1,8 @@ + +#include "framework2.h" +#include "stdio.h" + +void framework2() +{ + printf("framework 2\n"); +} diff --git a/Tests/MacRuntimePath/A/framework2.h b/Tests/MacRuntimePath/A/framework2.h new file mode 100644 index 0000000..4576d12 --- /dev/null +++ b/Tests/MacRuntimePath/A/framework2.h @@ -0,0 +1,17 @@ + +#ifndef framework2_h +#define framework2_h + +#ifdef WIN32 +# ifdef framework2_EXPORTS +# define FRAMEWORK2_EXPORT __declspec(dllexport) +# else +# define FRAMEWORK2_EXPORT __declspec(dllimport) +# endif +#else +# define FRAMEWORK2_EXPORT +#endif + +void FRAMEWORK2_EXPORT framework2(); + +#endif diff --git a/Tests/MacRuntimePath/B/CMakeLists.txt b/Tests/MacRuntimePath/B/CMakeLists.txt index c361620..4317af6 100644 --- a/Tests/MacRuntimePath/B/CMakeLists.txt +++ b/Tests/MacRuntimePath/B/CMakeLists.txt @@ -9,7 +9,8 @@ add_executable(testb ${MacRuntimePath_B_SOURCE_DIR}/../A/test3.cpp) target_link_libraries(testb shared framework) # test link with rpath enabled library by filename -target_link_libraries(testb $<TARGET_LINKER_FILE:shared2> framework) +find_library(fw2 NAMES framework2 HINTS ${MacRuntimePath_B_BINARY_DIR}/../Root/lib-fw2) +target_link_libraries(testb $<TARGET_LINKER_FILE:shared2> ${fw2}) add_custom_target(testb_run ALL COMMAND testb |