Commit 0831d7bc authored by Brian Panneton's avatar Brian Panneton
Browse files

FIX: Added Versioning export for windows and fixed win32 java build

parent 62fe1244
......@@ -16,11 +16,11 @@ SET(vMajor "0")
SET(vMinor "0")
# This Macro allows you to set up the Version in a one liner
MACRO(VersionCreate versionName versionMajor)
MACRO(VersionCreate versionName versionMajor export_name)
VersionMajorSet(${versionMajor})
VersionCalculate()
VersionWrite(${versionName})
ENDMACRO(VersionCreate versionName versionMajor)
VersionWrite(${versionName} ${export_name} "${ARGN}")
ENDMACRO(VersionCreate versionName versionMajor export_name)
# This Macro allows you to set the rewrite number
MACRO(VersionMajorSet versionMajor)
......@@ -44,14 +44,19 @@ MACRO(VersionCalculate)
ENDMACRO(VersionCalculate)
# This Macro writes your hpp/cpp files
MACRO(VersionWrite vProjectName)
MACRO(VersionWrite vProjectName export_name)
SET(include_list "${ARGN}")
FOREACH(il ${include_list})
SET(includes "${includes}\n\#include \"${il}\"")
ENDFOREACH(il ${include_list})
FILE(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${vProjectName}Version.hpp
"/* Current Version of ${vProjectName}
* Major is: ${vMajor}
* Minor is: ${vMinor}
*/
${includes}
\#include \"ProjectVersion.hpp\"
extern ProjectVersion ${vProjectName}Version;\n"
extern ${export_name} ProjectVersion ${vProjectName}Version;\n"
)
FILE(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/${vProjectName}Version.cpp
......@@ -61,4 +66,4 @@ extern ProjectVersion ${vProjectName}Version;\n"
\#include \"${vProjectName}Version.hpp\"
ProjectVersion ${vProjectName}Version = ProjectVersion(\"${vProjectName}\", \"${vMajor}\", \"${vMinor}\");\n"
)
ENDMACRO(VersionWrite)
ENDMACRO(VersionWrite vProjectName export_name)
......@@ -118,10 +118,10 @@ if(XDMF_WRAP_JAVA)
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
)
set(java_compile_args "-cp \"\\\"${CMAKE_BINARY_DIR}/*.jar\\\"\" *.java")
set(java_compile_args -cp "${CMAKE_BINARY_DIR}/*.jar" *.java)
set(java_dest "bin")
else(WIN32)
set(java_compile_args -cp '${CMAKE_BINARY_DIR}/*' ${XDMF_JAVA_DIR}/*.java)
set(java_compile_args -cp "${CMAKE_BINARY_DIR}/*.jar" ${XDMF_JAVA_DIR}/*.java)
set(java_dest "lib/java")
endif(WIN32)
......@@ -133,8 +133,8 @@ if(XDMF_WRAP_JAVA)
add_custom_target(Compiled_${java_name}_Jar ALL DEPENDS
${${java_name}_JAVA_JAR})
add_custom_command(OUTPUT ${${java_name}_JAVA_JAR}
COMMAND ${JAVA_COMPILE}
ARGS ${java_compile_args}
COMMAND ${CMAKE_COMMAND} -E chdir ${XDMF_JAVA_PACKAGE_DIR}
${JAVA_COMPILE} ARGS ${java_compile_args}
COMMAND ${JAVA_ARCHIVE}
ARGS -cvf ${${java_name}_JAVA_JAR}
"${XDMF_JAVA_PACKAGE_DIR}/*.class"
......
......@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.6)
include(SetUpVersion)
if(VERSION_CONTROL_AUTOUPDATE)
VersionCreate("Xdmf" "2")
VersionCreate("Xdmf" "2" "XDMFCORE_EXPORT" "XdmfCore.hpp")
endif(VERSION_CONTROL_AUTOUPDATE)
set(BUILD_SHARED_LIBS true)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment