|
@@ -27,44 +27,46 @@ set ( debug_python Off ) # A lot slower but can assist in debugging...
|
|
|
|
|
|
project( pyembed )
|
|
|
|
|
|
-ADD_PLUGIN(pyembed PACKAGES PythonLibs OPTION MAKE_PYEMBED MINVERSION 2.6 MAXVERSION 2.7)
|
|
|
+if (USE_PYTHON)
|
|
|
+ ADD_PLUGIN(pyembed PACKAGES PythonLibs OPTION MAKE_PYEMBED MINVERSION 2.6 MAXVERSION 2.7)
|
|
|
+ if ( MAKE_PYEMBED )
|
|
|
+ set ( SRCS
|
|
|
+ pyembed.cpp
|
|
|
+ )
|
|
|
|
|
|
-if ( MAKE_PYEMBED )
|
|
|
+ include_directories (
|
|
|
+ "${PYTHON_INCLUDE_DIR}"
|
|
|
+ ./../../system/include
|
|
|
+ ./../../rtl/eclrtl
|
|
|
+ ./../../rtl/include
|
|
|
+ ./../../common/deftype
|
|
|
+ ./../../system/jlib
|
|
|
+ )
|
|
|
|
|
|
- set ( SRCS
|
|
|
- pyembed.cpp
|
|
|
- )
|
|
|
+ ADD_DEFINITIONS( -D_USRDLL -DPYEMBED_EXPORTS )
|
|
|
+ if (debug_python)
|
|
|
+ ADD_DEFINITIONS(-DPy_DEBUG)
|
|
|
+ endif()
|
|
|
|
|
|
- include_directories (
|
|
|
- "${PYTHON_INCLUDE_DIR}"
|
|
|
- ./../../system/include
|
|
|
- ./../../rtl/eclrtl
|
|
|
- ./../../rtl/include
|
|
|
- ./../../common/deftype
|
|
|
- ./../../system/jlib
|
|
|
- )
|
|
|
+ HPCC_ADD_LIBRARY( pyembed SHARED ${SRCS} )
|
|
|
+ if (${CMAKE_VERSION} VERSION_LESS "2.8.9")
|
|
|
+ message("WARNING: Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
|
|
|
+ else()
|
|
|
+ set_target_properties( pyembed PROPERTIES NO_SONAME 1 )
|
|
|
+ endif()
|
|
|
|
|
|
- ADD_DEFINITIONS( -D_USRDLL -DPYEMBED_EXPORTS )
|
|
|
- if (debug_python)
|
|
|
- ADD_DEFINITIONS(-DPy_DEBUG)
|
|
|
- endif()
|
|
|
-
|
|
|
- HPCC_ADD_LIBRARY( pyembed SHARED ${SRCS} )
|
|
|
- if (${CMAKE_VERSION} VERSION_LESS "2.8.9")
|
|
|
- message("WARNING: Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
|
|
|
- else()
|
|
|
- set_target_properties( pyembed PROPERTIES NO_SONAME 1 )
|
|
|
- endif()
|
|
|
+ install ( TARGETS pyembed DESTINATION plugins )
|
|
|
+ if (debug_python)
|
|
|
+ target_link_libraries ( pyembed ${PYTHON_DEBUG_LIBRARY} )
|
|
|
+ else()
|
|
|
+ target_link_libraries ( pyembed ${PYTHON_LIBRARY} )
|
|
|
+ endif()
|
|
|
|
|
|
- install ( TARGETS pyembed DESTINATION plugins )
|
|
|
- if (debug_python)
|
|
|
- target_link_libraries ( pyembed ${PYTHON_DEBUG_LIBRARY} )
|
|
|
- else()
|
|
|
- target_link_libraries ( pyembed ${PYTHON_LIBRARY} )
|
|
|
+ target_link_libraries ( pyembed
|
|
|
+ eclrtl
|
|
|
+ jlib
|
|
|
+ )
|
|
|
endif()
|
|
|
-
|
|
|
- target_link_libraries ( pyembed
|
|
|
- eclrtl
|
|
|
- jlib
|
|
|
- )
|
|
|
endif()
|
|
|
+# Even if not making the Python plugin, we want to install the header
|
|
|
+install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/python.ecllib DESTINATION plugins COMPONENT Runtime)
|