visit-dav / visit

VisIt - Visualization and Data Analysis for Mesh-based Scientific Data
https://visit.llnl.gov
BSD 3-Clause "New" or "Revised" License
436 stars 114 forks source link

Investigate removal of export_library_depencencies #2152

Open aowen87 opened 5 years ago

aowen87 commented 5 years ago

With CMake 3.0 and above, we have to set CMake policy CP0033 to use old behavior, because we use export_library_dependencies. CMake's documentation on policy CMP0033: The export_library_dependencies() command should not be called. This command was added in January 2003 to export _LIB_DEPENDS internal CMake cache entries to a file for installation with a project. This was used at the time to allow transitive link dependencies to work for applications outside of the original build tree of a project. The functionality has been superseded by the export() and install(EXPORT) commands. CMake >= 3.0 prefer that this command never be called. The OLD behavior for this policy is to allow the command to be called. The NEW behavior for this policy is to issue a FATAL_ERROR when the command is called. This policy was introduced in CMake version 3.0. CMake version 3.0.2 warns when the policy is not set and uses OLD behavior. Use the cmake_policy command to set it to OLD or NEW explicitly. We should figure out how to NOT use export_library_dependencies, so we are more uptodate with current CMake practices.

-----------------------REDMINE MIGRATION----------------------- This ticket was migrated from Redmine. As such, not all information was able to be captured in the transition. Below is a complete record of the original redmine ticket.

Ticket number: 2146 Status: Pending Project: VisIt Tracker: Bug Priority: Normal Subject: Investigate removal of export_library_depencencies Assigned to: - Category: - Target version: - Author: Kathleen Biagas Start: 02/11/2015 Due date: % Done: 0% Estimated time: Created: 02/11/2015 05:59 pm Updated: 02/19/2015 08:02 pm Likelihood: 3 - Occasional Severity: 2 - Minor Irritation Found in version: trunk Impact: Expected Use: OS: All Support Group: Any Description: With CMake 3.0 and above, we have to set CMake policy CP0033 to use old behavior, because we use export_library_dependencies. CMake's documentation on policy CMP0033: The export_library_dependencies() command should not be called. This command was added in January 2003 to export _LIB_DEPENDS internal CMake cache entries to a file for installation with a project. This was used at the time to allow transitive link dependencies to work for applications outside of the original build tree of a project. The functionality has been superseded by the export() and install(EXPORT) commands. CMake >= 3.0 prefer that this command never be called. The OLD behavior for this policy is to allow the command to be called. The NEW behavior for this policy is to issue a FATAL_ERROR when the command is called. This policy was introduced in CMake version 3.0. CMake version 3.0.2 warns when the policy is not set and uses OLD behavior. Use the cmake_policy command to set it to OLD or NEW explicitly. We should figure out how to NOT use export_library_dependencies, so we are more uptodate with current CMake practices.

Comments:

cyrush commented 5 years ago

https://cmake.org/cmake/help/v3.0/policy/CMP0033.html

cyrush commented 5 years ago

To provide context where we use this, it helps us with the plugin-vs-install logic:

(From PluginVsInstallHelpers.cmake)

export_library_dependencies(${VISIT_BINARY_DIR}/include/VisItLibraryDependencies.cmake.in)

configure_file(${VISIT_SOURCE_DIR}/CMake/FilterDependencies.cmake.in
              ${VISIT_BINARY_DIR}/include/FilterDependencies.cmake
              @ONLY)
install(SCRIPT "${VISIT_BINARY_DIR}/include/FilterDependencies.cmake")

install(FILES 
        ${VISIT_BINARY_DIR}/include/VisItLibraryDependencies.cmake
        DESTINATION ${VISIT_INSTALLED_VERSION_INCLUDE}
        PERMISSIONS OWNER_READ OWNER_WRITE
                    GROUP_READ GROUP_WRITE
                    WORLD_READ
        )

Current version of cmake we are using warns us strongly that this will be removed in the future.