Commit f8a042c7 authored by Shervin Nourbakhsh's avatar Shervin Nourbakhsh
Browse files

CMake and CPack for installation of cameo-console

parent 73cc9bd3
cmake_minimum_required(VERSION 3.18.0)
project(cameo-console-jzmq
VERSION 1.0.0
HOMEPAGE_URL "https://code.ill.fr/cameo/cameo"
)
include(GNUInstallDirs)
if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Relase)
endif()
# find the jar file produced by MAVEN
set(PROJECT_TARGET_DIR "${CMAKE_CURRENT_SOURCE_DIR}/target")
set(PROJECT_JAR ${PROJECT_TARGET_DIR}/${PROJECT_NAME}${JAVA_JZMQ}-${PROJECT_VERSION}-full.jar)
set(JAVA_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/java/cameo)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/installed/${JAVA_INSTALL_DIR})
add_custom_command(
OUTPUT ${PROJECT_JAR}
COMMAND mvn clean install
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM
)
add_custom_target(console
ALL
DEPENDS ${PROJECT_JAR}
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_JAR} ${CMAKE_CURRENT_BINARY_DIR}/installed/${JAVA_INSTALL_DIR}
)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/installed/${JAVA_INSTALL_DIR}/
DESTINATION ${JAVA_INSTALL_DIR}
COMPONENT console
)
#------------------------------------------------------------
# CPack
if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
include(${CMAKE_CURRENT_SOURCE_DIR}/../CPackConfigCommon.in)
include(${CMAKE_CURRENT_SOURCE_DIR}/CPackConfig.in)
include(CPack)
endif()
#------------------------------------------------------------
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE all)
set(CPACK_RPM_PACKAGE_ARCHITECTURE noarch)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "java9-sdk, cameo-server (>=1.0.2)")
set(CPACK_DEBIAN_PACKAGE_PROVIDES "cameo-console (=${PROJECT_VERSION})")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment