CMakeLists.txt 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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: py2embed
  17. #####################################################
  18. # Description:
  19. # ------------
  20. # Cmake Input File for py2embed
  21. #####################################################
  22. set(debug_python OFF) # A lot slower but can assist in debugging...
  23. set(DEBUG_PYTHON_LIBRARY "/usr/lib/libpython2.7_d.so")
  24. project(py2embed)
  25. find_package(Python2 2.6 REQUIRED COMPONENTS Interpreter Development)
  26. set(
  27. SRCS
  28. pyembed.cpp)
  29. include_directories(
  30. "${Python2_INCLUDE_DIRS}"
  31. ./../../system/include
  32. ./../../rtl/eclrtl
  33. ./../../rtl/include
  34. ./../../rtl/nbcd
  35. ./../../common/deftype
  36. ./../../common/thorhelper
  37. ./../../dali/base
  38. ./../../system/mp
  39. ./../../roxie/roxiemem
  40. ./../../system/jlib)
  41. add_definitions(-D_USRDLL -DPY2EMBED_EXPORTS)
  42. if(debug_python)
  43. add_definitions(-DPy_DEBUG)
  44. endif()
  45. HPCC_ADD_LIBRARY(py2embed SHARED ${SRCS})
  46. if(${CMAKE_VERSION} VERSION_LESS "2.8.9")
  47. message(WARNING "Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
  48. elseif(NOT APPLE)
  49. set_target_properties(py2embed PROPERTIES NO_SONAME 1)
  50. endif()
  51. if (CONTAINERIZED)
  52. install(
  53. TARGETS py2embed
  54. DESTINATION plugins)
  55. else()
  56. install(
  57. TARGETS py2embed
  58. DESTINATION versioned/python2)
  59. endif()
  60. if(debug_python)
  61. target_link_libraries(py2embed ${DEBUG_PYTHON2_LIBRARY})
  62. else()
  63. target_link_libraries(py2embed ${Python2_LIBRARIES})
  64. endif()
  65. target_link_libraries(
  66. py2embed
  67. eclrtl
  68. roxiemem
  69. jlib)
  70. if ( PLATFORM )
  71. install ( PROGRAMS pyembed.install DESTINATION etc/init.d/install COMPONENT Runtime )
  72. install ( PROGRAMS pyembed.uninstall DESTINATION etc/init.d/uninstall COMPONENT Runtime )
  73. endif()
  74. if(PLATFORM OR CLIENTTOOLS_ONLY)
  75. install(
  76. FILES ${CMAKE_CURRENT_SOURCE_DIR}/python.ecllib
  77. DESTINATION plugins
  78. COMPONENT Runtime)
  79. endif()