From 79ae968a18ea58219df419a4add55f054889be31 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 12 Feb 2013 12:00:41 +0100 Subject: Revert "Add a way to exclude INTERFACE properties from exported targets." This reverts commit 2c3654c3de718fe822f8960063373774fc019494. The removal of some tests added in commit 77cecb77 (Add includes and compile definitions with target_link_libraries., 2012-11-05) are also squashed into this commit. --- Source/cmExportFileGenerator.cxx | 7 +++---- Source/cmFindPackageCommand.cxx | 21 ------------------- Tests/ExportImport/Import/CMakeLists.txt | 5 ----- .../Import/package_new_new/CMakeLists.txt | 23 --------------------- .../Import/package_new_old/CMakeLists.txt | 24 ---------------------- .../Import/package_old_old/CMakeLists.txt | 24 ---------------------- 6 files changed, 3 insertions(+), 101 deletions(-) delete mode 100644 Tests/ExportImport/Import/package_new_new/CMakeLists.txt delete mode 100644 Tests/ExportImport/Import/package_new_old/CMakeLists.txt delete mode 100644 Tests/ExportImport/Import/package_old_old/CMakeLists.txt diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index ee8436c..ef4ea38 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -264,16 +264,15 @@ void cmExportFileGenerator::GenerateInterfaceProperties(cmTarget *target, { if (!properties.empty()) { - os << "if(NOT ${CMAKE_FIND_PACKAGE_NAME}_NO_INTERFACES)\n"; std::string targetName = this->Namespace; targetName += target->GetName(); - os << " set_target_properties(" << targetName << " PROPERTIES\n"; + os << "set_target_properties(" << targetName << " PROPERTIES\n"; for(ImportPropertyMap::const_iterator pi = properties.begin(); pi != properties.end(); ++pi) { - os << " " << pi->first << " \"" << pi->second << "\"\n"; + os << " " << pi->first << " \"" << pi->second << "\"\n"; } - os << " )\nendif()\n\n"; + os << ")\n\n"; } } diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index e9b6ab6..470ceca 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -376,27 +376,6 @@ void cmFindPackageCommand::GenerateDocumentation() "The package configuration file may set _FOUND to false " "to tell find_package that component requirements are not satisfied." "\n" - "Targets exported by the install() command may have additional INTERFACE " - "properties set for include directories, compile definitions etc. As " - "these may create a backward compatibility concern for consumers of " - "existing projects, it is possible to set the _NO_INTERFACES " - "variable to disable populating those interfaces. It is possible to " - "emulate a version-based policy for whether the interfaces should be " - "enabled in the config file before including the imported targets file. " - "This allows consumers to decide when to enable the new interfaces when " - "upgrading. The upstream project is responsible for adding code similar " - "to this in the version which generates the INTERFACE content:\n" - " if(${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION VERSION_LESS 2.3\n" - " AND NOT ${CMAKE_FIND_PACKAGE_NAME}_INTERFACES)\n" - " set(${CMAKE_FIND_PACKAGE_NAME}_NO_INTERFACES 1)\n" - " endif()\n" - " include(\"${CMAKE_CURRENT_LIST_DIR}/Targets.cmake\")\n" - "\n" - "Downstream users may then choose to use the new interfaces by finding " - "the newer version of upstream. They can also choose to not use the new " - "interfaces by setting _INTERFACES to false before finding the " - "package.\n" - "\n" "See the cmake_policy() command documentation for discussion of the " "NO_POLICY_SCOPE option." ; diff --git a/Tests/ExportImport/Import/CMakeLists.txt b/Tests/ExportImport/Import/CMakeLists.txt index 237f8fa..3fc78a2 100644 --- a/Tests/ExportImport/Import/CMakeLists.txt +++ b/Tests/ExportImport/Import/CMakeLists.txt @@ -17,8 +17,3 @@ add_executable(imp_testTransExe1 imp_testTransExe1.c) target_link_libraries(imp_testTransExe1 imp_lib1) add_executable(imp_testTransExe1b imp_testTransExe1.c) target_link_libraries(imp_testTransExe1b imp_lib1b) - -# Test package INTERFACE controls -add_subdirectory(package_old_old) -add_subdirectory(package_new_old) -add_subdirectory(package_new_new) diff --git a/Tests/ExportImport/Import/package_new_new/CMakeLists.txt b/Tests/ExportImport/Import/package_new_new/CMakeLists.txt deleted file mode 100644 index 4e6f642..0000000 --- a/Tests/ExportImport/Import/package_new_new/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ - -cmake_minimum_required(VERSION 2.8) - -find_package(testLibRequired 2.5 REQUIRED) - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" - " -#include \"testSharedLibRequired.h\" -int main(int argc, char **argv) -{ - TestSharedLibRequired req; - return req.foo(); -} -" -) - -get_target_property(prop Req::testSharedLibRequired INTERFACE_INCLUDE_DIRECTORIES) -if (NOT prop) - message(SEND_ERROR "Interface of Req::testSharedLibRequired should not be empty") -endif() - -add_executable(new_new_test "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") -target_link_libraries(new_new_test Req::testSharedLibRequired) diff --git a/Tests/ExportImport/Import/package_new_old/CMakeLists.txt b/Tests/ExportImport/Import/package_new_old/CMakeLists.txt deleted file mode 100644 index e675d64..0000000 --- a/Tests/ExportImport/Import/package_new_old/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ - -cmake_minimum_required(VERSION 2.8) - -find_package(testLibRequired 2.5 REQUIRED) - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" - " -#include \"testSharedLibRequired.h\" -int main(int argc, char **argv) -{ - TestSharedLibRequired req; - return req.foo(); -} -" -) - -get_target_property(prop Req::testSharedLibRequired INTERFACE_INCLUDE_DIRECTORIES) -if ("${prop}" STREQUAL "") - message(SEND_ERROR "Interface of Req::testSharedLibRequired should not be empty") -endif() - -add_executable(new_old_test "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") -target_link_libraries(new_old_test Req::testSharedLibRequired) -include_directories(${testLibRequired_INCLUDE_DIRS}) diff --git a/Tests/ExportImport/Import/package_old_old/CMakeLists.txt b/Tests/ExportImport/Import/package_old_old/CMakeLists.txt deleted file mode 100644 index 3b27330..0000000 --- a/Tests/ExportImport/Import/package_old_old/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ - -cmake_minimum_required(VERSION 2.8) - -find_package(testLibRequired 2.1 REQUIRED) - -file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" - " -#include \"testSharedLibRequired.h\" -int main(int argc, char **argv) -{ - TestSharedLibRequired req; - return req.foo(); -} -" -) - -get_target_property(prop Req::testSharedLibRequired INTERFACE_INCLUDE_DIRECTORIES) -if (prop) - message(SEND_ERROR "Interface of Req::testSharedLibRequired should be empty, but is ${prop}") -endif() - -add_executable(old_old_test "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") -target_link_libraries(old_old_test Req::testSharedLibRequired) -include_directories(${testLibRequired_INCLUDE_DIRS}) -- cgit v0.12