CMakeLists.txt 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. ################################################################################
  2. # HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ################################################################################
  16. # Component: javaembed
  17. #####################################################
  18. # Description:
  19. # ------------
  20. # Cmake Input File for javaembed
  21. #####################################################
  22. project(javaembed)
  23. if(JAVAEMBED)
  24. ADD_PLUGIN(javaembed PACKAGES JNI OPTION MAKE_JAVAEMBED)
  25. if(MAKE_JAVAEMBED)
  26. set(
  27. SRCS
  28. javaembed.cpp)
  29. include_directories(
  30. ${JNI_INCLUDE_DIRS}
  31. ./../../system/include
  32. ./../../rtl/eclrtl
  33. ./../../rtl/include
  34. ./../../rtl/nbcd
  35. ./../../common/deftype
  36. ./../../system/jlib
  37. ./../../roxie/roxiemem
  38. ${HPCC_SOURCE_DIR}/esp/esdllib
  39. ${HPCC_SOURCE_DIR}/common/thorhelper
  40. ${CMAKE_BINARY_DIR}
  41. ${CMAKE_BINARY_DIR}/oss)
  42. add_definitions(-D_USRDLL -DJAVAEMBED_EXPORTS)
  43. HPCC_ADD_LIBRARY(javaembed SHARED ${SRCS})
  44. if(${CMAKE_VERSION} VERSION_LESS "2.8.9")
  45. message(WARNING "Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
  46. elseif(NOT APPLE)
  47. set_target_properties(javaembed PROPERTIES NO_SONAME 1)
  48. endif()
  49. install(
  50. TARGETS javaembed
  51. DESTINATION plugins)
  52. install(
  53. FILES ${CMAKE_CURRENT_SOURCE_DIR}/HpccUtils.class
  54. DESTINATION classes/com/HPCCSystems
  55. COMPONENT Runtime)
  56. # We link against jsig so that signals are chained from the jvm
  57. get_filename_component(JAVA_LIBRARY_PATH ${JAVA_AWT_LIBRARY} PATH)
  58. if(APPLE)
  59. set(JSIG_LIBRARY ${JAVA_LIBRARY_PATH}/libjsig.dylib)
  60. elseif(WIN32)
  61. set(JSIG_LIBRARY ${JAVA_LIBRARY_PATH}/jsig.dll)
  62. else()
  63. set(JSIG_LIBRARY ${JAVA_LIBRARY_PATH}/libjsig.so)
  64. endif()
  65. target_link_libraries(
  66. javaembed
  67. #${JSIG_LIBRARY}
  68. ${JAVA_JVM_LIBRARY}
  69. eclrtl
  70. roxiemem
  71. jlib)
  72. endif()
  73. endif()
  74. if(PLATFORM)
  75. install(
  76. FILES ${CMAKE_CURRENT_SOURCE_DIR}/java.ecllib
  77. DESTINATION plugins
  78. COMPONENT Runtime)
  79. endif()