File tree 4 files changed +29
-23
lines changed
4 files changed +29
-23
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,10 @@ if (WIN32 AND (NOT MINGW) AND (NOT CYGWIN))
14
14
set (CMAKE_CXX_FLAGS_MINSIZEREL "/MT" )
15
15
endif ()
16
16
17
- list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR} " )
18
- find_package (JNI11)
17
+ find_package (Java 11 REQUIRED COMPONENTS Development)
18
+ include (${CMAKE_CURRENT_LIST_DIR} /SetJavaHomeFromJavaExecutable.cmake)
19
+ find_package (JNI REQUIRED)
20
+
19
21
include_directories (${JNI_INCLUDE_DIRS} )
20
22
21
23
add_library (memory_agent SHARED
Original file line number Diff line number Diff line change 1
1
# Contributing guide for debugger memory agent
2
+
3
+ ## Prerequisites
4
+ To build the project you should have CMake 3.1 or higher installed, and JDK 11 or higher is installed.
5
+
2
6
## Building
3
- To build the project you should have Cmake 3.1 or higher installed, and ` JDK_11 `
4
- environmental variable should be set to jdk 11 or higher. Once you've downloaded the project,
5
- you can build it using the following commands in the root project directory:
7
+ Once you've downloaded the project, you can build it using the following commands in the root project directory:
6
8
```
7
9
cmake .
8
10
cmake --build .
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ if (NOT Java_JAVA_EXECUTABLE)
2
+ message (FATAL_ERROR "java executable not found" )
3
+ endif ()
4
+ execute_process (COMMAND "${Java_JAVA_EXECUTABLE} " -XshowSettings:properties -version
5
+ RESULT_VARIABLE res
6
+ OUTPUT_VARIABLE var
7
+ ERROR_VARIABLE var
8
+ OUTPUT_STRIP_TRAILING_WHITESPACE
9
+ ERROR_STRIP_TRAILING_WHITESPACE)
10
+ if (res)
11
+ message (FATAL_ERROR "Error executing java -version" )
12
+ else ()
13
+ set (_java_version_regex "java\\ .home = ([^\n ]+)" )
14
+ if (var MATCHES "${_java_version_regex} " )
15
+ set (JAVA_HOME "${CMAKE_MATCH_1} " )
16
+ else ()
17
+ string (REPLACE "\n " "\n " ver_msg "\n ${var} " )
18
+ message (FATAL_ERROR "Java output not recognized:${ver_msg} \n Please report." )
19
+ endif ()
20
+ endif ()
You can’t perform that action at this time.
0 commit comments