geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbarr...@apache.org
Subject geode git commit: GEODE-2307: Initial commit of FindGeode.cmake module.
Date Mon, 16 Jan 2017 23:31:43 GMT
Repository: geode
Updated Branches:
  refs/heads/next-gen-native-client-software-grant efd752ea3 -> 53907e6d6


GEODE-2307: Initial commit of FindGeode.cmake module.


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/53907e6d
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/53907e6d
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/53907e6d

Branch: refs/heads/next-gen-native-client-software-grant
Commit: 53907e6d65a7bfa7747edba50ef3d03364c353e3
Parents: efd752e
Author: Jacob Barrett <jbarrett@pivotal.io>
Authored: Fri Dec 16 23:17:34 2016 -0800
Committer: Jacob Barrett <jbarrett@pivotal.io>
Committed: Mon Jan 16 15:25:02 2017 -0800

----------------------------------------------------------------------
 cmake/FindGeode.cmake                     | 89 ++++++++++++++++++++++++++
 src/CMakeLists.txt                        |  4 +-
 src/clicache/integration-test/test.bat.in |  5 +-
 src/cppcache/integration-test/test.bat.in |  2 +-
 src/cppcache/integration-test/test.sh.in  |  2 +-
 src/docs/clicache/CMakeLists.txt          |  7 +-
 src/docs/cppcache/CMakeLists.txt          |  7 +-
 src/tests/javaobject/CMakeLists.txt       | 21 +++---
 8 files changed, 111 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/53907e6d/cmake/FindGeode.cmake
----------------------------------------------------------------------
diff --git a/cmake/FindGeode.cmake b/cmake/FindGeode.cmake
new file mode 100644
index 0000000..f563f95
--- /dev/null
+++ b/cmake/FindGeode.cmake
@@ -0,0 +1,89 @@
+##
+# FindGeode CMake find module.
+##
+
+set(_GEODE_ROOT "")
+if(GEODE_ROOT AND IS_DIRECTORY "${GEODE_ROOT}")
+  set(_GEODE_ROOT "${GEODE_ROOT}")
+  set(_GEODE_ROOT_EXPLICIT 1)
+else()
+  set(_ENV_GEODE_ROOT "")
+  if(DEFINED ENV{GEODE_ROOT})
+    file(TO_CMAKE_PATH "$ENV{GEODE_ROOT}" _ENV_GEODE_ROOT)
+  elseif(DEFINED ENV{GEODE})
+    file(TO_CMAKE_PATH "$ENV{GEODE}" _ENV_GEODE_ROOT)
+  endif()
+  if(_ENV_GEODE_ROOT AND IS_DIRECTORY "${_ENV_GEODE_ROOT}")
+    set(_GEODE_ROOT "${_ENV_GEODE_ROOT}")
+    set(_GEODE_ROOT_EXPLICIT 1)
+  endif()
+  unset(_ENV_GEODE_ROOT)
+endif()
+
+set(_GEODE_HINTS)
+if(_GEODE_ROOT)
+  set(_GEODE_HINTS ${_GEODE_ROOT}/bin)
+endif()
+
+set(_GEODE_PATHS
+  /geode/bin
+  /apache-geode/bin
+  /usr/geode/bin
+  /usr/apache-geode/bin
+  /usr/local/geode/bin
+  /usr/local/apache-geode/bin
+  /opt/geode/bin
+  /opt/apache-geode/bin
+  /opt/local/geode/bin
+  /opt/local/apache-geode/bin
+)
+
+if(WIN32)
+  set(_GEODE_NAMES gfsh.bat)
+else()
+  set(_GEODE_NAMES gfsh)
+endif()
+
+find_program(Geode_gfsh_EXECUTABLE
+  NAMES ${_GEODE_NAMES}
+  HINTS ${_GEODE_HINTS}
+  PATHS ${_GEODE_PATHS}
+)
+
+if(Geode_gfsh_EXECUTABLE)
+  execute_process(COMMAND ${Geode_gfsh_EXECUTABLE} version
+    RESULT_VARIABLE res
+    OUTPUT_VARIABLE var
+    ERROR_VARIABLE var
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    ERROR_STRIP_TRAILING_WHITESPACE)
+  if(res)
+    # TODO error checking
+  else()
+    if(var MATCHES "([0-9]+\\.[0-9]+\\.[0-9]+)")
+      set(Geode_VERSION "${CMAKE_MATCH_1}")
+    else()
+      # TODO version parsing error
+    endif()
+    
+    get_filename_component(Geode_PATH ${Geode_gfsh_EXECUTABLE} REALPATH)
+    get_filename_component(Geode_PATH ${Geode_PATH} DIRECTORY)
+    get_filename_component(Geode_PATH ${Geode_PATH}/.. REALPATH)
+    
+    set(Geode_CLASSPATH)
+    if(EXISTS ${Geode_PATH}/lib/geode-dependencies.jar)
+      set(Geode_CLASSPATH ${Geode_PATH}/lib/geode-dependencies.jar)
+    endif()
+  endif()
+endif()
+
+mark_as_advanced(
+  Geode_gfsh_EXECUTABLE
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args (Geode
+  FOUND_VAR Geode_FOUND
+  REQUIRED_VARS Geode_gfsh_EXECUTABLE Geode_PATH Geode_CLASSPATH
+  VERSION_VAR Geode_VERSION
+)

http://git-wip-us.apache.org/repos/asf/geode/blob/53907e6d/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 568c943..da94f53 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,6 +1,8 @@
 cmake_minimum_required(VERSION 3.4)
 project(nativeclient)
 
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/../cmake)
+
 set(BUILD_BITS 64 CACHE STRING "Build for 64 (default) or 32 bit.")
 
 #TODO cache values
@@ -172,7 +174,7 @@ if(DEFINED ENV{CTEST_UNITTEST_VERBOSITY})
     set(CTEST_UNITTEST_VERBOSITY $ENV{CTEST_UNITTEST_VERBOSITY})
 endif()
 
-set(GEMFIRE_HOME "" CACHE PATH "Path to GemFire production installation.")
+find_package(Geode 1.0 REQUIRED)
 
 add_custom_target(client-libraries)
 

http://git-wip-us.apache.org/repos/asf/geode/blob/53907e6d/src/clicache/integration-test/test.bat.in
----------------------------------------------------------------------
diff --git a/src/clicache/integration-test/test.bat.in b/src/clicache/integration-test/test.bat.in
index 4eac552..89bb93e 100644
--- a/src/clicache/integration-test/test.bat.in
+++ b/src/clicache/integration-test/test.bat.in
@@ -20,15 +20,14 @@ set GFCPP=c:\
 
 set TESTSRC=${CMAKE_CURRENT_SOURCE_DIR}
 set GF_JAVA=${Java_JAVA_EXECUTABLE}
-set GFJAVA=${GEMFIRE_HOME}
+set GFJAVA=${Geode_PATH}
 set GFE_LOGLEVEL=config
 set GFE_SECLOGLEVEL=config
-set GFE_DIR=${GEMFIRE_HOME}
+set GFE_DIR=${Geode_PATH}
 set MCAST_ADDR=224.10.13.63
 set MCAST_PORT=${PORT}
 set TIMEBOMB=3600
 set GF_CLASSPATH=%GF_CLASSPATH%;${CMAKE_BINARY_DIR}/tests/javaobject/javaobject.jar
-set GF_CLASSPATH=%GF_CLASSPATH%;${GEMFIRE_HOME}/lib/gfSecurityImpl.jar
 set PROFILERCMD=
 set BUG481=
 set TESTNAME=${TEST}

http://git-wip-us.apache.org/repos/asf/geode/blob/53907e6d/src/cppcache/integration-test/test.bat.in
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/test.bat.in b/src/cppcache/integration-test/test.bat.in
index 78444bf..5e96850 100644
--- a/src/cppcache/integration-test/test.bat.in
+++ b/src/cppcache/integration-test/test.bat.in
@@ -13,7 +13,7 @@ set PATH=%PATH%;$<JOIN:$<SHELL_PATH:${PATH}>,;>
 
 set TESTSRC=${CMAKE_CURRENT_SOURCE_DIR}
 set GF_JAVA=$<SHELL_PATH:${Java_JAVA_EXECUTABLE}>
-set GFJAVA=$<SHELL_PATH:${GEMFIRE_HOME}>
+set GFJAVA=$<SHELL_PATH:${Geode_PATH}>
 set GFE_LOGLEVEL=config
 set GFE_SECLOGLEVEL=config
 set MCAST_ADDR=224.10.13.63

http://git-wip-us.apache.org/repos/asf/geode/blob/53907e6d/src/cppcache/integration-test/test.sh.in
----------------------------------------------------------------------
diff --git a/src/cppcache/integration-test/test.sh.in b/src/cppcache/integration-test/test.sh.in
index dd659df..642aa37 100644
--- a/src/cppcache/integration-test/test.sh.in
+++ b/src/cppcache/integration-test/test.sh.in
@@ -15,7 +15,7 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$<JOIN:${LD_LIBRARY_PATH},:>
 
 export TESTSRC=${CMAKE_CURRENT_SOURCE_DIR}
 export GF_JAVA=${Java_JAVA_EXECUTABLE}
-export GFJAVA=${GEMFIRE_HOME}
+export GFJAVA=${Geode_PATH}
 export GFE_LOGLEVEL=config
 export GFE_SECLOGLEVEL=config 
 export MCAST_ADDR=224.10.13.63

http://git-wip-us.apache.org/repos/asf/geode/blob/53907e6d/src/docs/clicache/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/docs/clicache/CMakeLists.txt b/src/docs/clicache/CMakeLists.txt
index ae85197..0d5f853 100644
--- a/src/docs/clicache/CMakeLists.txt
+++ b/src/docs/clicache/CMakeLists.txt
@@ -1,8 +1,6 @@
 cmake_minimum_required(VERSION 3.4)
 project(docs-clicache LANGUAGES NONE)
 
-add_dependencies(docs docs-clicache)
-
 find_package(Doxygen)
 if(DOXYGEN_FOUND)
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY)
@@ -11,6 +9,7 @@ if(DOXYGEN_FOUND)
       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
       COMMENT "Generating .NET API documentation with Doxygen" VERBATIM)
   set_target_properties(docs-clicache PROPERTIES EXCLUDE_FROM_ALL TRUE EXCLUDE_FROM_DEFAULT_BUILD
TRUE)
-endif()
+  add_dependencies(docs docs-clicache)
 
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION docs/DotNetDocs)
+  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION docs/DotNetDocs)
+endif()

http://git-wip-us.apache.org/repos/asf/geode/blob/53907e6d/src/docs/cppcache/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/docs/cppcache/CMakeLists.txt b/src/docs/cppcache/CMakeLists.txt
index ee7b570..e6f5131 100644
--- a/src/docs/cppcache/CMakeLists.txt
+++ b/src/docs/cppcache/CMakeLists.txt
@@ -1,8 +1,6 @@
 cmake_minimum_required(VERSION 3.4)
 project(docs-cppcache LANGUAGES NONE)
 
-add_dependencies(docs docs-cppcache)
-
 find_package(Doxygen)
 if(DOXYGEN_FOUND)
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY)
@@ -11,6 +9,7 @@ if(DOXYGEN_FOUND)
       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
       COMMENT "Generating C++ API documentation with Doxygen" VERBATIM)
   set_target_properties(docs-cppcache PROPERTIES EXCLUDE_FROM_ALL TRUE EXCLUDE_FROM_DEFAULT_BUILD
TRUE)
+  add_dependencies(docs docs-cppcache)
+  
+  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION docs/cppdocs)
 endif()
-
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION docs/cppdocs)

http://git-wip-us.apache.org/repos/asf/geode/blob/53907e6d/src/tests/javaobject/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/tests/javaobject/CMakeLists.txt b/src/tests/javaobject/CMakeLists.txt
index 444065c..6d80eaf 100644
--- a/src/tests/javaobject/CMakeLists.txt
+++ b/src/tests/javaobject/CMakeLists.txt
@@ -1,16 +1,13 @@
-cmake_minimum_required (VERSION 2.8)
-find_package(Java REQUIRED)
-include(UseJava)
+cmake_minimum_required (VERSION 3.4)
 project (javaobject)
 
-# Determine JAVA_HOME.
-get_filename_component(JAVA_BIN ${Java_JAVA_EXECUTABLE} DIRECTORY)
-get_filename_component(JAVA_HOME ${JAVA_BIN} DIRECTORY)
+find_package(Geode REQUIRED)
+find_package(Java REQUIRED)
+
+include(UseJava)
 
-# Update the class path.
-set(CMAKE_JAVA_INCLUDE_PATH ${JAVA_HOME}/lib/tools.jar)
-LIST(APPEND CMAKE_JAVA_INCLUDE_PATH ${GEMFIRE_HOME}/lib/geode-dependencies.jar)
+file(GLOB_RECURSE SOURCES "*.java")
 
-# Compile and jar the classes.
-file(GLOB_RECURSE JAVA_SOURCES "*.java")
-add_jar(javaobject ${JAVA_SOURCES})
+add_jar(javaobject ${SOURCES}
+  INCLUDE_JARS ${Geode_CLASSPATH}
+)


Mime
View raw message