Updates will be applied on October 27th between 12pm - 12:45pm EDT (UTC-0400). Gitlab may be slow during the maintenance window.

Commit f96f84ad authored by Aaron Bray's avatar Aaron Bray
Browse files

Renaming and Cleaning up of Cmake

Three more lines of code to go!!
updated the version of protobuf and warnings went away
parent e096f179
......@@ -62,7 +62,7 @@ if(UNIX AND NOT APPLE)
endif()
set (SUPERBUILD ON CACHE BOOL "Initial pull and build of all dependent libraries/executables")
if(SUPERBUILD)
if(${SUPERBUILD})
include(SuperBuild.cmake)
return()
else()
......
project(Engine)
project(Pulse)
set(BUILD_SHARED_LIBS ON)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Policy to address @foo@ variable expansion
......@@ -49,7 +48,7 @@ if(MSVC)
set(protobuf_BUILD_TESTS OFF CACHE TYPE INTERNAL FORCE)
set(protobuf_BUILD_EXAMPLES OFF CACHE TYPE INTERNAL FORCE)
add_subdirectory("${protobuf_DIR}/cmake" "${protobuf_DIR}-build")
set_target_properties(libprotobuf-lite libprotoc protoc PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)
set_target_properties(libprotobuf libprotoc protoc PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)
set_target_properties (libprotobuf libprotobuf-lite libprotoc protoc js_embed PROPERTIES FOLDER protobufs)
endif()
add_subdirectory("${log4cpp_DIR}" "${log4cpp_DIR}-build")
......@@ -58,40 +57,11 @@ add_subdirectory(cdm)
add_subdirectory(engine)
add_subdirectory(test)
add_subdirectory(sdk)
add_subdirectory(verification)
include(${CMAKE_CURRENT_SOURCE_DIR}/EngineJNI.cmake)
# TODO put a USE_JAVA option in (you would get no JNI, jar, and test suite, but maybe you just want the C++ SDK)
# Java Compiling
file(GLOB_RECURSE JAVA_FILES
"${CMAKE_BINARY_DIR}/schema/java/*.java"
"${CMAKE_BINARY_DIR}/../protobuf/src/protobuf/java/core/src/main/java/*.java"
"${CMAKE_SOURCE_DIR}/cdm/java/*.java"
"${CMAKE_SOURCE_DIR}/engine/java/*.java"
"${CMAKE_SOURCE_DIR}/test/cdm/java/*.java"
"${CMAKE_SOURCE_DIR}/test/engine/java/*.java"
"${CMAKE_SOURCE_DIR}/test/driver/java/*.java")
add_jar(PulseJava ${JAVA_FILES}
INCLUDE_JARS
${CMAKE_SOURCE_DIR}/jar/jcommon-1.0.16.jar
${CMAKE_SOURCE_DIR}/jar/jdom-2.0.2.jar
${CMAKE_SOURCE_DIR}/jar/jfreechart-1.0.13.jar
${CMAKE_SOURCE_DIR}/jar/guava-11.0.2.jar
${CMAKE_SOURCE_DIR}/jar/log4j-1.2.17.jar
${CMAKE_SOURCE_DIR}/jar/poi-3.13-20150929.jar
${CMAKE_SOURCE_DIR}/jar/poi-ooxml-3.13-20150929.jar
${CMAKE_SOURCE_DIR}/jar/poi-ooxml-schemas-3.13-20150929.jar
${CMAKE_SOURCE_DIR}/jar/pdfbox-2.0.0-RC3.jar
${CMAKE_SOURCE_DIR}/jar/reflections-0.9.9-RC1-uberjar.jar
${CMAKE_SOURCE_DIR}/jar/zip4j-1.3.1.jar
OUTPUT_NAME Pulse)
get_target_property(_jarFile PulseJava JAR_FILE)
add_custom_command(TARGET PulseJava POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${INSTALL_BIN}
COMMAND ${CMAKE_COMMAND} -E copy ${_jarFile} ${INSTALL_BIN})
install_jar(PulseJava ${INSTALL_BIN})
install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin DESTINATION ${CMAKE_INSTALL_PREFIX})
set(DATA_ROOT ${CMAKE_SOURCE_DIR})
install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin DESTINATION ${CMAKE_INSTALL_PREFIX})
configure_file(${CMAKE_SOURCE_DIR}/bin/run.cmake.in ${CMAKE_BINARY_DIR}/run.cmake @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/run.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
configure_file(${CMAKE_SOURCE_DIR}/bin/run.config.in ${CMAKE_BINARY_DIR}/run.config @ONLY)
......@@ -106,7 +76,7 @@ add_test(NAME runCDMUnitTests
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=CDMUnitTests -P ${CMAKE_BINARY_DIR}/install/bin/run.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runBGEUnitTests
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=BGEUnitTests -P ${CMAKE_BINARY_DIR}/install/bin/run.cmake
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=EngineUnitTests -P ${CMAKE_BINARY_DIR}/install/bin/run.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runSystemValidation
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=SystemValidation -P ${CMAKE_BINARY_DIR}/install/bin/run.cmake
......
# TODO put a USE_JAVA option in (you would get no JNI, jar, and test suite, but maybe you just want the C++ SDK)
# Java Compiling
add_library(PulseJNI SHARED cdm/cpp/CommonDataModelJNI.cpp
engine/cpp/PulseEngineJNI.h
engine/cpp/PulseEngineJNI.cpp)
find_package(JNI REQUIRED)
target_include_directories(PulseJNI PRIVATE ${JNI_INCLUDE_DIRS})
target_include_directories(PulseJNI PRIVATE ${CMAKE_BINARY_DIR}/schema/cpp/)
target_include_directories(PulseJNI PRIVATE ${CMAKE_BINARY_DIR}/schema/cpp/bind/)
target_include_directories(PulseJNI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/engine/cpp)
target_include_directories(PulseJNI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/cdm/cpp)
target_include_directories(PulseJNI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test/engine/cpp)
target_include_directories(PulseJNI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test/cdm/cpp)
target_include_directories(PulseJNI PRIVATE ${EIGEN3_INCLUDE_DIR})
target_include_directories(PulseJNI PRIVATE ${LOG4CPP_INCLUDE_DIR})
target_include_directories(PulseJNI PRIVATE ${PROTOBUF_INCLUDE_DIR})
set(PulseJNI_FLAGS)
set_target_properties(PulseJNI PROPERTIES COMPILE_FLAGS "${PulseJNI_FLAGS}" PREFIX "")
if(APPLE)
set_target_properties(PulseJNI PROPERTIES MACOSX_RPATH ON)
endif()
target_link_libraries(PulseJNI PulseEngineUnitTests)
target_link_libraries(PulseJNI CommonDataModelUnitTests)
add_custom_command(TARGET PulseJNI POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:PulseJNI> ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG})
if(WIN32)# Copy dll files to the bin
install(TARGETS PulseJNI
RUNTIME CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG}
LIBRARY CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(TARGETS PulseJNI
RUNTIME CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG}
LIBRARY CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(TARGETS PulseJNI
RUNTIME CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG}
LIBRARY CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
else()# Copy so files to the bin
install(TARGETS PulseJNI
LIBRARY CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(TARGETS PulseJNI
LIBRARY CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(TARGETS PulseJNI
LIBRARY CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
endif()
file(GLOB_RECURSE JAVA_FILES
"${CMAKE_BINARY_DIR}/schema/java/*.java"
"${CMAKE_BINARY_DIR}/../protobuf/src/protobuf/java/core/src/main/java/*.java"
"${CMAKE_SOURCE_DIR}/cdm/java/*.java"
"${CMAKE_SOURCE_DIR}/engine/java/*.java"
"${CMAKE_SOURCE_DIR}/test/cdm/java/*.java"
"${CMAKE_SOURCE_DIR}/test/engine/java/*.java"
"${CMAKE_SOURCE_DIR}/test/driver/java/*.java")
add_jar(PulseJava ${JAVA_FILES}
INCLUDE_JARS
${CMAKE_SOURCE_DIR}/jar/jcommon-1.0.16.jar
${CMAKE_SOURCE_DIR}/jar/jdom-2.0.2.jar
${CMAKE_SOURCE_DIR}/jar/jfreechart-1.0.13.jar
${CMAKE_SOURCE_DIR}/jar/guava-11.0.2.jar
${CMAKE_SOURCE_DIR}/jar/log4j-1.2.17.jar
${CMAKE_SOURCE_DIR}/jar/poi-3.13-20150929.jar
${CMAKE_SOURCE_DIR}/jar/poi-ooxml-3.13-20150929.jar
${CMAKE_SOURCE_DIR}/jar/poi-ooxml-schemas-3.13-20150929.jar
${CMAKE_SOURCE_DIR}/jar/pdfbox-2.0.0-RC3.jar
${CMAKE_SOURCE_DIR}/jar/reflections-0.9.9-RC1-uberjar.jar
${CMAKE_SOURCE_DIR}/jar/zip4j-1.3.1.jar
OUTPUT_NAME Pulse)
get_target_property(_jarFile PulseJava JAR_FILE)
add_custom_command(TARGET PulseJava POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${INSTALL_BIN}
COMMAND ${CMAKE_COMMAND} -E copy ${_jarFile} ${INSTALL_BIN})
install_jar(PulseJava ${INSTALL_BIN})
......@@ -2,7 +2,7 @@ include(ExternalProject)
include(CMakeDetermineSystem)
project(OuterBuild)
set(BUILD_SHARED_LIBS ON)
set(BUILD_SHARED_LIBS OFF)
if(MSVC OR XCode)
# For multi configuration IDE environments,
# these dependent libs only need to be built in release
......@@ -82,21 +82,22 @@ list(APPEND CMAKE_PREFIX_PATH ${log4cpp_INSTALL})
###################################################
message( STATUS "External project - protobuf" )
set(protobuf_VERSION "3.3.2" )
set(protobuf_VERSION "3.4.0rc2" )
set(protobuf_MD5 "ca583ee8bfc9e23b257e8724d5aae180" )
set(protobuf_DIR "${CMAKE_BINARY_DIR}/protobuf/src/protobuf")
set(protobuf_INSTALL "${CMAKE_CURRENT_BINARY_DIR}/protobuf/install")
ExternalProject_Add( protobuf
PREFIX protobuf
GIT_REPOSITORY "https://github.com/google/protobuf.git"
GIT_SHALLOW 1
GIT_TAG "v3.3.2"
SOURCE_SUBDIR ./cmake
PREFIX protobuf
URL "https://github.com/google/protobuf/archive/v3.4.0rc2.zip"
URL_MD5 ${protobuf_MD5}
DOWNLOAD_DIR ${protobuf_DIR}
INSTALL_DIR "${protobuf_INSTALL}"
SOURCE_SUBDIR ./cmake
CMAKE_ARGS
-Dprotobuf_BUILD_TESTS:BOOL=OFF
-Dprotobuf_BUILD_EXAMPLES:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=ON#${BUILD_SHARED_LIBS}
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-DCMAKE_INSTALL_PREFIX:STRING=${protobuf_INSTALL}
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
......@@ -118,76 +119,6 @@ list(APPEND CMAKE_PREFIX_PATH ${protobuf_INSTALL})
install(DIRECTORY ${protobuf_INSTALL}/include
DESTINATION ${CMAKE_INSTALL_PREFIX})
if(WIN32)
if(MSVC)
if(BUILD_SHARED_LIBS)
install(FILES "${protobuf_DIR}-build/Release/libprotobuf.dll"
CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(FILES "${protobuf_DIR}-build/Debug/libprotobufd.dll"
CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(FILES "${protobuf_DIR}-build/RelWithDebInfo/libprotobuf.dll"
CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
endif()
install(FILES "${protobuf_DIR}-build/Release/libprotobuf.lib"
CONFIGURATIONS Release DESTINATION ${INSTALL_LIB}/release${EX_CONFIG})
install(FILES "${protobuf_DIR}-build/Debug/libprotobufd.lib"
CONFIGURATIONS Debug DESTINATION ${INSTALL_LIB}/debug${EX_CONFIG})
install(FILES "${protobuf_DIR}-build/RelWithDebInfo/libprotobuf.lib"
CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_LIB}/relwithdebinfo${EX_CONFIG})
else()
if(BUILD_SHARED_LIBS)
install(FILES ${protobuf_INSTALL}/bin/libprotobuf.dll
CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(FILES ${protobuf_INSTALL}/bin/libprotobufd.dll
CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(FILES ${protobuf_INSTALL}/bin/libprotobuf.dll
CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
endif()
install(FILES ${xerces_INSTALL}/lib/libprotobuf.lib
CONFIGURATIONS Release DESTINATION ${INSTALL_LIB}/release${EX_CONFIG})
install(FILES ${xerces_INSTALL}/lib/libprotobufd.lib
CONFIGURATIONS Debug DESTINATION ${INSTALL_LIB}/debug${EX_CONFIG})
install(FILES ${xerces_INSTALL}/lib/libprotobuf.lib
CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_LIB}/relwithdebinfo${EX_CONFIG})
endif()
elseif(APPLE)
if(BUILD_SHARED_LIBS)
install(FILES ${protobuf_INSTALL}/bin/libprotobuf.dll
CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(FILES ${protobuf_INSTALL}/bin/libprotobufd.dll
CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(FILES ${protobuf_INSTALL}/bin/libprotobuf.dll
CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
endif()
install(FILES ${xerces_INSTALL}/lib/libprotobuf.lib
CONFIGURATIONS Release DESTINATION ${INSTALL_LIB}/release${EX_CONFIG})
install(FILES ${xerces_INSTALL}/lib/libprotobufd.lib
CONFIGURATIONS Debug DESTINATION ${INSTALL_LIB}/debug${EX_CONFIG})
install(FILES ${xerces_INSTALL}/lib/libprotobuf.lib
CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_LIB}/relwithdebinfo${EX_CONFIG})
else()
if(BUILD_SHARED_LIBS)
install(FILES ${protobuf_INSTALL}/bin/libprotobuf.dll
CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(FILES ${protobuf_INSTALL}/bin/libprotobufd.dll
CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(FILES ${protobuf_INSTALL}/bin/libprotobuf.dll
CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
endif()
# Install Libs
install(FILES ${xerces_INSTALL}/lib/libprotobuf.lib
CONFIGURATIONS Release DESTINATION ${INSTALL_LIB}/release${EX_CONFIG})
install(FILES ${xerces_INSTALL}/lib/libprotobufd.lib
CONFIGURATIONS Debug DESTINATION ${INSTALL_LIB}/debug${EX_CONFIG})
install(FILES ${xerces_INSTALL}/lib/libprotobuf.lib
CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_LIB}/relwithdebinfo${EX_CONFIG})
endif()
message(STATUS "protobuf is here : ${protobuf_DIR}" )
if(WIN32)
......
......@@ -73,6 +73,8 @@ elseif(TYPE STREQUAL "doxygen")
execute_process(COMMAND doxygen ./docs/full.doxy)
elseif(TYPE STREQUAL "protoc")
execute_process(COMMAND ${CMAKE_COMMAND} -DSCHEMA_SRC:STRING=@SCHEMA_SRC@ -DSCHEMA_DST:STRING=@SCHEMA_DST@ -P @DATA_ROOT@/schema/GenerateCDMBindings.cmake)
elseif(TYPE STREQUAL "updateBaselines")
execute_process(COMMAND ${CMAKE_COMMAND} --build @CMAKE_BINARY_DIR@ --target UpdateVerification)
else()
execute_process(COMMAND "${Java_JAVA_EXECUTABLE}" -Xmx900m -classpath "${JAVA_CLASSPATH}" mil.tatrc.physiology.testing.SETestDriver ${TYPE}.config)
endif()
......@@ -174,10 +174,11 @@ endif()
target_link_libraries(CommonDataModel DataModelBindings)
target_link_libraries(CommonDataModel log4cpp)
add_custom_command(TARGET CommonDataModel POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:CommonDataModel> ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG})
if(${BUILD_SHARED_LIBS})
add_custom_command(TARGET CommonDataModel POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:CommonDataModel> ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG})
if(WIN32)# Copy dll files to the bin
install(TARGETS CommonDataModel
RUNTIME CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG}
......
source_group("" FILES cpp/CommonDataModelJNI.cpp)
add_library(CommonDataModelJNI SHARED cpp/CommonDataModelJNI.cpp)
find_package(JNI REQUIRED)
target_include_directories(CommonDataModelJNI PRIVATE ${JNI_INCLUDE_DIRS})
target_include_directories(CommonDataModelJNI PRIVATE ${CMAKE_BINARY_DIR}/schema/cpp/bind)
target_include_directories(CommonDataModelJNI PRIVATE ${CMAKE_BINARY_DIR}/schema/cpp/)
target_include_directories(CommonDataModelJNI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/cpp)
target_include_directories(CommonDataModelJNI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../cdm/cpp)
target_include_directories(CommonDataModelJNI PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../test/cdm/cpp)
target_include_directories(CommonDataModelJNI PRIVATE ${EIGEN3_INCLUDE_DIR})
target_include_directories(CommonDataModelJNI PRIVATE ${LOG4CPP_INCLUDE_DIR})
target_include_directories(CommonDataModelJNI PRIVATE ${PROTOBUF_INCLUDE_DIR})
set(CDM_JNI_FLAGS)
set_target_properties(CommonDataModelJNI PROPERTIES COMPILE_FLAGS "${CDM_JNI_FLAGS}" PREFIX "")
if(APPLE)
set_target_properties(CommonDataModelJNI PROPERTIES MACOSX_RPATH ON)
endif()
# Dependent Libraries
target_link_libraries(CommonDataModelJNI CommonDataModelUnitTests)
add_custom_command(TARGET CommonDataModelJNI POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG}
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:CommonDataModelJNI> ${INSTALL_BIN}/${CONFIGURATION}${EX_CONFIG})
if(WIN32)# Copy dll files to the bin
install(TARGETS CommonDataModelJNI
RUNTIME CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG}
LIBRARY CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(TARGETS CommonDataModelJNI
RUNTIME CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG}
LIBRARY CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(TARGETS CommonDataModelJNI
RUNTIME CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG}
LIBRARY CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
else()# Copy so files to the bin
install(TARGETS CommonDataModelJNI
LIBRARY CONFIGURATIONS Release DESTINATION ${INSTALL_BIN}/release${EX_CONFIG})
install(TARGETS CommonDataModelJNI
LIBRARY CONFIGURATIONS Debug DESTINATION ${INSTALL_BIN}/debug${EX_CONFIG})
install(TARGETS CommonDataModelJNI
LIBRARY CONFIGURATIONS RelWithDebInfo DESTINATION ${INSTALL_BIN}/relwithdebinfo${EX_CONFIG})
endif()
include(${CMAKE_CURRENT_SOURCE_DIR}/CDM.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/CDMJNI.cmake)
......@@ -33,6 +33,8 @@ specific language governing permissions and limitations under the License.
#define DEBUGOUT(x)
#endif
#define CDM_BIND_DECL(type) namespace cdm { class type; }
#include <memory>
#include <stdio.h>
#include <iostream>
......
......@@ -13,6 +13,7 @@ specific language governing permissions and limitations under the License.
#include "stdafx.h"
#include "engine/SEAutoSerialization.h"
#include "properties/SEScalarTime.h"
#include "bind/cdm/Engine.pb.h"
SEAutoSerialization::SEAutoSerialization(Logger* logger) : Loggable(logger)
{
......
......@@ -11,7 +11,8 @@ specific language governing permissions and limitations under the License.
**************************************************************************************/
#pragma once
#include "bind/cdm/Engine.pb.h"
CDM_BIND_DECL(AutoSerializationData)
#include "properties/SEScalarTime.h"
class CDM_DECL SEAutoSerialization : public Loggable
......
......@@ -17,6 +17,7 @@ specific language governing permissions and limitations under the License.
#include "scenario/SECondition.h"
#include "utils/TimingProfile.h"
#include <google/protobuf/text_format.h>
#include "bind/cdm/Engine.pb.h"
SEDynamicStabilization::SEDynamicStabilization(Logger *logger) : SEEngineStabilization(logger),
......
......@@ -11,6 +11,7 @@ specific language governing permissions and limitations under the License.
**************************************************************************************/
#pragma once
CDM_BIND_DECL(DynamicStabilizationData)
#include "engine/SEEngineStabilization.h"
#include "engine/SEDynamicStabilizationEngineConvergence.h"
......
......@@ -12,6 +12,7 @@ specific language governing permissions and limitations under the License.
#include "stdafx.h"
#include "engine/SEDynamicStabilizationEngineConvergence.h"
#include "bind/cdm/Engine.pb.h"
SEDynamicStabilizationEngineConvergence::SEDynamicStabilizationEngineConvergence(Logger *logger) : Loggable(logger), m_DataRequestMgr(logger)
{
......
......@@ -11,10 +11,10 @@ specific language governing permissions and limitations under the License.
**************************************************************************************/
#pragma once
CDM_BIND_DECL(DynamicStabilizationData_EngineConvergenceData)
#include "engine/SEEngineTracker.h"
#include "engine/SEDynamicStabilizationPropertyConvergence.h"
#include "properties/SEScalarTime.h"
#include "bind/cdm/Engine.pb.h"
class CDM_DECL SEDynamicStabilizationEngineConvergence : public Loggable
{
......
......@@ -11,11 +11,11 @@ specific language governing permissions and limitations under the License.
**************************************************************************************/
#pragma once
class PhysiologyEngine;
class SEEngineTrack;
class SEEngineConfiguration;
class SECondition;
#include "bind/cdm/Engine.pb.h"
class SEEngineTrack;
class PhysiologyEngine;
class SEEngineConfiguration;
#include "bind/cdm/Properties.pb.h"
class CDM_DECL SEEngineStabilization : public Loggable
{
......
......@@ -17,6 +17,7 @@ specific language governing permissions and limitations under the License.
#include "scenario/SECondition.h"
#include "utils/TimingProfile.h"
#include <google/protobuf/text_format.h>
#include "bind/cdm/Engine.pb.h"
bool SETimedStabilization::StabilizeRestingState(PhysiologyEngine& engine)
{
......
......@@ -11,7 +11,7 @@ specific language governing permissions and limitations under the License.
**************************************************************************************/
#pragma once
CDM_BIND_DECL(TimedStabilizationData)
#include "engine/SEEngineStabilization.h"
#include "properties/SEScalarTime.h"
......
......@@ -166,6 +166,14 @@ const SEScalar* SEPatient::GetScalar(const std::string& name)
}
bool SEPatient::Load(const std::string& str)
{
cdm::PatientData src;
if (!google::protobuf::TextFormat::ParseFromString(str, &src))
return false;
SEPatient::Load(src, *this);
return true;
}
bool SEPatient::LoadFile(const std::string& patientFile)
{
cdm::PatientData src;
......
......@@ -24,6 +24,7 @@ public:
virtual void Clear();
bool Load(const std::string& str);
bool LoadFile(const std::string& patientFile);
void SaveFile(const std::string& filename);
......
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