Browse Source

Merge pull request #8046 from Michael-Gardner/HPCC-14458

HPCC-14458 Moving plugins to own packages

Reviewed-By: Xiaoming Wang <xiaoming.wang@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 9 years ago
parent
commit
8e533045b4

+ 31 - 21
CMakeLists.txt

@@ -94,7 +94,7 @@ option(ENV_CONF_FILE "Set the environment conf file name.")
 option(LICENSE_FILE "Set the license file to use.")
 
 if(NOT LICENSE_FILE)
-    if(MAKE_R_ONLY)
+    if(REMBED)
         set(LICENSE_FILE "R-LICENSE.txt")
     else ()
         set(LICENSE_FILE "LICENSE.txt")
@@ -103,7 +103,7 @@ endif()
 
 include(${HPCC_SOURCE_DIR}/cmake_modules/optionDefaults.cmake)
 
-if ( MAKE_R_ONLY )
+if ( REMBED )
   # various components that are not needed if only making the R plugin
   SET(USE_LIBARCHIVE 0)
   SET(USE_APR 0)
@@ -111,13 +111,24 @@ endif()
 
 include(${HPCC_SOURCE_DIR}/cmake_modules/commonSetup.cmake)
 
-if ( MAKE_R_ONLY )
+if ( PLUGIN )
     HPCC_ADD_SUBDIRECTORY (roxie/roxiemem)
     HPCC_ADD_SUBDIRECTORY (rtl/nbcd)
     HPCC_ADD_SUBDIRECTORY (rtl/eclrtl)
     HPCC_ADD_SUBDIRECTORY (system/lzma)
     HPCC_ADD_SUBDIRECTORY (system/jlib)
-    HPCC_ADD_SUBDIRECTORY (plugins/Rembed)
+    HPCC_ADD_SUBDIRECTORY (dali/base)
+    HPCC_ADD_SUBDIRECTORY (common/workunit "CASSANDRAEMBED")
+    HPCC_ADD_SUBDIRECTORY (plugins/Rembed "REMBED")
+    HPCC_ADD_SUBDIRECTORY (plugins/v8embed "V8EMBED")
+    HPCC_ADD_SUBDIRECTORY (plugins/memcached "MEMCACHED")
+    HPCC_ADD_SUBDIRECTORY (plugins/pyembed "PYEMBED")
+    HPCC_ADD_SUBDIRECTORY (plugins/redis "REDISEMBED")
+    HPCC_ADD_SUBDIRECTORY (plugins/javaembed "JAVAEMBED")
+    HPCC_ADD_SUBDIRECTORY (plugins/kafka "KAFKAEMBED")
+    HPCC_ADD_SUBDIRECTORY (plugins/cassandra "CASSANDRAEMBED")
+    HPCC_ADD_SUBDIRECTORY (plugins/sqlite3 "SQLITE3EMBED")
+    HPCC_ADD_SUBDIRECTORY (plugins/mysql "MYSQLEMBED")
 elseif ( NOT MAKE_DOCS_ONLY )
     HPCC_ADD_SUBDIRECTORY (initfiles)
     HPCC_ADD_SUBDIRECTORY (tools)
@@ -157,9 +168,9 @@ if("${stagever}" MATCHES "^rc[0-9]+$")
 endif()
 
 if(TOP_LEVEL_PROJECT)
-    if(MAKE_R_ONLY)
-        set(CPACK_PACKAGE_NAME "hpccsystems-r-plugin")
-        set(PACKAGE_FILE_NAME_PREFIX "hpccsystems-r-plugin")
+    if(PLUGIN)
+        set(CPACK_PACKAGE_NAME "hpccsystems-${pluginname}-plugin")
+        set(PACKAGE_FILE_NAME_PREFIX "hpccsystems-${pluginname}-plugin")
     elseif(PLATFORM)
         set(CPACK_PACKAGE_NAME "hpccsystems-platform")
         set(PACKAGE_FILE_NAME_PREFIX "hpccsystems-platform-${projname}")
@@ -171,6 +182,7 @@ if(TOP_LEVEL_PROJECT)
     set(CPACK_PACKAGE_VERSION_MAJOR ${majorver})
     set(CPACK_PACKAGE_VERSION_MINOR ${minorver})
     set(CPACK_PACKAGE_VERSION_PATCH ${point}${VER_SEPARATOR}${stagever})
+    set(CPACK_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
     set(CPACK_PACKAGE_CONTACT "HPCCSystems <ossdevelopment@lexisnexis.com>")
     set(CPACK_SOURCE_GENERATOR TGZ)
 
@@ -210,15 +222,12 @@ if(TOP_LEVEL_PROJECT)
         message("-- Auto Detecting Packaging type")
         message("-- distro uses ${packageManagement}, revision is ${packageRevisionArch}")
 
-        if("${packageManagement}" STREQUAL "RPM" AND WITH_PLUGINS)
+        if("${packageManagement}" STREQUAL "RPM")
             set(CPACK_RPM_SPEC_MORE_DEFINE
 "%define _use_internal_dependency_generator 0
-%define __getdeps() while read file; do /usr/lib/rpm/rpmdeps -%{1} ${file}; done | /bin/sort -u
+%define __getdeps() while read file; do /usr/lib/rpm/rpmdeps -%{1} ${file} | %{__grep} -v libRInside.so | %{__grep} -v libRcpp.so ; done | /bin/sort -u
 %define __find_provides /bin/sh -c '%{__getdeps P}'
-%define __find_requires /bin/sh -c '%{__grep} -v libRembed.so | %{__getdeps R}'")
-            if(NOT MAKE_R_ONLY)
-                set(PACKAGE_FILE_NAME_PREFIX "${PACKAGE_FILE_NAME_PREFIX}-with-plugins")
-            endif()
+%define __find_requires /bin/sh -c '%{__getdeps R}'")
         endif()
 
         if("${packageManagement}" STREQUAL "DEB")
@@ -333,13 +342,13 @@ if(TOP_LEVEL_PROJECT)
         endif ()
     endif(UNIX)
 
-    if(MAKE_R_ONLY)
+    if(PLUGIN)
         if("${packageManagement}" STREQUAL "RPM")
             SET_DEPENDENCIES(CPACK_RPM_PACKAGE_REQUIRES "hpccsystems-platform = ${CPACK_RPM_PACKAGE_VERSION}")
         elseif("${packageManagement}" STREQUAL "DEB")
-            SET_DEPENDENCIES(CPACK_DEBIAN_PACKAGE_DEPENDS "hpccsystems-platform = ${CPACK_RPM_PACKAGE_VERSION}")
+            SET_DEPENDENCIES(CPACK_DEBIAN_PACKAGE_DEPENDS "hpccsystems-platform (= ${CPACK_PACKAGE_VERSION})")
         else()
-            message(WARNING "Dependencies not set")
+            message(WARNING "Plugin Static Dependencies not set")
         endif()
     else()
         if(EXISTS ${HPCC_SOURCE_DIR}/cmake_modules/dependencies/${packageRevision}.cmake)
@@ -354,9 +363,9 @@ if(TOP_LEVEL_PROJECT)
         set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
     endif(UNIX)
 
-    if(PLATFORM)
+    if(PLATFORM OR PLUGIN)
         set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PACKAGE_FILE_NAME_PREFIX}")
-    else(PLATFORM)
+    else()
         if(APPLE OR WIN32)
             set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_FILE_NAME_PREFIX}_${version}-${stagever}${CPACK_SYSTEM_NAME}")
         endif()
@@ -395,13 +404,14 @@ if(TOP_LEVEL_PROJECT)
             add_dependencies(SIGN PACKAGE)
             set_property(TARGET SIGN PROPERTY FOLDER "CMakePredefinedTargets")
         endif()
-    endif(PLATFORM)
+    endif(PLATFORM OR PLUGIN)
 endif(TOP_LEVEL_PROJECT)
 
 ###
 ## Below are the non-compile based install scripts required for
 ## the hpcc platform.
 ###
-
-install(FILES ${HPCC_SOURCE_DIR}/${LICENSE_FILE} DESTINATION "." COMPONENT Runtime)
+if(PLATFORM OR CLIENTTOOLS OR REMBED)
+    install(FILES ${HPCC_SOURCE_DIR}/${LICENSE_FILE} DESTINATION "." COMPONENT Runtime)
+endif()
 include(CPack)

+ 44 - 29
cmake_modules/commonSetup.cmake

@@ -46,6 +46,7 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
   option(PLATFORM "Enable the building/inclusion of a Platform component." ON)
   option(DEVEL "Enable the building/inclusion of a Development component." OFF)
   option(CLIENTTOOLS_ONLY "Enable the building of Client Tools only." OFF)
+  option(PLUGIN "Enable building of a plugin" OFF)
 
   if (APPLE OR WIN32)
     option(USE_BINUTILS "Enable use of binutils to embed workunit info into shared objects" OFF)
@@ -83,20 +84,17 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
   option(USE_SIGNED_CHAR "Build system with default char type is signed" OFF)
   option(USE_UNSIGNED_CHAR "Build system with default char type is unsigned" OFF)
 
-  option(MAKE_R_ONLY "Create a package with ONLY the R plugin" OFF)
-
-  option(WITH_PLUGINS "Enable the building of plugins" ON)
-  # WITH_PLUGINS = OFF will disable all of the following, else they can be set off on a case by case basis
-  option(USE_MYSQL "Enable MySQL support" ON)
-  option(USE_CASSANDRA "Enable Cassandra support" ON)
-  option(USE_SQLITE3 "Enable SqLite3 support" ON)
-  option(USE_PYTHON "Enable Python support" ON)
-  option(USE_V8 "Enable V8 JavaScript support" ON)
-  option(USE_JNI "Enable Java JNI support" ON)
-  option(USE_RINSIDE "Enable R support" ON)
-  option(USE_MEMCACHED "Enable Memcached support" ON)
-  option(USE_REDIS "Enable Redis support" ON)
-  option(USE_KAFKA "Enable Kafka support" ON)
+  # Plugin options
+  option(REMBED "Create a package with ONLY the R plugin" OFF)
+  option(V8EMBED "Create a package with ONLY the v8embed plugin" OFF)
+  option(MEMCACHED "Create a package with ONLY the memcached plugin" OFF)
+  option(PYEMBED "Create a package with ONLY the pyembed plugin" OFF)
+  option(REDISEMBED "Create a package with ONLY the redis plugin" OFF)
+  option(MYSQLEMBED "Create a package with ONLY the mysql plugin" OFF)
+  option(JAVAEMBED "Create a package with ONLY the javaembed plugin" OFF)
+  option(SQLITE3EMBED "Create a package with ONLY the sqlite3embed plugin" OFF)
+  option(CASSANDRAEMBED "Create a package with ONLY the cassandraembed plugin" OFF)
+  option(KAFKAEMBED "Create a package with ONLY the kafkaembed plugin" OFF)
 
   if (APPLE OR WIN32)
       option(USE_TBB "Enable Threading Building Block support" OFF)
@@ -106,18 +104,35 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
 
   option(USE_OPTIONAL "Automatically disable requested features with missing dependencies" ON)
 
-  if ( NOT WITH_PLUGINS )
-      set( USE_PYTHON OFF )
-      set( USE_V8 OFF )
-      set( USE_JNI OFF )
-      set( USE_RINSIDE OFF )
-      set( USE_SQLITE3 OFF )
-      set( USE_MYSQL OFF )
-      set( USE_CASSANDRA OFF )
-      set( USE_MEMCACHED OFF )
-      set( USE_REDIS OFF )
-      set( USE_KAFKA OFF )
-  endif()
+
+    if(REMBED OR V8EMBED OR MEMCACHED OR PYEMBED OR REDISEMBED OR JAVAEMBED OR MYSQLEMBED
+        OR SQLITE3EMBED OR CASSANDRAEMBED OR KAFKAEMBED)
+        set(PLUGIN ON)
+        set(CLIENTTOOLS OFF)
+        set(PLATFORM OFF)
+    endif()
+
+    if(REMBED)
+        set(pluginname "rembed")
+    elseif(V8EMBED)
+        set(pluginname "v8embed")
+    elseif(MEMCACHED)
+        set(pluginname "memcached")
+    elseif(PYEMBED)
+        set(pluginname "pyembed")
+    elseif(REDISEMBED)
+        set(pluginname "redisembed")
+    elseif(JAVAEMBED)
+        set(pluginname "javaembed")
+    elseif(MYSQLEMBED)
+        set(pluginname "mysqlembed")
+    elseif(SQLITE3EMBED)
+        set(pluginname "sqlite3embed")
+    elseif(CASSANDRAEMBED)
+        set(pluginname "cassandraembed")
+    elseif(KAFKAEMBED)
+        set(pluginname "kafkaembed")
+    endif()
 
   if ( USE_XALAN AND USE_LIBXSLT )
       set(USE_LIBXSLT OFF)
@@ -734,11 +749,11 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
   ###
   ## The following sets the install directories and names.
   ###
-  if ( PLATFORM )
+  if ( PLATFORM OR PLUGIN )
     set ( CMAKE_INSTALL_PREFIX "${PREFIX}/${DIR_NAME}" )
-  else ( PLATFORM )
+  else ( )
     set ( CMAKE_INSTALL_PREFIX "${PREFIX}/${DIR_NAME}/${version}/clienttools" )
-  endif ( PLATFORM )
+  endif ( PLATFORM OR PLUGIN )
   set (CMAKE_SKIP_BUILD_RPATH  FALSE)
   set (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
   set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_DIR}")

+ 15 - 11
common/workunit/CMakeLists.txt

@@ -62,14 +62,18 @@ HPCC_ADD_LIBRARY( workunit SHARED ${SRCS} )
 set_target_properties(workunit PROPERTIES 
     COMPILE_FLAGS -D_USRDLL
     DEFINE_SYMBOL WORKUNIT_EXPORTS )
-
-install ( TARGETS workunit RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
-target_link_libraries ( workunit 
-         jlib 
-         dalibase 
-         dllserver 
-         nbcd 
-         eclrtl 
-         deftype
-         environment
-    )
+if(NOT PLUGIN)
+    install(
+        TARGETS workunit
+        RUNTIME DESTINATION ${EXEC_DIR}
+        LIBRARY DESTINATION ${LIB_DIR})
+    target_link_libraries(
+        workunit 
+        jlib 
+        dalibase 
+        dllserver 
+        nbcd 
+        eclrtl 
+        deftype
+        environment)
+endif()

+ 12 - 8
dali/base/CMakeLists.txt

@@ -67,12 +67,16 @@ include_directories (
 ADD_DEFINITIONS( -DLOGMSGCOMPONENT=3 -D_USRDLL -DDALI_EXPORTS )
 
 HPCC_ADD_LIBRARY( dalibase SHARED ${SRCS} ${INCLUDES} )
-install ( TARGETS dalibase RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
-target_link_libraries ( dalibase 
-         jlib
-         mp 
-         hrpc 
-         remote 
-    )
-
 
+if(NOT PLUGIN)
+    install(
+        TARGETS dalibase
+        RUNTIME DESTINATION ${EXEC_DIR}
+        LIBRARY DESTINATION ${LIB_DIR})
+    target_link_libraries(
+        dalibase 
+        jlib
+        mp 
+        hrpc 
+        remote)
+endif()

+ 38 - 34
plugins/Rembed/CMakeLists.txt

@@ -11,7 +11,6 @@
 #    limitations under the License.
 ################################################################################
 
-
 # Component: Rembed
 
 #####################################################
@@ -23,40 +22,45 @@
 #    software such as the HPCC platform or client tools
 #####################################################
 
-project( Rembed )
-
-if (USE_RINSIDE AND MAKE_R_ONLY)
-  ADD_PLUGIN(Rembed PACKAGES R OPTION MAKE_REMBED)
-  if ( MAKE_REMBED )
-    set (    SRCS
-             Rembed.cpp
-        )
-
-    include_directories (
-             ${R_INCLUDE_DIRS}
-             ./../../system/include
-             ./../../rtl/eclrtl
-             ./../../rtl/include
-             ./../../rtl/nbcd
-             ./../../common/deftype
-             ./../../system/jlib
-        )
-
-    ADD_DEFINITIONS( -D_USRDLL -DREMBED_EXPORTS )
-    if (RCPP_LIBRARY STREQUAL "")
-      ADD_DEFINITIONS( -DRCPP_HEADER_ONLY )
-    endif()
+project(Rembed)
+
+if(REMBED)
+    ADD_PLUGIN(Rembed PACKAGES R OPTION MAKE_REMBED)
+    if(MAKE_REMBED)
+        set(
+            SRCS
+            Rembed.cpp)
+
+        include_directories(
+            ${R_INCLUDE_DIRS}
+            ./../../system/include
+            ./../../rtl/eclrtl
+            ./../../rtl/include
+            ./../../rtl/nbcd
+            ./../../common/deftype
+            ./../../system/jlib)
 
-    HPCC_ADD_LIBRARY( Rembed SHARED ${SRCS} )
-    install ( TARGETS Rembed DESTINATION plugins )
+        add_definitions(-D_USRDLL -DREMBED_EXPORTS)
+        if(RCPP_LIBRARY STREQUAL "")
+            add_definitions(-DRCPP_HEADER_ONLY)
+        endif()
 
-    target_link_libraries ( Rembed
-        ${R_LIBRARIES}
-        eclrtl
-        jlib
-        )
-  endif()
+        HPCC_ADD_LIBRARY(Rembed SHARED ${SRCS})
+        install(
+            TARGETS Rembed
+            DESTINATION plugins)
+
+        target_link_libraries(
+            Rembed
+            ${R_LIBRARIES}
+            eclrtl
+            jlib)
+    endif()
 endif()
 
-# Even if not making the R plugin, we want to install the header
-install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/R.ecllib DESTINATION plugins COMPONENT Runtime)
+if(PLATFORM)
+    install(
+        FILES ${CMAKE_CURRENT_SOURCE_DIR}/R.ecllib
+        DESTINATION plugins
+        COMPONENT Runtime)
+endif()

+ 114 - 101
plugins/cassandra/CMakeLists.txt

@@ -14,7 +14,6 @@
 #    limitations under the License.
 ################################################################################
 
-
 # Component: cassandraembed
 
 #####################################################
@@ -23,109 +22,123 @@
 #    Cmake Input File for cassandraembed
 #####################################################
 
-
-project( cassandraembed )
-
-if (USE_CASSANDRA)
-  # There is not yet a standard package for cassandra cpp client, and only very modern distros have libuv-dev
-  # When there is (and the distros catch up) we may want to add them as dependencies here
-  ADD_PLUGIN(cassandraembed PACKAGES OPTION MAKE_CASSANDRAEMBED)
-  if ( MAKE_CASSANDRAEMBED )
-
-    # until then, we build the required libraries from source
-
-    # Build libuv, required by the cassandra driver but not available on all distros
-    if (APPLE)
-      add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/libuv.dylib
-                         COMMAND make builddir_name=${PROJECT_BINARY_DIR}
-                         WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/libuv)
-      add_custom_target ( libuv ALL DEPENDS ${PROJECT_BINARY_DIR}/libuv.dylib )
-      set(LIBUV_LIBRARY ${PROJECT_BINARY_DIR}/libuv.dylib)
-    else()
-      add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/libuv.so
-                         COMMAND make builddir_name=${PROJECT_BINARY_DIR}
-                         COMMAND mv ${PROJECT_BINARY_DIR}/libuv.so ${PROJECT_BINARY_DIR}/libuv.so.0.10
-                         COMMAND ln -s ${PROJECT_BINARY_DIR}/libuv.so.0.10 ${PROJECT_BINARY_DIR}/libuv.so
-                         WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/libuv)
-      add_custom_target ( libuv ALL DEPENDS ${PROJECT_BINARY_DIR}/libuv.so )
-      set(LIBUV_LIBRARY ${PROJECT_BINARY_DIR}/libuv.so)
-    endif()
-    set(LIBUV_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/libuv/include/)
-
-    # Build the Cassandra cpp driver, only presently available as source
-    if( NOT EXISTS "${PROJECT_SOURCE_DIR}/cpp-driver/CMakeLists.txt" )
-     message( FATAL_ERROR
+project(cassandraembed)
+
+if(CASSANDRAEMBED)
+    # There is not yet a standard package for cassandra cpp client, and only very modern distros have libuv-dev
+    # When there is (and the distros catch up) we may want to add them as dependencies here
+    ADD_PLUGIN(cassandraembed PACKAGES OPTION MAKE_CASSANDRAEMBED)
+    if(MAKE_CASSANDRAEMBED)
+
+        # until then, we build the required libraries from source
+        # Build libuv, required by the cassandra driver but not available on all distros
+        if(APPLE)
+            add_custom_command(
+                OUTPUT ${PROJECT_BINARY_DIR}/libuv.dylib
+                COMMAND make builddir_name=${PROJECT_BINARY_DIR}
+                WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/libuv)
+            add_custom_target(
+                libuv ALL
+                DEPENDS ${PROJECT_BINARY_DIR}/libuv.dylib)
+            set(LIBUV_LIBRARY ${PROJECT_BINARY_DIR}/libuv.dylib)
+        else()
+            add_custom_command(
+                OUTPUT ${PROJECT_BINARY_DIR}/libuv.so
+                COMMAND make builddir_name=${PROJECT_BINARY_DIR}
+                COMMAND mv ${PROJECT_BINARY_DIR}/libuv.so ${PROJECT_BINARY_DIR}/libuv.so.0.10
+                COMMAND ln -s ${PROJECT_BINARY_DIR}/libuv.so.0.10 ${PROJECT_BINARY_DIR}/libuv.so
+                WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/libuv)
+            add_custom_target(
+                libuv ALL
+                DEPENDS ${PROJECT_BINARY_DIR}/libuv.so)
+            set(LIBUV_LIBRARY ${PROJECT_BINARY_DIR}/libuv.so)
+        endif()
+        set(LIBUV_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/libuv/include/)
+
+        # Build the Cassandra cpp driver, only presently available as source
+        if(NOT EXISTS "${PROJECT_SOURCE_DIR}/cpp-driver/CMakeLists.txt")
+            message(FATAL_ERROR
 "   The cpp-driver submodule is not available.
    This normally indicates that the git submodule has not been fetched.
    Please run git submodule update --init --recursive")
+        endif()
+
+        option(CASS_INSTALL_HEADER "Install header file" OFF)
+        option(CASS_BUILD_STATIC "Build static library" OFF)
+        option(CASS_BUILD_EXAMPLES "Build examples" OFF)
+        set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
+        set(_SAVE_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+        if(NOT WIN32)
+            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format-nonliteral") # Work around cassandra build error
+        endif()
+        add_subdirectory(cpp-driver ${PROJECT_BINARY_DIR}/cassandra)
+        add_dependencies(cassandra libuv)
+        set(CMAKE_CXX_FLAGS "${_SAVE_CMAKE_CXX_FLAGS}")
+
+        set(
+            SRCS
+            cassandraembed.cpp
+            cassandrawu.cpp)
+
+        include_directories(
+            ./../../system/include
+            ./../../rtl/eclrtl
+            ./../../roxie/roxiemem
+            ./../../rtl/include
+            ./../../rtl/nbcd
+            ./../../common/deftype
+            ./../../common/workunit
+            ./../../system/jlib
+            ./../../system/security/shared 
+            ./../../system/mp
+            ./../../dali/base 
+            ./cpp-driver/include)
+
+        add_definitions(-D_USRDLL -DCASSANDRAEMBED_EXPORTS)
+
+        HPCC_ADD_LIBRARY(cassandraembed SHARED ${SRCS})
+        if(NOT FORCE_WORKUNITS_TO_CASSANDRA)
+            if(${CMAKE_VERSION} VERSION_LESS "2.8.9")
+                message(WARNING "Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
+            elseif(NOT APPLE)
+                set_target_properties(cassandraembed PROPERTIES NO_SONAME 1)
+            endif()
+        endif()
+
+        install(
+            TARGETS cassandraembed
+            DESTINATION plugins
+            COMPONENT Runtime )
+        # until such time as the cassandra cpp driver and libuv are available as standard in all distros we want to support,
+        # include them in our rpm
+        # Note that the cassandra driver CMake file already includes the relevant install commands
+
+        if(APPLE)
+            install(
+                FILES ${PROJECT_BINARY_DIR}/libuv.dylib
+                DESTINATION ${LIB_DIR}
+                COMPONENT Runtime)
+        else()
+            install(
+                FILES ${PROJECT_BINARY_DIR}/libuv.so.0.10
+                DESTINATION ${LIB_DIR}
+                COMPONENT Runtime)
+        endif()
+
+        target_link_libraries(
+            cassandraembed
+            cassandra
+            eclrtl
+            roxiemem
+            dalibase
+            workunit
+            jlib)
     endif()
-
-    option(CASS_INSTALL_HEADER "Install header file" OFF)
-    option(CASS_BUILD_STATIC "Build static library" OFF)
-    option(CASS_BUILD_EXAMPLES "Build examples" OFF)
-    set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
-    SET (_SAVE_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-    if (NOT WIN32)
-       SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format-nonliteral") # Work around cassandra build error
-    endif()
-    add_subdirectory (cpp-driver ${PROJECT_BINARY_DIR}/cassandra)
-    add_dependencies( cassandra libuv )
-    SET (CMAKE_CXX_FLAGS "${_SAVE_CMAKE_CXX_FLAGS}")
-
-    set ( SRCS
-      cassandraembed.cpp
-      cassandrawu.cpp
-    )
-
-    include_directories (
-         ./../../system/include
-         ./../../rtl/eclrtl
-         ./../../roxie/roxiemem
-         ./../../rtl/include
-         ./../../rtl/nbcd
-         ./../../common/deftype
-         ./../../common/workunit
-         ./../../system/jlib
-         ./../../system/security/shared 
-         ./../../system/mp
-    
-         ./../../dali/base 
-
-         ./cpp-driver/include
-       )
-
-    ADD_DEFINITIONS( -D_USRDLL -DCASSANDRAEMBED_EXPORTS)
-
-    HPCC_ADD_LIBRARY( cassandraembed SHARED ${SRCS} )
-    if ( NOT FORCE_WORKUNITS_TO_CASSANDRA )
-      if (${CMAKE_VERSION} VERSION_LESS "2.8.9")
-        message("WARNING: Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
-      elseif(NOT APPLE)
-        set_target_properties( cassandraembed PROPERTIES NO_SONAME 1 )
-      endif()
-    endif()
-
-    install ( TARGETS cassandraembed DESTINATION plugins COMPONENT Runtime )
-    # until such time as the cassandra cpp driver and libuv are available as standard in all distros we want to support,
-    # include them in our rpm
-    # Note that the cassandra driver CMake file already includes the relevant install commands
-
-    if (APPLE)
-      install ( FILES ${PROJECT_BINARY_DIR}/libuv.dylib DESTINATION ${LIB_DIR} COMPONENT Runtime )
-    else()
-      install ( FILES ${PROJECT_BINARY_DIR}/libuv.so.0.10 DESTINATION ${LIB_DIR} COMPONENT Runtime )
-    endif()
-
-    target_link_libraries ( cassandraembed
-        cassandra
-        eclrtl
-        roxiemem
-        dalibase
-        workunit
-        jlib
-        )
-  endif()
 endif()
 
-# Even if not making the Cassandra plugin, we want to install the header
-install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/cassandra.ecllib DESTINATION plugins COMPONENT Runtime)
+if(PLATFORM)
+    install(
+        FILES ${CMAKE_CURRENT_SOURCE_DIR}/cassandra.ecllib
+        DESTINATION plugins
+        COMPONENT Runtime)
+endif()

+ 57 - 49
plugins/javaembed/CMakeLists.txt

@@ -23,61 +23,69 @@
 #    Cmake Input File for javaembed
 #####################################################
 
-project( javaembed )
+project(javaembed)
 
-if (USE_JNI)
-  ADD_PLUGIN(javaembed PACKAGES JNI OPTION MAKE_JAVAEMBED)
-  if ( MAKE_JAVAEMBED )
-    set (    SRCS
-             javaembed.cpp
-        )
+if(JAVAEMBED)
+    ADD_PLUGIN(javaembed PACKAGES JNI OPTION MAKE_JAVAEMBED)
+    if(MAKE_JAVAEMBED)
+        set(
+            SRCS
+            javaembed.cpp)
 
-    include_directories (
-             ${JNI_INCLUDE_DIRS}
-             ./../../system/include
-             ./../../rtl/eclrtl
-             ./../../rtl/include
-             ./../../rtl/nbcd
-             ./../../common/deftype
-             ./../../system/jlib
-             ./../../roxie/roxiemem
-             ${HPCC_SOURCE_DIR}/esp/esdllib
-             ${HPCC_SOURCE_DIR}/common/thorhelper
-             ${CMAKE_BINARY_DIR}
-             ${CMAKE_BINARY_DIR}/oss
-        )
+        include_directories(
+            ${JNI_INCLUDE_DIRS}
+            ./../../system/include
+            ./../../rtl/eclrtl
+            ./../../rtl/include
+            ./../../rtl/nbcd
+            ./../../common/deftype
+            ./../../system/jlib
+            ./../../roxie/roxiemem
+            ${HPCC_SOURCE_DIR}/esp/esdllib
+            ${HPCC_SOURCE_DIR}/common/thorhelper
+            ${CMAKE_BINARY_DIR}
+            ${CMAKE_BINARY_DIR}/oss)
 
-    ADD_DEFINITIONS( -D_USRDLL -DJAVAEMBED_EXPORTS )
+        add_definitions(-D_USRDLL -DJAVAEMBED_EXPORTS)
 
-    HPCC_ADD_LIBRARY( javaembed SHARED ${SRCS} )
-    if (${CMAKE_VERSION} VERSION_LESS "2.8.9")
-      message("WARNING: Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
-    elseif(NOT APPLE)
-      set_target_properties( javaembed PROPERTIES NO_SONAME 1 )
-    endif()
+        HPCC_ADD_LIBRARY(javaembed SHARED ${SRCS})
+        if(${CMAKE_VERSION} VERSION_LESS "2.8.9")
+            message(WARNING "Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
+        elseif(NOT APPLE)
+            set_target_properties(javaembed PROPERTIES NO_SONAME 1)
+        endif()
 
-    install ( TARGETS javaembed DESTINATION plugins )
-    install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/HpccUtils.class DESTINATION classes/com/HPCCSystems COMPONENT Runtime)
+        install(
+            TARGETS javaembed
+            DESTINATION plugins)
+        install(
+            FILES ${CMAKE_CURRENT_SOURCE_DIR}/HpccUtils.class
+            DESTINATION classes/com/HPCCSystems
+            COMPONENT Runtime)
 
-    # We link against jsig so that signals are chained from the jvm
+        # We link against jsig so that signals are chained from the jvm
 
-    get_filename_component(JAVA_LIBRARY_PATH ${JAVA_AWT_LIBRARY} PATH)
-    if (APPLE)
-        set(JSIG_LIBRARY ${JAVA_LIBRARY_PATH}/libjsig.dylib)
-    elseif (WIN32)
-        set(JSIG_LIBRARY ${JAVA_LIBRARY_PATH}/jsig.dll)
-    else()
-        set(JSIG_LIBRARY ${JAVA_LIBRARY_PATH}/libjsig.so)
-    endif()
+        get_filename_component(JAVA_LIBRARY_PATH ${JAVA_AWT_LIBRARY} PATH)
+        if(APPLE)
+            set(JSIG_LIBRARY ${JAVA_LIBRARY_PATH}/libjsig.dylib)
+        elseif(WIN32)
+            set(JSIG_LIBRARY ${JAVA_LIBRARY_PATH}/jsig.dll)
+        else()
+            set(JSIG_LIBRARY ${JAVA_LIBRARY_PATH}/libjsig.so)
+        endif()
 
-    target_link_libraries ( javaembed
-    #    ${JSIG_LIBRARY}
-        ${JAVA_JVM_LIBRARY}
-        eclrtl
-        roxiemem
-        jlib
-        )
-  endif()
+        target_link_libraries(
+            javaembed
+            #${JSIG_LIBRARY}
+            ${JAVA_JVM_LIBRARY}
+            eclrtl
+            roxiemem
+            jlib)
+    endif()
+endif()
+if(PLATFORM)
+    install(
+        FILES ${CMAKE_CURRENT_SOURCE_DIR}/java.ecllib
+        DESTINATION plugins
+        COMPONENT Runtime)
 endif()
-# Even if not making the Java plugin, we want to install the header
-install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/java.ecllib DESTINATION plugins COMPONENT Runtime)

+ 71 - 73
plugins/kafka/CMakeLists.txt

@@ -22,35 +22,33 @@
 #    Cmake Input File for kafka
 #####################################################
 
-project( kafka )
-
-if (USE_KAFKA)
+project(kafka)
 
+if(KAFKAEMBED)
     ADD_PLUGIN(kafka PACKAGES OPTION MAKE_KAFKA)
-
-    if ( MAKE_KAFKA )
+    if(MAKE_KAFKA)
 
         # librdkafka packages do not include everything we need to properly
         # build against it; until/if they are ever fixed we will need to build
         # our own version of librdkafka from source and include it ourselves
 
-        if( NOT EXISTS "${PROJECT_SOURCE_DIR}/librdkafka/configure" )
-            message( FATAL_ERROR
+        if(NOT EXISTS "${PROJECT_SOURCE_DIR}/librdkafka/configure")
+            message(FATAL_ERROR
 "   The librdkafka submodule is not available.
    This normally indicates that the git submodule has not been fetched.
    Please run git submodule update --init --recursive")
         endif()
 
-        if (APPLE)
-            set ( LIBRDKAFKA_LIB ${PROJECT_BINARY_DIR}/lib/librdkafka.dylib )
-            set ( LIBRDKAFKA_LIB_REAL ${PROJECT_BINARY_DIR}/lib/librdkafka.1.dylib )
-            set ( LIBRDKAFKACPP_LIB ${PROJECT_BINARY_DIR}/lib/librdkafka++.dylib )
-            set ( LIBRDKAFKACPP_LIB_REAL ${PROJECT_BINARY_DIR}/lib/librdkafka++.1.dylib )
+        if(APPLE)
+            set(LIBRDKAFKA_LIB ${PROJECT_BINARY_DIR}/lib/librdkafka.dylib)
+            set(LIBRDKAFKA_LIB_REAL ${PROJECT_BINARY_DIR}/lib/librdkafka.1.dylib)
+            set(LIBRDKAFKACPP_LIB ${PROJECT_BINARY_DIR}/lib/librdkafka++.dylib)
+            set(LIBRDKAFKACPP_LIB_REAL ${PROJECT_BINARY_DIR}/lib/librdkafka++.1.dylib)
         else()
-            set ( LIBRDKAFKA_LIB ${PROJECT_BINARY_DIR}/lib/librdkafka.so )
-            set ( LIBRDKAFKA_LIB_REAL ${PROJECT_BINARY_DIR}/lib/librdkafka.so.1 )
-            set ( LIBRDKAFKACPP_LIB ${PROJECT_BINARY_DIR}/lib/librdkafka++.so )
-            set ( LIBRDKAFKACPP_LIB_REAL ${PROJECT_BINARY_DIR}/lib/librdkafka++.so.1 )
+            set(LIBRDKAFKA_LIB ${PROJECT_BINARY_DIR}/lib/librdkafka.so)
+            set(LIBRDKAFKA_LIB_REAL ${PROJECT_BINARY_DIR}/lib/librdkafka.so.1)
+            set(LIBRDKAFKACPP_LIB ${PROJECT_BINARY_DIR}/lib/librdkafka++.so)
+            set(LIBRDKAFKACPP_LIB_REAL ${PROJECT_BINARY_DIR}/lib/librdkafka++.so.1)
         endif()
 
         # librdkafka does not support out-of-source builds, so let's copy all
@@ -58,71 +56,71 @@ if (USE_KAFKA)
         # we need to pull some working directory shenanigans for each command
         # in order to make the built scripts function correctly
 
-        add_custom_command ( OUTPUT ${LIBRDKAFKA_LIB}
-                COMMAND cp -r ${PROJECT_SOURCE_DIR}/librdkafka ${PROJECT_BINARY_DIR}/src
-                COMMAND cd ${PROJECT_BINARY_DIR}/src && ./configure --prefix=${PROJECT_BINARY_DIR}
-                COMMAND cd ${PROJECT_BINARY_DIR}/src && make && make install
-                COMMENT Copying and building librdkafka
-            )
+        add_custom_command(
+            OUTPUT ${LIBRDKAFKA_LIB}
+            COMMAND cp -r ${PROJECT_SOURCE_DIR}/librdkafka ${PROJECT_BINARY_DIR}/src
+            COMMAND cd ${PROJECT_BINARY_DIR}/src && ./configure --prefix=${PROJECT_BINARY_DIR}
+            COMMAND cd ${PROJECT_BINARY_DIR}/src && make && make install
+            COMMENT Copying and building librdkafka)
 
-        add_custom_target ( librdkafka-build ALL DEPENDS ${LIBRDKAFKA_LIB} )
+        add_custom_target(librdkafka-build ALL DEPENDS ${LIBRDKAFKA_LIB})
 
         # Add both libraries from librdkafka
-
-        add_library ( librdkafka SHARED IMPORTED )
-        set_property ( TARGET librdkafka PROPERTY IMPORTED_LOCATION ${LIBRDKAFKA_LIB} )
-        add_dependencies ( librdkafka librdkafka-build )
-
-        add_library ( librdkafkacpp STATIC IMPORTED )
-        set_property ( TARGET librdkafkacpp PROPERTY IMPORTED_LOCATION ${LIBRDKAFKACPP_LIB} )
-        add_dependencies ( librdkafkacpp librdkafka-build )
-
-        set (   SRCS
-                kafka.hpp
-                kafka.cpp
-            )
-
-        include_directories (
-                ./../../system/include
-                ./../../rtl/eclrtl
-                ./../../rtl/include
-                ./../../common/deftype
-                ./../../system/jlib
-                ${PROJECT_BINARY_DIR}/include
-                ${CMAKE_BINARY_DIR}
-                ${CMAKE_BINARY_DIR}/oss
-            )
-
-        ADD_DEFINITIONS( -D_USRDLL -DECL_KAFKA_EXPORTS )
-        HPCC_ADD_LIBRARY( kafka SHARED ${SRCS} )
-
-        if (${CMAKE_VERSION} VERSION_LESS "2.8.9")
-            message("WARNING: Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
+        add_library(librdkafka SHARED IMPORTED)
+        set_property(TARGET librdkafka PROPERTY IMPORTED_LOCATION ${LIBRDKAFKA_LIB})
+        add_dependencies(librdkafka librdkafka-build)
+
+        add_library(librdkafkacpp STATIC IMPORTED)
+        set_property(TARGET librdkafkacpp PROPERTY IMPORTED_LOCATION ${LIBRDKAFKACPP_LIB})
+        add_dependencies(librdkafkacpp librdkafka-build)
+
+        set(
+            SRCS
+            kafka.hpp
+            kafka.cpp)
+
+        include_directories(
+            ./../../system/include
+            ./../../rtl/eclrtl
+            ./../../rtl/include
+            ./../../common/deftype
+            ./../../system/jlib
+            ${PROJECT_BINARY_DIR}/include
+            ${CMAKE_BINARY_DIR}
+            ${CMAKE_BINARY_DIR}/oss)
+
+        add_definitions(-D_USRDLL -DECL_KAFKA_EXPORTS)
+        HPCC_ADD_LIBRARY(kafka SHARED ${SRCS})
+
+        if(${CMAKE_VERSION} VERSION_LESS "2.8.9")
+            message(WARNING "Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
         elseif(NOT APPLE)
-            set_target_properties( kafka PROPERTIES NO_SONAME 1 )
+            set_target_properties(kafka PROPERTIES NO_SONAME 1)
         endif()
 
-        install ( TARGETS kafka
-                DESTINATION plugins
-            )
+        install(
+            TARGETS kafka
+            DESTINATION plugins)
 
         # Install our built librdkafka libraries into the RPM
-        install ( FILES ${LIBRDKAFKA_LIB} ${LIBRDKAFKA_LIB_REAL} ${LIBRDKAFKACPP_LIB} ${LIBRDKAFKACPP_LIB_REAL}
-                DESTINATION ${LIB_DIR}
-                COMPONENT Runtime
-            )
-
-        target_link_libraries ( kafka
-                librdkafka
-                librdkafkacpp
-                eclrtl
-                jlib
-                ${ZLIB_LIBRARIES}
-            )
-
+        install(
+            FILES ${LIBRDKAFKA_LIB} ${LIBRDKAFKA_LIB_REAL} ${LIBRDKAFKACPP_LIB} ${LIBRDKAFKACPP_LIB_REAL}
+            DESTINATION ${LIB_DIR}
+            COMPONENT Runtime)
+
+        target_link_libraries(
+            kafka
+            librdkafka
+            librdkafkacpp
+            eclrtl
+            jlib
+            ${ZLIB_LIBRARIES}) 
     endif()
-
 endif()
 
-#Even if not making the kafka plugin, we want to install the header
-install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/kafka.ecllib DESTINATION plugins COMPONENT Runtime)
+if(PLATFORM)
+    install(
+        FILES ${CMAKE_CURRENT_SOURCE_DIR}/kafka.ecllib
+        DESTINATION plugins
+        COMPONENT Runtime)
+endif()

+ 39 - 34
plugins/memcached/CMakeLists.txt

@@ -24,45 +24,50 @@
 
 project( memcached )
 
-if (USE_MEMCACHED)
-  ADD_PLUGIN(memcached PACKAGES MEMCACHED OPTION MAKE_MEMCACHED)
-  if ( MAKE_MEMCACHED )
-    set (    SRCS
-             memcachedplugin.hpp
-             memcachedplugin.cpp
-        )
+if (MEMCACHED)
+    ADD_PLUGIN(memcached PACKAGES MEMCACHED OPTION MAKE_MEMCACHED)
+    if(MAKE_MEMCACHED)
+        set(
+            SRCS
+            memcachedplugin.hpp
+            memcachedplugin.cpp)
 
-    include_directories (
-             ./../../system/include
-             ./../../rtl/eclrtl
-             ./../../rtl/include
-             ./../../common/deftype
-             ./../../system/jlib
-             ${LIBMEMCACHED_INCLUDE_DIR}
-        )
+        include_directories(
+            ./../../system/include
+            ./../../rtl/eclrtl
+            ./../../rtl/include
+            ./../../common/deftype
+            ./../../system/jlib
+            ${LIBMEMCACHED_INCLUDE_DIR})
 
-    ADD_DEFINITIONS( -D_USRDLL -DECL_MEMCACHED_EXPORTS)
+        add_definitions(-D_USRDLL -DECL_MEMCACHED_EXPORTS)
 
-    #libmemcached-1.0.18 includes the header <cinttypes> which translates to <bits/cinttypes> requiring ISO C++ 2011 standard to build.
-    #All lesser versions explicitly include <tr1/cinttypes> which does not.
-    SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
+        #libmemcached-1.0.18 includes the header <cinttypes> which translates to <bits/cinttypes> requiring ISO C++ 2011 standard to build.
+        #All lesser versions explicitly include <tr1/cinttypes> which does not.
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
 
-    HPCC_ADD_LIBRARY( memcached SHARED ${SRCS} )
-    if (${CMAKE_VERSION} VERSION_LESS "2.8.9")
-      message("WARNING: Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
-    elseif(NOT APPLE)
-      set_target_properties( memcached PROPERTIES NO_SONAME 1 )
-    endif()
+        HPCC_ADD_LIBRARY(memcached SHARED ${SRCS})
+        if(${CMAKE_VERSION} VERSION_LESS "2.8.9")
+            message(WARNING "Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
+        elseif(NOT APPLE)
+            set_target_properties(memcached PROPERTIES NO_SONAME 1)
+        endif()
 
-    install ( TARGETS memcached DESTINATION plugins)
+        install(
+            TARGETS memcached
+            DESTINATION plugins)
 
-    target_link_libraries ( memcached
-        eclrtl
-        jlib
-        ${LIBMEMCACHED_LIBRARIES}
-        )
-  endif()
+        target_link_libraries(
+            memcached
+            eclrtl
+            jlib
+            ${LIBMEMCACHED_LIBRARIES})
+    endif()
 endif()
 
-#Even if not making the memcached plugin, we want to install the header
-install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/lib_memcached.ecllib DESTINATION plugins COMPONENT Runtime)
+if(PLATFORM)
+    install(
+        FILES ${CMAKE_CURRENT_SOURCE_DIR}/lib_memcached.ecllib
+        DESTINATION plugins
+        COMPONENT Runtime)
+endif()

+ 39 - 35
plugins/mysql/CMakeLists.txt

@@ -14,7 +14,6 @@
 #    limitations under the License.
 ################################################################################
 
-
 # Component: mysqlembed
 
 #####################################################
@@ -23,44 +22,49 @@
 #    Cmake Input File for mysqlembed
 #####################################################
 
-project( mysqlembed )
+project(mysqlembed)
 
-if (USE_MYSQL)
-  ADD_PLUGIN(mysqlembed PACKAGES MYSQL OPTION MAKE_MYSQLEMBED)
-  if ( MAKE_MYSQLEMBED )
-    set ( SRCS
-          mysqlembed.cpp
-        )
+if(MYSQLEMBED)
+    ADD_PLUGIN(mysqlembed PACKAGES MYSQL OPTION MAKE_MYSQLEMBED)
+    if(MAKE_MYSQLEMBED)
+        set(
+            SRCS
+            mysqlembed.cpp)
 
-    include_directories (
-         ./../../system/include
-         ./../../rtl/eclrtl
-         ./../../roxie/roxiemem
-         ./../../rtl/include
-         ./../../rtl/nbcd
-         ./../../common/deftype
-         ./../../system/jlib
-         ${MYSQL_INCLUDE_DIR}
-       )
+        include_directories(
+            ./../../system/include
+            ./../../rtl/eclrtl
+            ./../../roxie/roxiemem
+            ./../../rtl/include
+            ./../../rtl/nbcd
+            ./../../common/deftype
+            ./../../system/jlib
+            ${MYSQL_INCLUDE_DIR})
 
-    ADD_DEFINITIONS( -D_USRDLL -DMYSQLEMBED_EXPORTS )
+        add_definitions(-D_USRDLL -DMYSQLEMBED_EXPORTS)
 
-    HPCC_ADD_LIBRARY( mysqlembed SHARED ${SRCS} )
-    if (${CMAKE_VERSION} VERSION_LESS "2.8.9")
-      message("WARNING: Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
-    elseif(NOT APPLE)
-      set_target_properties( mysqlembed PROPERTIES NO_SONAME 1 )
-    endif()
+        HPCC_ADD_LIBRARY(mysqlembed SHARED ${SRCS})
+        if(${CMAKE_VERSION} VERSION_LESS "2.8.9")
+            message(WARNING "Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
+        elseif(NOT APPLE)
+            set_target_properties(mysqlembed PROPERTIES NO_SONAME 1)
+        endif()
 
-    install ( TARGETS mysqlembed DESTINATION plugins )
-    target_link_libraries ( mysqlembed
-         ${MYSQL_LIBRARIES}
-        eclrtl
-        roxiemem
-        jlib
-        )
-  endif()
+        install(
+            TARGETS mysqlembed
+            DESTINATION plugins )
+        target_link_libraries(
+            mysqlembed
+            ${MYSQL_LIBRARIES}
+            eclrtl
+            roxiemem
+            jlib)
+    endif()
 endif()
 
-# Even if not making the MySQL plugin, we want to install the header
-install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/mysql.ecllib DESTINATION plugins COMPONENT Runtime)
+if(PLATFORM)
+    install(
+        FILES ${CMAKE_CURRENT_SOURCE_DIR}/mysql.ecllib
+        DESTINATION plugins
+        COMPONENT Runtime)
+endif()

+ 48 - 43
plugins/pyembed/CMakeLists.txt

@@ -23,54 +23,59 @@
 #    Cmake Input File for pyembed
 #####################################################
 
-set ( debug_python Off )   # A lot slower but can assist in debugging...
-SET ( DEBUG_PYTHON_LIBRARY "/usr/lib/libpython2.7_d.so" )
+set(debug_python OFF)   # A lot slower but can assist in debugging...
+set(DEBUG_PYTHON_LIBRARY "/usr/lib/libpython2.7_d.so")
 
-project( pyembed )
+project(pyembed)
 
-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(PYEMBED)
+    ADD_PLUGIN(pyembed PACKAGES PythonLibs OPTION MAKE_PYEMBED MINVERSION 2.6 MAXVERSION 2.7)
+    if(MAKE_PYEMBED)
+        set(
+            SRCS
+            pyembed.cpp)
 
-    include_directories (
-         "${PYTHON_INCLUDE_DIR}"
-         ./../../system/include
-         ./../../rtl/eclrtl
-         ./../../rtl/include
-         ./../../rtl/nbcd
-         ./../../common/deftype
-         ./../../roxie/roxiemem
-         ./../../system/jlib
-       )
+        include_directories(
+            "${PYTHON_INCLUDE_DIR}"
+            ./../../system/include
+            ./../../rtl/eclrtl
+            ./../../rtl/include
+            ./../../rtl/nbcd
+            ./../../common/deftype
+            ./../../roxie/roxiemem
+            ./../../system/jlib)
 
-    ADD_DEFINITIONS( -D_USRDLL -DPYEMBED_EXPORTS )
-    if (debug_python)
-      ADD_DEFINITIONS(-DPy_DEBUG)
-    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")
-    elseif(NOT APPLE)
-      set_target_properties( pyembed PROPERTIES NO_SONAME 1 )
-    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")
+        elseif(NOT APPLE)
+            set_target_properties(pyembed PROPERTIES NO_SONAME 1)
+        endif()
 
-    install ( TARGETS pyembed DESTINATION plugins )
-    if (debug_python)
-      target_link_libraries ( pyembed ${DEBUG_PYTHON_LIBRARY} )
-    else()
-      target_link_libraries ( pyembed ${PYTHON_LIBRARY} )
-    endif()
+        install(
+            TARGETS pyembed
+            DESTINATION plugins)
+        if(debug_python)
+            target_link_libraries(pyembed ${DEBUG_PYTHON_LIBRARY})
+        else()
+            target_link_libraries(pyembed ${PYTHON_LIBRARY})
+        endif()
 
-    target_link_libraries ( pyembed
-        eclrtl
-        roxiemem
-        jlib
-        )
-  endif()
+        target_link_libraries(
+            pyembed
+            eclrtl
+            roxiemem
+            jlib)
+    endif()
+endif()
+if(PLATFORM)
+    install(
+        FILES ${CMAKE_CURRENT_SOURCE_DIR}/python.ecllib
+        DESTINATION plugins
+        COMPONENT Runtime)
 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)

+ 37 - 32
plugins/redis/CMakeLists.txt

@@ -22,43 +22,48 @@
 #    Cmake Input File for redis
 #####################################################
 
-project( redis )
+project(redis)
 
-if (USE_REDIS)
-  ADD_PLUGIN(redis PACKAGES REDIS OPTION MAKE_REDIS)
-  if ( MAKE_REDIS )
-    set (    SRCS
-             redis.hpp
-             redis.cpp
-        )
+if(REDISEMBED)
+    ADD_PLUGIN(redis PACKAGES REDIS OPTION MAKE_REDIS)
+    if(MAKE_REDIS)
+        set(
+            SRCS
+            redis.hpp
+            redis.cpp)
 
-    include_directories (
-             ./../../system/include
-             ./../../rtl/eclrtl
-             ./../../rtl/include
-             ./../../common/deftype
-             ./../../system/jlib
-             ${LIBHIREDIS_INCLUDE_DIR}
-        )
+        include_directories(
+            ./../../system/include
+            ./../../rtl/eclrtl
+            ./../../rtl/include
+            ./../../common/deftype
+            ./../../system/jlib
+            ${LIBHIREDIS_INCLUDE_DIR})
 
-    ADD_DEFINITIONS( -D_USRDLL -DECL_REDIS_EXPORTS)
+        add_definitions(-D_USRDLL -DECL_REDIS_EXPORTS)
 
-    HPCC_ADD_LIBRARY( redis SHARED ${SRCS} )
-    if (${CMAKE_VERSION} VERSION_LESS "2.8.9")
-      message("WARNING: Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
-    elseif(NOT APPLE)
-      set_target_properties( redis PROPERTIES NO_SONAME 1 )
-    endif()
+        HPCC_ADD_LIBRARY(redis SHARED ${SRCS})
+        if(${CMAKE_VERSION} VERSION_LESS "2.8.9")
+            message(WARNING "Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
+        elseif(NOT APPLE)
+            set_target_properties(redis PROPERTIES NO_SONAME 1)
+        endif()
 
-    install ( TARGETS redis DESTINATION plugins)
+        install(
+            TARGETS redis
+            DESTINATION plugins)
 
-    target_link_libraries ( redis
-        eclrtl
-        jlib
-        ${LIBHIREDIS_LIBRARY}
-        )
-  endif()
+        target_link_libraries(
+            redis
+            eclrtl
+            jlib
+            ${LIBHIREDIS_LIBRARY})
+    endif()
 endif()
 
-#Even if not making the redis plugin, we want to install the header
-install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/lib_redis.ecllib DESTINATION plugins COMPONENT Runtime)
+if(PLATFORM)
+    install(
+        FILES ${CMAKE_CURRENT_SOURCE_DIR}/lib_redis.ecllib
+        DESTINATION plugins
+        COMPONENT Runtime)
+endif()

+ 39 - 34
plugins/sqlite3/CMakeLists.txt

@@ -14,7 +14,6 @@
 #    limitations under the License.
 ################################################################################
 
-
 # Component: sqlite3embed
 
 #####################################################
@@ -23,43 +22,49 @@
 #    Cmake Input File for sqlite3embed
 #####################################################
 
-project( sqlite3embed )
-
-if (USE_SQLITE3)
-  ADD_PLUGIN(sqlite3embed PACKAGES SQLITE3 OPTION MAKE_SQLITEEMBED)
-  if ( MAKE_SQLITEEMBED )
-    set ( SRCS
-          sqlite3.cpp
-        )
+project(sqlite3embed)
 
-    include_directories (
-         ./../../system/include
-         ./../../rtl/eclrtl
-         ./../../rtl/include
-         ./../../rtl/nbcd
-         ./../../common/deftype
-         ./../../system/jlib
-         ${SQLITE3_INCLUDE_DIR}
-       )
+if(SQLITE3EMBED)
+    ADD_PLUGIN(sqlite3embed PACKAGES SQLITE3 OPTION MAKE_SQLITEEMBED)
+    if(MAKE_SQLITEEMBED)
+        set(
+            SRCS
+            sqlite3.cpp)
 
-    ADD_DEFINITIONS( -D_USRDLL -DSQLITE3_EXPORTS )
+        include_directories(
+            ./../../system/include
+            ./../../rtl/eclrtl
+            ./../../rtl/include
+            ./../../rtl/nbcd
+            ./../../common/deftype
+            ./../../system/jlib
+            ${SQLITE3_INCLUDE_DIR})
 
-    HPCC_ADD_LIBRARY( sqlite3embed SHARED ${SRCS} )
-    if (${CMAKE_VERSION} VERSION_LESS "2.8.9")
-      message("WARNING: Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
-    elseif(NOT APPLE)
-      set_target_properties( sqlite3embed PROPERTIES NO_SONAME 1 )
-    endif()
+        add_definitions(-D_USRDLL -DSQLITE3_EXPORTS)
 
-    install ( TARGETS sqlite3embed DESTINATION plugins )
-    target_link_libraries ( sqlite3embed ${SQLITE3_LIBRARIES} )
+        HPCC_ADD_LIBRARY(sqlite3embed SHARED ${SRCS})
+        if(${CMAKE_VERSION} VERSION_LESS "2.8.9")
+            message(WARNING "Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
+        elseif(NOT APPLE)
+            set_target_properties(sqlite3embed PROPERTIES NO_SONAME 1)
+        endif()
 
-    target_link_libraries ( sqlite3embed
-        eclrtl
-        jlib
-        )
-  endif()
+        install(
+            TARGETS sqlite3embed
+            DESTINATION plugins)
+        target_link_libraries(
+            sqlite3embed
+            ${SQLITE3_LIBRARIES})
+        target_link_libraries(
+            sqlite3embed
+            eclrtl
+            jlib)
+    endif()
 endif()
 
-# Even if not making the SqLite3 plugin, we want to install the header
-install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/sqlite3.ecllib DESTINATION plugins COMPONENT Runtime)
+if(PLATFORM)
+    install(
+        FILES ${CMAKE_CURRENT_SOURCE_DIR}/sqlite3.ecllib
+        DESTINATION plugins
+        COMPONENT Runtime)
+endif()

+ 41 - 36
plugins/v8embed/CMakeLists.txt

@@ -14,7 +14,6 @@
 #    limitations under the License.
 ################################################################################
 
-
 # Component: v8embed
 
 #####################################################
@@ -23,44 +22,50 @@
 #    Cmake Input File for v8embed
 #####################################################
 
-project( v8embed )
-
-if (USE_V8)
-  ADD_PLUGIN(v8embed PACKAGES V8 OPTION MAKE_V8EMBED)
-  if ( MAKE_V8EMBED )
-    set (    SRCS
-             v8embed.cpp
-        )
+project(v8embed)
 
-    include_directories (
-             ${V8_INCLUDE_DIR}
-             ./../../system/include
-             ./../../rtl/eclrtl
-             ./../../rtl/nbcd
-             ./../../rtl/include
-             ./../../common/deftype
-             ./../../roxie/roxiemem
-             ./../../system/jlib
-        )
+if(V8EMBED)
+    ADD_PLUGIN(v8embed PACKAGES V8 OPTION MAKE_V8EMBED)
+    if(MAKE_V8EMBED)
+        set(
+            SRCS
+            v8embed.cpp)
 
-    ADD_DEFINITIONS( -D_USRDLL -DV8EMBED_EXPORTS )
+        include_directories(
+            ${V8_INCLUDE_DIR}
+            ./../../system/include
+            ./../../rtl/eclrtl
+            ./../../rtl/nbcd
+            ./../../rtl/include
+            ./../../common/deftype
+            ./../../roxie/roxiemem
+            ./../../system/jlib)
 
-    HPCC_ADD_LIBRARY( v8embed SHARED ${SRCS} )
-    if (${CMAKE_VERSION} VERSION_LESS "2.8.9")
-      message("WARNING: Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
-    elseif(NOT APPLE)
-      set_target_properties( v8embed PROPERTIES NO_SONAME 1 )
-    endif()
+        add_definitions(-D_USRDLL -DV8EMBED_EXPORTS)
 
-    install ( TARGETS v8embed DESTINATION plugins )
+        HPCC_ADD_LIBRARY(v8embed SHARED ${SRCS})
+        if(${CMAKE_VERSION} VERSION_LESS "2.8.9")
+            message(WARNING "Cannot set NO_SONAME. shlibdeps will give warnings when package is installed")
+        elseif(NOT APPLE)
+            set_target_properties(v8embed PROPERTIES NO_SONAME 1)
+        endif()
 
-    target_link_libraries ( v8embed
-        ${V8_LIBRARIES}
-        roxiemem
-        eclrtl
-        jlib
-        )
-  endif()
+        install(
+            TARGETS v8embed
+            DESTINATION plugins)
+        target_link_libraries(
+            v8embed
+            ${V8_LIBRARIES}
+            roxiemem
+            eclrtl
+            jlib)
+    else()
+        message(WARNING "Cannot build v8embed plugin")
+    endif()
+endif()
+if(PLATFORM)
+    install(
+        FILES ${CMAKE_CURRENT_SOURCE_DIR}/javascript.ecllib
+        DESTINATION plugins
+        COMPONENT Runtime)
 endif()
-# Even if not making the V8 plugin, we want to install the header
-install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/javascript.ecllib DESTINATION plugins COMPONENT Runtime)

+ 1 - 1
roxie/roxiemem/CMakeLists.txt

@@ -43,7 +43,7 @@ include_directories (
 ADD_DEFINITIONS( -D_USRDLL -DROXIEMEM_EXPORTS)
 
 HPCC_ADD_LIBRARY( roxiemem SHARED ${SRCS} ${INCLUDES})
-if (NOT MAKE_R_ONLY)
+if (NOT PLUGIN)
   install ( TARGETS roxiemem RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} )
 endif()
 target_link_libraries ( roxiemem

+ 1 - 1
rtl/eclrtl/CMakeLists.txt

@@ -86,7 +86,7 @@ target_link_libraries ( eclrtl
       roxiemem
     )
 
-if (NOT MAKE_R_ONLY)
+if (NOT PLUGIN)
   install ( TARGETS eclrtl RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} ARCHIVE DESTINATION componentfiles/cl/lib )
   FOREACH( iFILES
     ${CMAKE_CURRENT_SOURCE_DIR}/eclinclude4.hpp

+ 1 - 1
rtl/nbcd/CMakeLists.txt

@@ -41,7 +41,7 @@ include_directories (
 ADD_DEFINITIONS( -D_USRDLL -DNBCD_EXPORTS )
 
 HPCC_ADD_LIBRARY( nbcd SHARED ${SRCS} )
-if (NOT MAKE_R_ONLY)
+if (NOT PLUGIN)
   install ( TARGETS nbcd RUNTIME DESTINATION ${EXEC_DIR} LIBRARY DESTINATION ${LIB_DIR} ARCHIVE DESTINATION componentfiles/cl/lib )
 endif()
 target_link_libraries ( nbcd 

+ 1 - 1
system/jlib/CMakeLists.txt

@@ -202,7 +202,7 @@ else ()
  target_link_libraries ( jlib rt)
 endif ()
 
-if (NOT MAKE_R_ONLY)
+if (NOT PLUGIN)
     if (WIN32)
         FILE(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}" WINDOWS_CMAKE_CURRENT_BINARY_DIR)
         FILE(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}\\jelog.mc" WINDOWS_CMAKE_CURRENT_SOURCE_DIR)