Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid install java related targets if java sdk is not enabled. #2037

Merged
merged 1 commit into from
Sep 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 24 additions & 14 deletions analytical_engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ include(CheckCXXCompilerFlag)
include(CheckLibraryExists)
include(CheckCXXSourceRuns)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# include /usr/local/lib as cmake installed dependencies will be placed there by default
include_directories(SYSTEM /usr/local/include)

include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/proto)

Expand Down Expand Up @@ -375,20 +379,26 @@ add_custom_target(gsa_clformat
VERBATIM)

# Install GAE Java SDK
set(GAE_JAVA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/java/")
set(GAE_JAVA_RUNTIME_DIR "${GAE_JAVA_DIR}/grape-runtime/")
set(GAE_JAVA_RUNTIME_JAR "${GAE_JAVA_RUNTIME_DIR}/target/grape-runtime-${GRAPHSCOPE_ANALYTICAL_VERSION}-shaded.jar")
add_custom_command(
TARGET gs_proto
COMMAND mvn clean install -DskipTests --quiet
WORKING_DIRECTORY ${GAE_JAVA_DIR}
COMMENT "Building GAE-java..."
VERBATIM
)
install(FILES DESTINATION lib)
install(FILES "${GAE_JAVA_RUNTIME_DIR}/target/native/libgrape-jni.so" DESTINATION lib)
install(FILES "${GAE_JAVA_RUNTIME_JAR}" DESTINATION lib)
install(FILES "${GAE_JAVA_DIR}/grape_jvm_opts" DESTINATION conf)
if(ENABLE_JAVA_SDK)
set(GAE_JAVA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/java/")
set(GAE_JAVA_RUNTIME_DIR "${GAE_JAVA_DIR}/grape-runtime/")
set(GAE_JAVA_RUNTIME_JAR "${GAE_JAVA_RUNTIME_DIR}/target/grape-runtime-${GRAPHSCOPE_ANALYTICAL_VERSION}-shaded.jar")
add_custom_command(
OUTPUT "${GAE_JAVA_RUNTIME_DIR}/target/native/libgrape-jni.so"
COMMAND mvn clean install -DskipTests --quiet
DEPENDS gs_proto
WORKING_DIRECTORY ${GAE_JAVA_DIR}
COMMENT "Building GAE-java..."
VERBATIM
)
add_custom_target(grape_jni ALL
DEPENDS "${GAE_JAVA_RUNTIME_DIR}/target/native/libgrape-jni.so"
)
install(FILES DESTINATION lib)
install(FILES "${GAE_JAVA_RUNTIME_DIR}/target/native/libgrape-jni.so" DESTINATION lib)
install(FILES "${GAE_JAVA_RUNTIME_JAR}" DESTINATION lib)
install(FILES "${GAE_JAVA_DIR}/grape_jvm_opts" DESTINATION conf)
endif()

# Install binaries
macro(install_gsa_binary target)
Expand Down