[Cmake-commits] CMake branch, next, updated. v3.6.0-rc1-99-gf6ae3ec

Brad King brad.king at kitware.com
Tue Jun 7 08:50:59 EDT 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  f6ae3ecd3763d255c91f3831ecaabd9f8d86eef9 (commit)
       via  89df91b938f22e14f647244093b08d49ddb41385 (commit)
       via  95d84369b802473e22bcb662a86175621bba54c6 (commit)
       via  5341c0d84af50c2ac5e4041885ab96f8d157ddfe (commit)
       via  d91ec04402bce94cb29662e0de548438876d86d5 (commit)
      from  9095b13b1caa941bf0109f62ceab07495aff37cd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f6ae3ecd3763d255c91f3831ecaabd9f8d86eef9
commit f6ae3ecd3763d255c91f3831ecaabd9f8d86eef9
Merge: 9095b13 89df91b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jun 7 08:50:57 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jun 7 08:50:57 2016 -0400

    Merge topic 'java-export-targets' into next
    
    89df91b9 Help: Add notes for topic 'java-export-targets'
    95d84369 Tests: Add test for exported JARs
    5341c0d8 UseJava: Add infrastructure to export targets
    d91ec044 Tests/Java: Clean up style of Java test code


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=89df91b938f22e14f647244093b08d49ddb41385
commit 89df91b938f22e14f647244093b08d49ddb41385
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jun 7 08:49:59 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jun 7 08:50:36 2016 -0400

    Help: Add notes for topic 'java-export-targets'

diff --git a/Help/release/dev/java-export-targets.rst b/Help/release/dev/java-export-targets.rst
new file mode 100644
index 0000000..5b70e97
--- /dev/null
+++ b/Help/release/dev/java-export-targets.rst
@@ -0,0 +1,6 @@
+java-export-targets
+-------------------
+
+* The :module:`UseJava` module gained APIs to "export" jar targets
+  for use by external CMake projects.  See the ``install_jar_exports``
+  and ``export_jars`` functions.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95d84369b802473e22bcb662a86175621bba54c6
commit 95d84369b802473e22bcb662a86175621bba54c6
Author:     Matthew Woehlke <matthew.woehlke at kitware.com>
AuthorDate: Tue May 31 10:51:25 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jun 7 08:50:36 2016 -0400

    Tests: Add test for exported JARs
    
    Add a unit test to test the new functions to export JAR targets. The
    test builds three sub-projects: two that generate and export a JAR (one
    does a build-directory-only export, one an install-only export), and a
    third that consumes the first two as imported targets.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 9442ea7..24b42ee 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -3104,6 +3104,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
   find_package(Java COMPONENTS Development QUIET)
   if(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE AND NOT MINGW
       AND NOT "${CMAKE_GENERATOR}" MATCHES "Xcode")
+
+    set(JavaExportImport_BUILD_OPTIONS -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM})
+    ADD_TEST_MACRO(JavaExportImport JavaExportImport)
+
     get_filename_component(JNIPATH ${JAVA_COMPILE} PATH)
     find_file(JNI_H jni.h
       "${JNIPATH}/../include"
diff --git a/Tests/JavaExportImport/BuildExport/CMakeLists.txt b/Tests/JavaExportImport/BuildExport/CMakeLists.txt
new file mode 100644
index 0000000..953f9d0
--- /dev/null
+++ b/Tests/JavaExportImport/BuildExport/CMakeLists.txt
@@ -0,0 +1,10 @@
+project(foo Java)
+
+cmake_minimum_required (VERSION 3.5)
+set(CMAKE_VERBOSE_MAKEFILE 1)
+
+find_package(Java COMPONENTS Development)
+include(UseJava)
+
+add_jar(${PROJECT_NAME} Foo.java)
+export_jars(TARGETS ${PROJECT_NAME} FILE JavaBuildExportTestConfig.cmake)
diff --git a/Tests/JavaExportImport/BuildExport/Foo.java b/Tests/JavaExportImport/BuildExport/Foo.java
new file mode 100644
index 0000000..20815ba
--- /dev/null
+++ b/Tests/JavaExportImport/BuildExport/Foo.java
@@ -0,0 +1,11 @@
+class Foo
+{
+  public Foo()
+  {
+  }
+
+  public void printName()
+  {
+    System.out.println("Foo");
+  }
+}
diff --git a/Tests/JavaExportImport/CMakeLists.txt b/Tests/JavaExportImport/CMakeLists.txt
new file mode 100644
index 0000000..a075301
--- /dev/null
+++ b/Tests/JavaExportImport/CMakeLists.txt
@@ -0,0 +1,104 @@
+cmake_minimum_required (VERSION 3.5)
+project(JavaExportImport)
+if(NOT DEFINED CMake_TEST_NESTED_MAKE_PROGRAM AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
+  set(CMake_TEST_NESTED_MAKE_PROGRAM "${CMAKE_MAKE_PROGRAM}")
+endif()
+
+find_package(Java COMPONENTS Development)
+
+# Wipe out the install tree to make sure the exporter works.
+add_custom_command(
+  OUTPUT ${JavaExportImport_BINARY_DIR}/CleanupProject
+  COMMAND ${CMAKE_COMMAND} -E remove_directory ${JavaExportImport_BINARY_DIR}/Root
+  )
+add_custom_target(CleanupTarget ALL DEPENDS ${JavaExportImport_BINARY_DIR}/CleanupProject)
+set_property(
+  SOURCE ${JavaExportImport_BINARY_DIR}/CleanupProject
+  PROPERTY SYMBOLIC 1
+  )
+
+if(CMAKE_CONFIGURATION_TYPES)
+  set(NESTED_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}")
+else()
+  if(CMAKE_BUILD_TYPE)
+    set(NESTED_CONFIG_TYPE -C "${CMAKE_BUILD_TYPE}")
+  else()
+    set(NESTED_CONFIG_TYPE)
+  endif()
+endif()
+
+configure_file(${JavaExportImport_SOURCE_DIR}/InitialCache.cmake.in
+               ${JavaExportImport_BINARY_DIR}/InitialCache.cmake @ONLY)
+
+# Build the build exporter.
+add_custom_command(
+  OUTPUT ${JavaExportImport_BINARY_DIR}/BuildExportProject
+  COMMAND ${CMAKE_CTEST_COMMAND} ${NESTED_CONFIG_TYPE}
+    --build-and-test
+    ${JavaExportImport_SOURCE_DIR}/BuildExport
+    ${JavaExportImport_BINARY_DIR}/BuildExport
+    --build-noclean
+    --build-project BuildExport
+    --build-generator ${CMAKE_GENERATOR}
+    --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
+    --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
+    --build-options -C${JavaExportImport_BINARY_DIR}/InitialCache.cmake
+  VERBATIM
+  )
+add_custom_target(BuildExportTarget ALL DEPENDS ${JavaExportImport_BINARY_DIR}/BuildExportProject)
+add_dependencies(BuildExportTarget CleanupTarget)
+set_property(
+  SOURCE ${JavaExportImport_BINARY_DIR}/BuildExportProject
+  PROPERTY SYMBOLIC 1
+  )
+
+# Build and install the install exporter.
+add_custom_command(
+  OUTPUT ${JavaExportImport_BINARY_DIR}/InstallExportProject
+  COMMAND ${CMAKE_CTEST_COMMAND} ${NESTED_CONFIG_TYPE}
+    --build-and-test
+    ${JavaExportImport_SOURCE_DIR}/InstallExport
+    ${JavaExportImport_BINARY_DIR}/InstallExport
+    --build-noclean
+    --build-project InstallExport
+    --build-target install
+    --build-generator ${CMAKE_GENERATOR}
+    --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
+    --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
+    --build-options -C${JavaExportImport_BINARY_DIR}/InitialCache.cmake
+  VERBATIM
+  )
+add_custom_target(InstallExportTarget ALL DEPENDS ${JavaExportImport_BINARY_DIR}/InstallExportProject)
+add_dependencies(InstallExportTarget CleanupTarget)
+set_property(
+  SOURCE ${JavaExportImport_BINARY_DIR}/InstallExportProject
+  PROPERTY SYMBOLIC 1
+  )
+
+# Build and install the importer.
+add_custom_command(
+  OUTPUT ${JavaExportImport_BINARY_DIR}/ImportProject
+  COMMAND ${CMAKE_CTEST_COMMAND} ${NESTED_CONFIG_TYPE}
+    --build-and-test
+    ${JavaExportImport_SOURCE_DIR}/Import
+    ${JavaExportImport_BINARY_DIR}/Import
+    --build-noclean
+    --build-project Import
+    --build-generator ${CMAKE_GENERATOR}
+    --build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
+    --build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
+    --build-options
+      -C${JavaExportImport_BINARY_DIR}/InitialCache.cmake
+      -DJavaBuildExportTest_DIR:PATH=${JavaExportImport_BINARY_DIR}/BuildExport
+      -DJavaInstallExportTest_DIR:PATH=${JavaExportImport_BINARY_DIR}/Root/share/cmake
+  VERBATIM
+  )
+add_custom_target(ImportTarget ALL DEPENDS ${JavaExportImport_BINARY_DIR}/ImportProject)
+add_dependencies(ImportTarget BuildExportTarget InstallExportTarget)
+set_property(
+  SOURCE ${JavaExportImport_BINARY_DIR}/ImportProject
+  PROPERTY SYMBOLIC 1
+  )
+
+add_executable(JavaExportImport main.c)
+add_dependencies(JavaExportImport ImportTarget)
diff --git a/Tests/JavaExportImport/Import/CMakeLists.txt b/Tests/JavaExportImport/Import/CMakeLists.txt
new file mode 100644
index 0000000..79a1447
--- /dev/null
+++ b/Tests/JavaExportImport/Import/CMakeLists.txt
@@ -0,0 +1,14 @@
+project(import Java)
+
+cmake_minimum_required (VERSION 3.5)
+set(CMAKE_VERBOSE_MAKEFILE 1)
+
+find_package(Java COMPONENTS Development)
+include(UseJava)
+
+find_package(JavaBuildExportTest REQUIRED)
+find_package(JavaInstallExportTest REQUIRED)
+
+add_jar(${PROJECT_NAME}
+  SOURCES Import.java
+  INCLUDE_JARS foo bar)
diff --git a/Tests/JavaExportImport/Import/Import.java b/Tests/JavaExportImport/Import/Import.java
new file mode 100644
index 0000000..08eb03f
--- /dev/null
+++ b/Tests/JavaExportImport/Import/Import.java
@@ -0,0 +1,10 @@
+class Import
+{
+  public static void main(String args[])
+  {
+    Foo foo = new Foo();
+    Bar bar = new Bar();
+    foo.printName();
+    bar.printName();
+  }
+}
diff --git a/Tests/JavaExportImport/InitialCache.cmake.in b/Tests/JavaExportImport/InitialCache.cmake.in
new file mode 100644
index 0000000..d15e6d1
--- /dev/null
+++ b/Tests/JavaExportImport/InitialCache.cmake.in
@@ -0,0 +1,5 @@
+set(CMAKE_MAKE_PROGRAM "@CMake_TEST_NESTED_MAKE_PROGRAM@" CACHE FILEPATH "Make Program")
+set(Java_JAVA_EXECUTABLE "@Java_JAVA_EXECUTABLE@" CACHE STRING "Java Interpreter")
+set(Java_JAVAC_EXECUTABLE "@Java_JAVAC_EXECUTABLE@" CACHE STRING "Java Compiler")
+set(Java_JAR_EXECUTABLE "@Java_JAR_EXECUTABLE@" CACHE STRING "Java Archive Tool")
+set(CMAKE_INSTALL_PREFIX "@JavaExportImport_BINARY_DIR@/Root" CACHE STRING "Installation Prefix")
diff --git a/Tests/JavaExportImport/InstallExport/Bar.java b/Tests/JavaExportImport/InstallExport/Bar.java
new file mode 100644
index 0000000..a1068a8
--- /dev/null
+++ b/Tests/JavaExportImport/InstallExport/Bar.java
@@ -0,0 +1,11 @@
+class Bar
+{
+  public Bar()
+  {
+  }
+
+  public void printName()
+  {
+    System.out.println("Bar");
+  }
+}
diff --git a/Tests/JavaExportImport/InstallExport/CMakeLists.txt b/Tests/JavaExportImport/InstallExport/CMakeLists.txt
new file mode 100644
index 0000000..0a9afd9
--- /dev/null
+++ b/Tests/JavaExportImport/InstallExport/CMakeLists.txt
@@ -0,0 +1,14 @@
+project(bar Java)
+
+cmake_minimum_required (VERSION 3.5)
+set(CMAKE_VERBOSE_MAKEFILE 1)
+
+find_package(Java COMPONENTS Development)
+include(UseJava)
+
+add_jar(${PROJECT_NAME} Bar.java)
+install_jar(${PROJECT_NAME} DESTINATION share/java)
+install_jar_exports(
+  TARGETS ${PROJECT_NAME}
+  FILE JavaInstallExportTestConfig.cmake
+  DESTINATION share/cmake)
diff --git a/Tests/JavaExportImport/main.c b/Tests/JavaExportImport/main.c
new file mode 100644
index 0000000..f8b643a
--- /dev/null
+++ b/Tests/JavaExportImport/main.c
@@ -0,0 +1,4 @@
+int main()
+{
+  return 0;
+}

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5341c0d84af50c2ac5e4041885ab96f8d157ddfe
commit 5341c0d84af50c2ac5e4041885ab96f8d157ddfe
Author:     Matthew Woehlke <matthew.woehlke at kitware.com>
AuthorDate: Mon May 9 14:59:58 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jun 7 08:50:35 2016 -0400

    UseJava: Add infrastructure to export targets
    
    Add additional functions to UseJava.cmake to create "exported" targets,
    similar to those of C/C++ libraries. In support of this, ensure that the
    JAR_FILE property of jar targets is always an absolute path.

diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 7b3416e..6644bd4 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -217,6 +217,19 @@
 # This command installs the TARGET_NAME files to the given DESTINATION.
 # It should be called in the same scope as add_jar() or it will fail.
 #
+# Target Properties:
+#
+# ::
+#
+#    The install_jar() function sets the INSTALL_DESTINATION target property
+#    on jars so installed. This property holds the DESTINATION as described
+#    above, and is used by install_jar_exports(). You can get this property
+#    with the
+#       get_property(TARGET <target_name> PROPERTY INSTALL_DESTINATION)
+#    command.
+#
+#
+#
 # ::
 #
 #  install_jni_symlink(target_name destination)
@@ -228,6 +241,24 @@
 #
 # ::
 #
+#  install_jar_exports(TARGETS jar1 [jar2 ...]
+#                      FILE export_filename
+#                      DESTINATION destination [COMPONENT component])
+#
+# This command installs a target export file export_filename for the named jar
+# targets to the given DESTINATION. Its function is similar to that of
+# install(EXPORTS).
+#
+# ::
+#
+#  export_jars(TARGETS jar1 [jar2 ...]
+#              FILE export_filename)
+#
+# This command writes a target export file export_filename for the named jar
+# targets. Its function is similar to that of export().
+#
+# ::
+#
 #  create_javadoc(<VAR>
 #                 PACKAGES pkg1 [pkg2 ...]
 #                 [SOURCEPATH <sourcepath>]
@@ -396,7 +427,29 @@ function (__java_copy_file src dest comment)
         COMMENT ${comment})
 endfunction ()
 
+function(__java_lcat VAR)
+    foreach(_line ${ARGN})
+        set(${VAR} "${${VAR}}${_line}\n")
+    endforeach()
+
+    set(${VAR} "${${VAR}}" PARENT_SCOPE)
+endfunction()
+
+function(__java_export_jar VAR TARGET PATH)
+    get_target_property(_jarpath ${TARGET} JAR_FILE)
+    get_filename_component(_jarname ${_jarpath} NAME)
+    __java_lcat(${VAR}
+      "# Create imported target ${TARGET}"
+      "add_custom_target(${TARGET})"
+      "set_target_properties(${TARGET} PROPERTIES"
+      "  JAR_FILE \"${PATH}/${_jarname}\")"
+      ""
+    )
+    set(${VAR} "${${VAR}}" PARENT_SCOPE)
+endfunction()
+
 # define helper scripts
+set(_JAVA_EXPORT_TARGETS_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/javaTargets.cmake.in)
 set(_JAVA_CLASS_FILELIST_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaClassFilelist.cmake)
 set(_JAVA_SYMLINK_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaSymlinks.cmake)
 
@@ -435,6 +488,8 @@ function(add_jar _TARGET_NAME)
 
     if (NOT DEFINED _add_jar_OUTPUT_DIR)
         set(_add_jar_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
+    else()
+        get_filename_component(_add_jar_OUTPUT_DIR ${_add_jar_OUTPUT_DIR} ABSOLUTE)
     endif()
 
     if (_add_jar_ENTRY_POINT)
@@ -716,6 +771,13 @@ function(INSTALL_JAR _TARGET_NAME)
         PROPERTY
             INSTALL_FILES
     )
+    set_property(
+        TARGET
+            ${_TARGET_NAME}
+        PROPERTY
+            INSTALL_DESTINATION
+            ${_DESTINATION}
+    )
 
     if (__FILES)
         install(
@@ -1288,3 +1350,94 @@ function (create_javah)
       set (${_create_javah_GENERATED_FILES} ${_output_files} PARENT_SCOPE)
     endif()
 endfunction()
+
+function(export_jars)
+    # Parse and validate arguments
+    cmake_parse_arguments(_export_jars
+      ""
+      "FILE"
+      "TARGETS"
+      ${ARGN}
+    )
+    if (NOT _export_jars_FILE)
+      message(SEND_ERROR "export_jars: FILE must be specified.")
+    endif()
+    if (NOT _export_jars_TARGETS)
+      message(SEND_ERROR "export_jars: TARGETS must be specified.")
+    endif()
+
+    # Set content of generated exports file
+    string(REPLACE ";" " " __targets__ "${_export_jars_TARGETS}")
+    set(__targetdefs__ "")
+    foreach(_target ${_export_jars_TARGETS})
+        get_target_property(_jarpath ${_target} JAR_FILE)
+        get_filename_component(_jarpath ${_jarpath} PATH)
+        __java_export_jar(__targetdefs__ ${_target} "${_jarpath}")
+    endforeach()
+
+    # Generate exports file
+    configure_file(
+      ${_JAVA_EXPORT_TARGETS_SCRIPT}
+      ${_export_jars_FILE}
+      @ONLY
+    )
+endfunction()
+
+function(install_jar_exports)
+    # Parse and validate arguments
+    cmake_parse_arguments(_install_jar_exports
+      ""
+      "FILE;DESTINATION;COMPONENT"
+      "TARGETS"
+      ${ARGN}
+    )
+    if (NOT _install_jar_exports_FILE)
+      message(SEND_ERROR "install_jar_exports: FILE must be specified.")
+    endif()
+    if (NOT _install_jar_exports_DESTINATION)
+      message(SEND_ERROR "install_jar_exports: DESTINATION must be specified.")
+    endif()
+    if (NOT _install_jar_exports_TARGETS)
+      message(SEND_ERROR "install_jar_exports: TARGETS must be specified.")
+    endif()
+
+    if (_install_jar_exports_COMPONENT)
+      set (_COMPONENT COMPONENT ${_install_jar_exports_COMPONENT})
+    endif()
+
+    # Determine relative path from installed export file to install prefix
+    if(IS_ABSOLUTE ${_install_jar_exports_DESTINATION})
+      file(RELATIVE_PATH _relpath
+        ${_install_jar_exports_DESTINATION}
+        ${CMAKE_INSTALL_PREFIX}
+      )
+    else()
+      file(RELATIVE_PATH _relpath
+        ${CMAKE_INSTALL_PREFIX}/${_install_jar_exports_DESTINATION}
+        ${CMAKE_INSTALL_PREFIX}
+      )
+    endif()
+
+    # Set up unique location for generated exports file
+    string(SHA256 _hash "${_install_jar_exports_DESTINATION}")
+    set(_tmpdir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/JavaExports/${_hash})
+
+    # Set content of generated exports file
+    string(REPLACE ";" " " __targets__ "${_install_jar_exports_TARGETS}")
+    set(__targetdefs__ "set(_prefix \${CMAKE_CURRENT_LIST_DIR}/${_relpath})\n\n")
+    foreach(_target ${_install_jar_exports_TARGETS})
+        get_target_property(_dir ${_target} INSTALL_DESTINATION)
+        __java_export_jar(__targetdefs__ ${_target} "\${_prefix}/${_dir}")
+    endforeach()
+    __java_lcat(__targetdefs__ "\nunset(_prefix)")
+
+    # Generate and install exports file
+    configure_file(
+      ${_JAVA_EXPORT_TARGETS_SCRIPT}
+      ${_tmpdir}/${_install_jar_exports_FILE}
+      @ONLY
+    )
+    install(FILES ${_tmpdir}/${_install_jar_exports_FILE}
+            DESTINATION ${_install_jar_exports_DESTINATION}
+            ${_COMPONENT})
+endfunction()
diff --git a/Modules/javaTargets.cmake.in b/Modules/javaTargets.cmake.in
new file mode 100644
index 0000000..c5f9c78
--- /dev/null
+++ b/Modules/javaTargets.cmake.in
@@ -0,0 +1,39 @@
+cmake_minimum_required(VERSION 2.8)
+cmake_policy(PUSH)
+cmake_policy(VERSION 2.8)
+
+#----------------------------------------------------------------
+# Generated CMake Java target import file.
+#----------------------------------------------------------------
+
+# Protect against multiple inclusion, which would fail when already imported targets are added once more.
+set(_targetsDefined)
+set(_targetsNotDefined)
+set(_expectedTargets)
+foreach(_expectedTarget @__targets__@)
+  list(APPEND _expectedTargets ${_expectedTarget})
+  if(TARGET ${_expectedTarget})
+    list(APPEND _targetsDefined ${_expectedTarget})
+  else()
+    list(APPEND _targetsNotDefined ${_expectedTarget})
+  endif()
+endforeach()
+if("%${_targetsDefined}" STREQUAL "%${_expectedTargets}")
+  unset(_targetsDefined)
+  unset(_targetsNotDefined)
+  unset(_expectedTargets)
+  cmake_policy(POP)
+  return()
+endif()
+if(NOT "${_targetsDefined}" STREQUAL "")
+  message(FATAL_ERROR
+    "Some (but not all) targets in this export set were already defined.\n"
+    "Targets Defined: ${_targetsDefined}\n"
+    "Targets not yet defined: ${_targetsNotDefined}\n")
+endif()
+unset(_targetsDefined)
+unset(_targetsNotDefined)
+unset(_expectedTargets)
+
+ at __targetdefs__@
+cmake_policy(POP)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d91ec04402bce94cb29662e0de548438876d86d5
commit d91ec04402bce94cb29662e0de548438876d86d5
Author:     Matthew Woehlke <matthew.woehlke at kitware.com>
AuthorDate: Tue May 31 10:51:50 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jun 7 08:50:35 2016 -0400

    Tests/Java: Clean up style of Java test code

diff --git a/Tests/Java/A.java b/Tests/Java/A.java
index 403a7f8..b7fdb49 100644
--- a/Tests/Java/A.java
+++ b/Tests/Java/A.java
@@ -1,11 +1,11 @@
 class A
 {
   public A()
-    {
-    }
+  {
+  }
 
   public void printName()
-    {
-      System.out.println("A");
-    }
+  {
+    System.out.println("A");
+  }
 }
diff --git a/Tests/Java/HelloWorld.java b/Tests/Java/HelloWorld.java
index 378e371..995ee48 100644
--- a/Tests/Java/HelloWorld.java
+++ b/Tests/Java/HelloWorld.java
@@ -1,11 +1,11 @@
 class HelloWorld
 {
-    public static void main(String args[])
-    {
-        A a;
-        a = new A();
-        a.printName();
-        System.out.println("Hello World!");
-    }
+  public static void main(String args[])
+  {
+    A a;
+    a = new A();
+    a.printName();
+    System.out.println("Hello World!");
+  }
 }
 

-----------------------------------------------------------------------

Summary of changes:
 Help/release/dev/java-export-targets.rst           |    6 +
 Modules/UseJava.cmake                              |  153 ++++++++++++++++++++
 Modules/javaTargets.cmake.in                       |   39 +++++
 Tests/CMakeLists.txt                               |    4 +
 Tests/Java/A.java                                  |   10 +-
 Tests/Java/HelloWorld.java                         |   14 +-
 Tests/JavaExportImport/BuildExport/CMakeLists.txt  |   10 ++
 Tests/JavaExportImport/BuildExport/Foo.java        |   11 ++
 Tests/JavaExportImport/CMakeLists.txt              |  104 +++++++++++++
 Tests/JavaExportImport/Import/CMakeLists.txt       |   14 ++
 Tests/JavaExportImport/Import/Import.java          |   10 ++
 Tests/JavaExportImport/InitialCache.cmake.in       |    5 +
 Tests/JavaExportImport/InstallExport/Bar.java      |   11 ++
 .../JavaExportImport/InstallExport/CMakeLists.txt  |   14 ++
 Tests/{ExportImport => JavaExportImport}/main.c    |    0
 15 files changed, 393 insertions(+), 12 deletions(-)
 create mode 100644 Help/release/dev/java-export-targets.rst
 create mode 100644 Modules/javaTargets.cmake.in
 create mode 100644 Tests/JavaExportImport/BuildExport/CMakeLists.txt
 create mode 100644 Tests/JavaExportImport/BuildExport/Foo.java
 create mode 100644 Tests/JavaExportImport/CMakeLists.txt
 create mode 100644 Tests/JavaExportImport/Import/CMakeLists.txt
 create mode 100644 Tests/JavaExportImport/Import/Import.java
 create mode 100644 Tests/JavaExportImport/InitialCache.cmake.in
 create mode 100644 Tests/JavaExportImport/InstallExport/Bar.java
 create mode 100644 Tests/JavaExportImport/InstallExport/CMakeLists.txt
 copy Tests/{ExportImport => JavaExportImport}/main.c (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list