Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3321

Thrift can't be added as a subdirectory of another CMake-based project

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.10.0
    • Build Process
    • Patch

    Description

      I wanted my CMake-based project to build thrift as a dependency, so I added the following to my CMakeLists.txt:

      set(BUILD_COMPILER OFF CACHE BOOL "")
      set(BUILD_TESTING OFF CACHE BOOL "")
      set(BUILD_EXAMPLES OFF CACHE BOOL "")
      set(BUILD_TUTORIALS OFF CACHE BOOL "")
      set(BUILD_LIBRARIES ON CACHE BOOL "")
      set(BUILD_C_GLIB OFF CACHE BOOL "")
      set(BUILD_JAVA OFF CACHE BOOL "")
      set(BUILD_PYTHON OFF CACHE BOOL "")
      add_subdirectory(thrift)
      

      The build process fails because build/cmake/CPackConfig.cmake fails to find README.md and LICENSE files. It fails to find them because it uses CMAKE_SOURCE_DIR instead of CMAKE_CURRENT_SOURCE_DIR. After changing CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR everything works as expected.

      Attachments

        1. fix_cpackconfig.patch
          0.8 kB
          Frane Šarić

        Activity

          fsaric Frane Šarić added a comment -

          A simple fix that fixes this issue.

          fsaric Frane Šarić added a comment - A simple fix that fixes this issue.
          roger Roger Meier added a comment -

          committed thanks

          roger Roger Meier added a comment - committed thanks
          hudson Hudson added a comment -

          SUCCESS: Integrated in Thrift #1668 (See https://builds.apache.org/job/Thrift/1668/)
          THRIFT-3321 Thrift can't be added as a subdirectory of another CMake-based project (roger: rev 0333dbf0b5fc975c9c8d2b8d9dd057e372b9846a)

          • build/cmake/CPackConfig.cmake
          hudson Hudson added a comment - SUCCESS: Integrated in Thrift #1668 (See https://builds.apache.org/job/Thrift/1668/ ) THRIFT-3321 Thrift can't be added as a subdirectory of another CMake-based project (roger: rev 0333dbf0b5fc975c9c8d2b8d9dd057e372b9846a) build/cmake/CPackConfig.cmake

          People

            roger Roger Meier
            fsaric Frane Šarić
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: