Changeset 3f62451


Ignore:
Timestamp:
Nov 24, 2016 1:11:11 PM (10 months ago)
Author:
www-data <www-data@…>
Branches:
master, feature_CIS, release_9.3, release_9.4, release_9.5
Children:
b37595b
Parents:
e37f3e5
git-author:
BangPH <b.phamhuu@…> (11/23/16 11:24:34)
git-committer:
www-data <www-data@…> (11/24/16 13:11:11)
Message:

ticket:1445 - Fix compilation in Java 7 Cmake

Summary: In this patch, build CMake for protobuf-gen-grpc-java directly without building grpc-java.

Test Plan: tested with cmake build

Reviewers: dmisev

Differential Revision: http://codereview.rasdaman.org/D269

Files:
1 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • .gitignore

    r12237d1 r3f62451  
    9393initpyramid
    9494config.h
     95config.h.in
    9596*~
    9697stamp-h1
  • CMakeLists.txt

    r57107c1 r3f62451  
    9595set(USE_HDF4 OFF CACHE BOOL "This feature enables the inclusion of HDF4 library during installation.")
    9696if (USE_HDF4)
    97     # Flag used in config.h
     97    # Flag used in config-cmake.h
    9898    set(HAVE_HDF ON)
    9999endif ()
     
    101101set(USE_NETCDF OFF CACHE BOOL "This feature enables the inclusion of netCDF library during installation.")
    102102if (USE_NETCDF)
    103     # Flag used in config.h
     103    # Flag used in config-cmake.h
    104104    set(HAVE_NETCDF ON)
    105105endif ()
     
    107107set(USE_GDAL ON CACHE BOOL "This feature enables the inclusion of GDAL library during installation.")
    108108if (USE_GDAL)
    109     # Flag used in config.h
     109    # Flag used in config-cmake.h
    110110    set(HAVE_GDAL ON)
    111111endif ()
     
    113113set(USE_GRIB OFF CACHE BOOL "This feature enables the inclusion of GRIB library during installation.")
    114114if (USE_GRIB)
    115     # Flag used in config.h
     115    # Flag used in config-cmake.h
    116116    set(HAVE_GRIB ON)
    117117endif ()
     
    162162if (${DEFAULT_BASEDB} STREQUAL sqlite)
    163163    find_package(Sqlite REQUIRED)
    164     # For config.h
     164    # For config-cmake.h
    165165    set(BASEDB_SQLITE 1)
    166166    set(BASEDBSTRING sqlite)
     
    198198    endif ()
    199199elseif (${DEFAULT_BASEDB} STREQUAL postgresql)
    200     # Used in config.h
     200    # Used in config-cmake.h
    201201    set(BASEDB_PGSQL 1)
    202202    set(BASEDBSTRING pgsql)
     
    327327GetVersionInformation(RMANVERSION GCCVERSION GCCTARGET)
    328328# Generate the configuration header files.
    329 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h")
     329configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config-cmake.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h")
    330330configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version.h.in" "${CMAKE_CURRENT_BINARY_DIR}/version.h")
    331331
  • third_party/CMakeLists.txt

    r240cfe5 r3f62451  
    189189    # TODO: Convert the Google Protobuf build process to use External Project once we give up Autotools
    190190
     191    set(THIRD_PARTY_DIR "${CMAKE_BINARY_DIR}/third_party")
    191192    # Google Protobuf is a third_party dependency of GRPC so we define the variables here.
    192193    set(GRPC_SOURCE_DIR "${CMAKE_SOURCE_DIR}/third_party/grpc")
     
    211212
    212213    add_custom_command(OUTPUT ${PROTOBUF_LIBRARY_PATH} ${PROTOBUF_PROTOC_EXECUTABLE_PATH}
    213             # Change the URL for gmock before invoking script to build protobuf                 
     214            # Change the URL for gmock before invoking script to build protobuf
    214215            COMMAND sed -i "s@${OLD_GMOCK_URL}@${NEW_GMOCK_URL}@g" autogen.sh
    215216            COMMAND ./autogen.sh
     
    291292
    292293    if (ENABLE_JAVA)
    293         set(GRPC_JAVA_SOURCE_DIR "${CMAKE_SOURCE_DIR}/third_party/grpc-java/compiler")
    294         set(GRPC_JAVA_BINARY_DIR "${CMAKE_BINARY_DIR}/third_party/bin/grpc-java/bin")
    295 
    296         file(MAKE_DIRECTORY ${GRPC_JAVA_BINARY_DIR})
    297 
    298         # Create an external project for Java GRPC that depends on the GRPC and Protobuf external projects
    299         ExternalProject_Add(grpc-java
    300                 DEPENDS google-protobuf
    301                 DOWNLOAD_COMMAND ""
    302                 SOURCE_DIR ${GRPC_JAVA_SOURCE_DIR}
    303                 CONFIGURE_COMMAND ""
    304                 BUILD_IN_SOURCE ON
    305                 BUILD_COMMAND ""
    306                 INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${GRPC_JAVA_SOURCE_DIR}/build/binaries/java_pluginExecutable/protoc-gen-grpc-java ${GRPC_JAVA_BINARY_DIR}/
    307                 LOG_BUILD ON
    308                 LOG_INSTALL ON)
    309 
    310         ExternalProject_Add_Step(grpc-java grpc-java-build
    311                 # GRPC-Java expects to find the include and library files for GRPC and Protobuf in the Path.
    312                 COMMAND export LIBRARY_PATH=${PROTOBUF_BINARY_DIR}/lib && export CPLUS_INCLUDE_PATH=${PROTOBUF_INCLUDE_DIR} && ../gradlew java_pluginExecutable
    313                 WORKING_DIRECTORY ${GRPC_JAVA_SOURCE_DIR}
    314                 DEPENDERS install
    315                 )
    316 
    317         # GRPC CPP Plugin
    318         set(GRPC_JAVA_PLUGIN_EXECUTABLE_PATH ${GRPC_JAVA_BINARY_DIR}/protoc-gen-grpc-java)
    319         set(GRPC_JAVA_PLUGIN_EXECUTABLE protoc-gen-grpc-java)
    320 
     294        # We just need to compile executable protoc-gen-grpc-java
     295        add_subdirectory("${CMAKE_SOURCE_DIR}/third_party/grpc-java")
     296
     297        # GRPC Java Plugin
     298        set(GRPC_JAVA_PLUGIN_EXECUTABLE_PATH ${THIRD_PARTY_DIR}/bin/grpc-java/protoc-gen-grpc-java)
     299        set(GRPC_JAVA_PLUGIN_EXECUTABLE protoc-gen-grpc-java-compiled)
     300
     301        # Import this executable protoc-gen-grpc-java to be used in rasj for generating java files
    321302        add_executable(${GRPC_JAVA_PLUGIN_EXECUTABLE} IMPORTED GLOBAL)
    322303        set_property(TARGET ${GRPC_JAVA_PLUGIN_EXECUTABLE} PROPERTY IMPORTED_LOCATION
    323                 ${GRPC_JAVA_PLUGIN_EXECUTABLE_PATH})
    324         add_dependencies(${GRPC_JAVA_PLUGIN_EXECUTABLE} grpc-java)
    325 
     304                    ${GRPC_JAVA_PLUGIN_EXECUTABLE_PATH})
    326305    endif (ENABLE_JAVA)
    327306
Note: See TracChangeset for help on using the changeset viewer.