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

New Directory Structure for multiple engine implementations

parent 466de565
......@@ -116,6 +116,8 @@ endif()
# INNERBUILD
#-----------------------------------------------------------------------------
set(${PROJECT_NAME}_INSTALL_FOLDER ${PROJECT_NAME}-${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR})
include(Find)# Our find macros
include(AddLibrary)# Extras to do when creating a library
include(AddExecutable)# Extras to do when creating an executable
......@@ -129,21 +131,14 @@ if(WIN32)
find_package(Dirent REQUIRED)
endif()
# Use the config written by protobuf
set(protobuf_MODULE_COMPATIBLE ON)
set(protobuf_MODULE_COMPATIBLE ON CACHE BOOL "" FORCE)
find_package(protobuf REQUIRED NO_DEFAULT_PATH)
set(SCHEMA_SRC "${CMAKE_SOURCE_DIR}/schema")
set(SCHEMA_DST "${CMAKE_SOURCE_DIR}/schema/bind")
add_subdirectory(schema)
add_subdirectory(cdm)
add_subdirectory(engine)
add_subdirectory(test)
add_subdirectory(sdk)
add_subdirectory(verification)
add_subdirectory(src/c)
add_subdirectory(src/java)
add_subdirectory(src/python)
add_subdirectory(src)
add_subdirectory(data)
#--------------------------------------------------------------------------
# Add setup script for *nix systems
......@@ -156,9 +151,21 @@ if(NOT WIN32)
endif()
endif()
file(GLOB JSON_FILES ${CMAKE_SOURCE_DIR}/bin/*.json)
file(COPY ${JSON_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
file(COPY ${CMAKE_SOURCE_DIR}/bin/log4j.properties DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
if(WIN32)
file(COPY ${CMAKE_SOURCE_DIR}/bin/run.bat DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
else()
file(COPY ${CMAKE_SOURCE_DIR}/bin/run.sh DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
endif()
configure_file(${CMAKE_SOURCE_DIR}/bin/rebase.py.in "${CMAKE_INSTALL_PREFIX}/bin/rebase.py" @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/bin/run.cmake.in "${CMAKE_INSTALL_PREFIX}/bin/run.cmake" @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/bin/run.config.in "${CMAKE_INSTALL_PREFIX}/bin/run.config" @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/cmake/PulseConfig.cmake.in ${CMAKE_INSTALL_PREFIX}/PulseConfig.cmake @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/docs/Doxygen/full.doxy.in ${CMAKE_INSTALL_PREFIX}/bin/docs/full.doxy @ONLY)
set(${PROJECT_NAME}_INSTALL_FOLDER ${PROJECT_NAME}-${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR})
#-----------------------------------------------------------------------------
# This variable controls the prefix used to generate the following files:
# ${PROJECT_NAME}ConfigVersion.cmake
......
project(Pulse)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Policy to address @foo@ variable expansion
set(PULSE_VERSION_MAJOR 1)
set(PULSE_VERSION_MINOR 1)
set(PULSE_VERSION_PATCH 0)
set(PULSE_VERSION "${PULSE_VERSION_MAJOR}.${PULSE_VERSION_MINOR}.${PULSE_VERSION_PATCH}")
# Build the core libraries as shared or static (DataModel, CDM, Engine)
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_CXX_STANDARD 11)
set(PULSE_DEBUG_POSTFIX "d")
set(PULSE_RELWITHDEBINFO_POSTFIX "di")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CONFIGURATION_TYPES "Debug" "Release" "RelWithDebInfo" CACHE STRING INTERNAL FORCE )
if(MSVC)
# Using MD as that seems to be what I run into alot, you could change these to /MT and /MTd if you want...
set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Zi /Ob2 /Oi /Od /RTC1 /MP /EHsc" CACHE STRING INTERNAL FORCE)
set(CMAKE_CXX_FLAGS_RELEASE "/MD /MP /EHsc" CACHE STRING INTERNAL FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MDd /Zi /MP /EHsc" CACHE STRING INTERNAL FORCE)
endif()
if(MINGW)
endif()
if(APPLE)
endif()
if(UNIX)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:\$ORIGIN")
endif()
if ( CMAKE_COMPILER_IS_GNUCC )
# Protobuf is not using the same variable name in its swap specificiation definitions
# Resulting in a LOT of warnings per file that includes protobuf headers, slowing the build down
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes")
if(CMAKE_BUILD_TYPE EQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
endif()
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
message(STATUS "Looking for modules here : ${CMAKE_PREFIX_PATH}")
set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING INTERNAL FORCE)
set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING INTERNAL FORCE)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
set(SRC_ROOT "${CMAKE_SOURCE_DIR}/src")
set(SCHEMA_SRC "${CMAKE_SOURCE_DIR}/schema")
set(SCHEMA_DST "${CMAKE_SOURCE_DIR}/schema/bind")
if(NOT Eigen3_DIR)
set(Eigen3_DIR ${CMAKE_BINARY_DIR}/../eigen/install)
endif()
find_package(Eigen3 REQUIRED)
if(WIN32)
find_package(Dirent REQUIRED)
endif()
# The outer build does some custom installing of dependent libraries
# Instead of using find_package, I will make sure things are where expected
if(NOT protobuf_SRC)
set(protobuf_SRC ${CMAKE_BINARY_DIR}/../protobuf/src/protobuf)
endif()
set(protobuf_Header ${protobuf_SRC}/src/google/protobuf/package_info.h)
# Proto headers should have been installed here by the outer build
if(NOT EXISTS ${protobuf_Header})
message(FATAL_ERROR "I cannot find protobuf source, please set protobuf_SRC to its root directory")
endif()
if(NOT protobuf_DIR)
set(protobuf_DIR ${CMAKE_BINARY_DIR}/../protobuf/install)
endif()
list(APPEND CMAKE_PREFIX_PATH ${protobuf_DIR})
# Settings for protobuf configuration
set(protobuf_BUILD_PROTOC_BINARIES OFF CACHE BOOL INTERNAL FORCE)
set(protobuf_BUILD_SHARED_LIBS OFF CACHE BOOL INTERNAL FORCE)
set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL INTERNAL FORCE)#Use our MSVC runtime settings (/MD or /MT)
set(protobuf_BUILD_TESTS OFF CACHE BOOL INTERNAL FORCE)
set(protobuf_BUILD_EXAMPLES OFF CACHE BOOL INTERNAL FORCE)
add_subdirectory("${protobuf_SRC}/cmake" "${protobuf_SRC}-build")
set_target_properties (libprotobuf libprotobuf-lite PROPERTIES FOLDER protobufs)
set(logger_lib)
set(logger_SRC)
if (${PULSE_LOGGER} STREQUAL "log4cpp")
# log4cpp src should have been download to somewhere
if(NOT logger_SRC)
# It should be here if the outer build ran
set(logger_SRC ${CMAKE_BINARY_DIR}/../log4cpp/src/log4cpp)
endif()
set(log4cpp_HEADER ${logger_SRC}/include/log4cpp/FileAppender.hh)
if(NOT EXISTS ${log4cpp_HEADER})
message(FATAL_ERROR "I cannot find log4cpp source, please set logger_SRC to its root directory")
endif()
list(APPEND LOGGER_INCLUDE_DIR ${logger_SRC}/include)
list(APPEND LOGGER_INCLUDE_DIR ${logger_SRC}-build/include)
set(BUILD_TESTING OFF CACHE BOOL INTERNAL FORCE)
add_subdirectory(${logger_SRC} ${logger_SRC}-build)
set(logger_lib log4cpp)
elseif (${PULSE_LOGGER} STREQUAL "log4cplus")
# log4cplus src should have been download to somewhere
if(NOT logger_SRC)
# It should be here if the outer build ran
set(logger_SRC ${CMAKE_BINARY_DIR}/../log4cplus/src/log4cplus)
endif()
set(log4cplus_HEADER ${logger_SRC}/include/log4cplus/logger.h)
if(NOT EXISTS ${log4cplus_HEADER})
message(FATAL_ERROR "I cannot find log4cplus source, please set logger_SRC to its root directory")
endif()
list(APPEND LOGGER_INCLUDE_DIR ${logger_SRC}/include)
list(APPEND LOGGER_INCLUDE_DIR ${logger_SRC}-build/include)
# Setting for log4cplus configuration
set(UNICODE OFF CACHE BOOL INTERNAL FORCE)
set(LOG4CPLUS_SINGLE_THREADED OFF CACHE BOOL INTERNAL FORCE)
set(LOG4CPLUS_BUILD_LOGGINGSERVER OFF CACHE BOOL INTERNAL FORCE)
set(LOG4CPLUS_BUILD_TESTING OFF CACHE BOOL INTERNAL FORCE)
set(LOG4CPLUS_ENABLE_DECORATED_LIBRARY_NAME OFF CACHE BOOL INTERNAL FORCE)
set(WITH_UNIT_TESTS OFF CACHE BOOL INTERNAL FORCE)
# Get log4cplus to install to a location so we can customize the install for Pulse
add_subdirectory(${logger_SRC} ${logger_SRC}-build)
set(logger_lib log4cplus)
endif()
if(PULSE_PYTHON_BINDINGS)
if(NOT pybind11_DIR)
set(pybind11_DIR ${CMAKE_BINARY_DIR}/../pybind11/install/share/cmake/pybind11)
endif()
find_package(pybind11 CONFIG REQUIRED)
endif()
# Include the rest of the Pulse projects
add_subdirectory(schema)
add_subdirectory(cdm)
add_subdirectory(engine)
add_subdirectory(test)
add_subdirectory(sdk)
add_subdirectory(verification)
# Various interfaces for different languages
add_subdirectory(src/c)
add_subdirectory(src/java)
add_subdirectory(src/python)
file(COPY ${CMAKE_SOURCE_DIR}/bin DESTINATION ${CMAKE_INSTALL_PREFIX})
configure_file(${CMAKE_SOURCE_DIR}/bin/run.cmake.in ${CMAKE_INSTALL_PREFIX}/bin/run.cmake @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/bin/run.config.in ${CMAKE_INSTALL_PREFIX}/bin/run.config @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/docs/Doxygen/full.doxy.in ${CMAKE_INSTALL_PREFIX}/bin/docs/full.doxy @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/cmake/PulseConfig.cmake.in ${CMAKE_INSTALL_PREFIX}/PulseConfig.cmake @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/bin/Rebase.py.in ${CMAKE_INSTALL_PREFIX}/bin/Rebase.py @ONLY)
# Pulse Testing
enable_testing()
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=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
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runPatientValidation
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=PatientValidation -P ${CMAKE_BINARY_DIR}/install/bin/run.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runVerification
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=VerificationScenarios -P ${CMAKE_BINARY_DIR}/install/bin/run.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runDrugValidation
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=ValidationDrugs -P ${CMAKE_BINARY_DIR}/install/bin/run.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
add_test(NAME runLongVerification
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=LongVerificationScenarios -P ${CMAKE_BINARY_DIR}/install/bin/run.cmake
WORKING_DIRECTORY ${INSTALL_BIN})
# TODO Make Doc generation a test too!
include(ExternalProject)
include(CMakeDetermineSystem)
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_GENERATION
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_GENERATOR_PLATFORM ${CMAKE_GENERATOR_PLATFORM}
CMAKE_GENERATOR_TOOLSET ${CMAKE_GENERATOR_TOOLSET}
CMAKE_GENERATOR_INSTANCE ${CMAKE_GENERATOR_INSTANCE}
)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_INSTALL_PREFIX})
if(NOT PULSE_SUPERBUILD_ALL_CFGS AND (MSVC OR XCode))
# For multi configuration IDE environments start with release
set(CMAKE_CONFIGURATION_TYPES Release CACHE STRING INTERNAL FORCE )
endif()
##################################
## EIGEN ##
## Used for general matrix math ##
##################################
message( STATUS "External project - Eigen" )
set(eigen_VERSION "3.3.7" )
set(eigen_SRC "${CMAKE_BINARY_DIR}/eigen/src/eigen")
set(eigen_Patch "${CMAKE_SOURCE_DIR}/cmake/eigen-patches")
set(Eigen3_DIR "${CMAKE_BINARY_DIR}/eigen/install")
ExternalProject_Add( eigen
PREFIX eigen
URL "https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz"
URL_HASH MD5=9e30f67e8531477de4117506fe44669b
#UPDATE_COMMAND
# COMMAND ${CMAKE_COMMAND} -Deigen_source=${eigen_SRC} -Deigen_patch=${eigen_Patch} -P ${eigen_Patch}/Patch.cmake
INSTALL_DIR "${Eigen3_DIR}"
${CMAKE_GENERATION}
CMAKE_ARGS
-DCMAKE_TOOLCHAIN_FILE:FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF
-DCMAKE_INSTALL_PREFIX:STRING=${Eigen3_DIR}
-DINCLUDE_INSTALL_DIR:STRING=${Eigen3_DIR}/include
)
list(APPEND Pulse_DEPENDENCIES eigen)
# Install Headers
message(STATUS "Eigen is here : ${eigen_SRC}" )
# Loggers are built in the Inner build
# It will be easier to switch cofigurations in MSVC/XCode
set(PULSE_LOGGER "simple" CACHE STRING "Select Logger Library")
set(AVAILABLE_PULSE_LOGGERS "simple;log4cpp;log4cplus" CACHE INTERNAL "List of available loggers")
set_property(CACHE PULSE_LOGGER PROPERTY STRINGS ${AVAILABLE_PULSE_LOGGERS})
set(logger_SRC)
if (${PULSE_LOGGER} STREQUAL "log4cpp")
###################################################
## log4cpp ##
## General logging utility ##
###################################################
message( STATUS "External project - log4cpp" )
set(logger_SRC "${CMAKE_BINARY_DIR}/log4cpp/src/log4cpp" CACHE INTERNAL "Log4cpp Source")
if(UNIX)
set(CONFIGURE "./configure")
endif()
ExternalProject_Add( log4cpp
PREFIX log4cpp
URL "https://data.kitware.com/api/v1/file/5d577c0e85f25b11ff34dbf8/download"
URL_HASH MD5=b9e2cee932da987212f2c74b767b4d8b
#GIT_REPOSITORY "https://github.com/log4cplus/log4cpp.git"
#GIT_TAG 411a262b92a7bdc26348d6ae6b15f76763c21b44
#GIT_SHALLOW TRUE
${CMAKE_GENERATION}
UPDATE_COMMAND
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/log4cpp-patches/CMakeLists.txt ${logger_SRC}/CMakeLists.txt
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/log4cpp-patches/config.guess ${logger_SRC}/config/config.guess
#COMMAND ${CONFIGURE}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
list(APPEND Pulse_DEPENDENCIES log4cpp)
elseif(${PULSE_LOGGER} STREQUAL "log4cplus")
###################################################
## log4cplus ##
## General logging utility ##
###################################################
message( STATUS "External project - log4cplus" )
set(logger_SRC "${CMAKE_BINARY_DIR}/log4cplus/src/log4cplus" CACHE INTERNAL "Log4cplus Source")
ExternalProject_Add( log4cplus
PREFIX log4cplus
URL "https://github.com/log4cplus/log4cplus/releases/download/REL_2_0_4/log4cplus-2.0.4.zip"
URL_HASH MD5=cb075cd19ce561273b1c74907cc66b6a
#GIT_REPOSITORY "https://github.com/log4cplus/log4cplus.git"
#GIT_TAG 411a262b92a7bdc26348d6ae6b15f76763c21b44
# GIT_SHALLOW TRUE
# Build this in the Inner build
# It will be easier to switch cofigurations in MSVC/XCode
${CMAKE_GENERATION}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
list(APPEND Pulse_DEPENDENCIES log4cplus)
endif()
###################################################
## Google Proto Buffers ##
## Multi-language serialization ##
###################################################
message( STATUS "External project - protobuf" )
set(protobuf_URL "https://github.com/protocolbuffers/protobuf/releases/download/v3.10.1/protobuf-all-3.10.1.zip")
set(protobuf_MD5 "bbdac9517e4d92088d520dbc8a48098b" )
set(protobuf_SRC "${CMAKE_BINARY_DIR}/protobuf/src/protobuf")
set(protobuf_DIR "${CMAKE_BINARY_DIR}/protobuf/install")
set(protobuf_Patch "${CMAKE_SOURCE_DIR}/cmake/protobuf-patches")
message(STATUS "Patching protobuf ${PULSE_IL2CPP_PATCH}")
ExternalProject_Add( protobuf
PREFIX protobuf
URL ${protobuf_URL}
URL_MD5 ${protobuf_MD5}
DOWNLOAD_DIR ${protobuf_SRC}
SOURCE_SUBDIR ./cmake
UPDATE_COMMAND
COMMAND ${CMAKE_COMMAND} -DPULSE_IL2CPP_PATCH=${PULSE_IL2CPP_PATCH} -Dprotobuf_source=${protobuf_SRC} -Dprotobuf_patch=${protobuf_Patch} -P ${protobuf_Patch}/Patch.cmake
${CMAKE_GENERATION}
CMAKE_ARGS
-DCMAKE_TOOLCHAIN_FILE:FILE=${CMAKE_TOOLCHAIN_FILE}
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX:STRING=${protobuf_DIR}
-Dprotobuf_BUILD_TESTS:BOOL=OFF
-Dprotobuf_BUILD_EXAMPLES:BOOL=OFF
-Dprotobuf_BUILD_SHARED_LIBS:BOOL=OFF
-Dprotobuf_MSVC_STATIC_RUNTIME:BOOL=OFF#Don't change MSVC runtime settings (/MD or /MT)
-Dprotobuf_WITH_ZLIB:BOOL=OFF
)
list(APPEND Pulse_DEPENDENCIES protobuf)
message(STATUS "protobuf is here : ${protobuf_SRC}" )
if(WIN32)
##########################################
## DIRENT ##
## Platform generic file system utility,##
## that is not included in msvc/mingw ##
##########################################
message( STATUS "External project - dirent" )
set(dirent_DIR "${CMAKE_BINARY_DIR}/dirent/src/dirent")
set(dirent_MD5 "cf5b4499d163604732f4dc91654056be" )
ExternalProject_Add( dirent
PREFIX dirent
URL "https://github.com/tronkko/dirent/archive/1.22.zip"
URL_MD5 ${dirent_MD5}
${CMAKE_GENERATION}
CMAKE_ARGS
-DCMAKE_TOOLCHAIN_FILE:FILE=${CMAKE_TOOLCHAIN_FILE}
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}
-DINCLUDE_INSTALL_DIR:STRING=${CMAKE_INSTALL_PREFIX}/include
)
message(STATUS "dirent is here : ${dirent_DIR}" )
list(APPEND Pulse_DEPENDENCIES dirent)
endif()
###################################################
## PyBind11 ##
## Creation of Pulse Python Bindings ##
###################################################
if(PULSE_PYTHON_BINDINGS)
message( STATUS "External project - pybind11" )
set(pybind11_install "${CMAKE_BINARY_DIR}/pybind11/install/")
set(pybind11_version "2.4.3")
set(pybind11_url "https://github.com/pybind/pybind11/archive/v${pybind11_version}.tar.gz")
set(pybind11_md5 "62254c40f89925bb894be421fe4cdef2")
ExternalProject_Add(pybind11
PREFIX pybind11
URL ${pybind11_url}
URL_MD5 ${pybind11_md5}
DOWNLOAD_NAME ${pybind11_dlname}
${CMAKE_GENERATION}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${pybind11_install}
-DPYBIND11_TEST:BOOL=OFF
-DPYBIND11_PYTHON_VERSION=3.6
-DPYBIND11_CPP_STANDARD:STRING=/std:c++11
)
set(pybind11_DIR "${pybind11_install}/share/cmake/pybind11")
message(STATUS "pybind11 is here : ${pybind11_DIR}" )
list(APPEND Pulse_DEPENDENCIES pybind11)
endif()
# ExternalProject_Add doesn't like to work with lists: it keeps only the first element
string(REPLACE ";" "::" CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH}")
# Generate the Pulse project after dependencies have been built
ExternalProject_Add( Pulse
PREFIX Pulse
DEPENDS ${Pulse_DEPENDENCIES}
DOWNLOAD_COMMAND ""
DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}
SOURCE_DIR ${CMAKE_SOURCE_DIR}
BINARY_DIR ${CMAKE_BINARY_DIR}/Pulse
${CMAKE_GENERATION}
CMAKE_ARGS
-DCMAKE_TOOLCHAIN_FILE:FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}
-DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
# Pulse Specific
-DPULSE_SUPERBUILD:BOOL=OFF
-DPULSE_BUILD_JAVA_UTILS:BOOL=${PULSE_BUILD_JAVA_UTILS}
-DPULSE_BUILD_CLR:BOOL=${PULSE_BUILD_CLR}
-DPULSE_LOGGER:STRING=${PULSE_LOGGER}
-DPULSE_PYTHON_BINDINGS:BOOL=${PULSE_PYTHON_BINDINGS}
-Deigen_DIR:PATH=${eigen_DIR}
# Let InnerBuild build and install these
-Dlogger_SRC:PATH=${logger_SRC}
-Dprotobuf_SRC:PATH=${protobuf_SRC}
-Dprotobuf_DIR:PATH=${protobuf_DIR}
)
# Need Java Utils to generate data
if (PULSE_BUILD_JAVA_UTILS)
add_custom_target(PulseData ALL)
add_dependencies(PulseData Pulse)
add_custom_command(TARGET PulseData POST_BUILD
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=genData -P run.cmake
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)
# Don't genStates if in Debug, takes way too long
string(APPEND _genStates
"$<IF:$<CONFIG:Debug>,"
"${CMAKE_COMMAND};-E;echo;!!! NOT GENERATING STATES FOR DEBUG BUILDS !!!,"
"${CMAKE_COMMAND};-DTYPE:STRING=genStates;-P;run.cmake"
">")
add_custom_command(TARGET PulseData POST_BUILD
COMMAND "${_genStates}"
COMMAND_EXPAND_LISTS
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)
else()
message(WARNING "Without Java Utils, this build will not generate required data files needed for Pulse to execute")
message(WARNING "You will need to get these required data files from another build/source")
endif()
if(PULSE_DOWNLOAD_BASELINES)
message(STATUS "I am going to pull the latest Pulse Baselines!")
add_custom_command(TARGET PulseData POST_BUILD
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=updateBaselines -P run.cmake WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)
else()
message(STATUS "I am NOT going to pull the latest Pulse Baselines!")
endif()
......@@ -104,7 +104,7 @@ elseif(TYPE STREQUAL "doxygen")
setup_landing_page(news.html)
elseif(TYPE STREQUAL "protoc")
file(REMOVE @SCHEMA_DST@/schema_last_built)
execute_process(COMMAND ${CMAKE_COMMAND} -DSRC_ROOT:PATH=@SRC_ROOT@ -Dprotobuf_SRC:PATH=@protobuf_SRC@ -Dprotobuf_DIR:PATH=@protobuf_DIR@ -DSCHEMA_SRC:STRING=@SCHEMA_SRC@ -DSCHEMA_DST:STRING=@SCHEMA_DST@ -P "@CMAKE_SOURCE_DIR@/schema/GenerateCDMBindings.cmake")
execute_process(COMMAND ${CMAKE_COMMAND} -DSRC_ROOT:PATH=@SRC_ROOT@ -DSCHEMA_SRC:STRING=@SCHEMA_SRC@ -Dprotobuf_SRC:PATH=@protobuf_SRC@ -Dprotobuf_DIR:PATH=@protobuf_DIR@ -P "@CMAKE_SOURCE_DIR@/schema/GenerateCDMBindings.cmake")
elseif(TYPE STREQUAL "updateBaselines")
execute_process(COMMAND ${CMAKE_COMMAND} --build "@CMAKE_CURRENT_BINARY_DIR@" --target UpdateVerification)
elseif(TYPE STREQUAL "rebase")
......
......@@ -3,7 +3,7 @@
root_dir=@CMAKE_SOURCE_DIR@/
data_dir=@CMAKE_SOURCE_DIR@/data
scenario_dir=@CMAKE_SOURCE_DIR@/test/scenarios
test_config_dir=@CMAKE_SOURCE_DIR@/test/config
validation_dir=@CMAKE_SOURCE_DIR@/test/validation
scenario_dir=@CMAKE_SOURCE_DIR@/data/human/adult/scenarios
test_config_dir=@CMAKE_SOURCE_DIR@/data/human/adult
validation_dir=@CMAKE_SOURCE_DIR@/data/human/adult/validation
verification_dir=@CMAKE_INSTALL_PREFIX@/bin/verification
\ No newline at end of file
This diff is collapsed.
include(${CMAKE_CURRENT_SOURCE_DIR}/CDM.cmake)
\ No newline at end of file
set( _cur_dir cpp/io/protobuf)
set( IO_PB_CDM_FILES ${_cur_dir}/PBUtils.h
${_cur_dir}/PBUtils.cpp
${_cur_dir}/PBActions.h
${_cur_dir}/PBActions.cpp
${_cur_dir}/PBActionEnums.cpp
${_cur_dir}/PBAnesthesiaMachine.h
${_cur_dir}/PBAnesthesiaMachine.cpp
${_cur_dir}/PBAnesthesiaMachineActions.h
${_cur_dir}/PBAnesthesiaMachineActions.cpp
${_cur_dir}/PBAnesthesiaMachineEnums.cpp
${_cur_dir}/PBCircuit.h
${_cur_dir}/PBCircuit.cpp
${_cur_dir}/PBCompartment.h
${_cur_dir}/PBCompartment.cpp
${_cur_dir}/PBCompartmentEnums.cpp
${_cur_dir}/PBConditions.h
${_cur_dir}/PBConditions.cpp
${_cur_dir}/PBElectroCardioGram.h
${_cur_dir}/PBElectroCardioGram.cpp
${_cur_dir}/PBElectroCardioGramEnums.cpp
${_cur_dir}/PBEngine.h
${_cur_dir}/PBEngine.cpp
${_cur_dir}/PBEngineEnums.cpp
${_cur_dir}/PBEnums.cpp
${_cur_dir}/PBEvents.h
${_cur_dir}/PBEvents.cpp
${_cur_dir}/PBEnvironment.h
${_cur_dir}/PBEnvironment.cpp
${_cur_dir}/PBEnvironmentActions.h
${_cur_dir}/PBEnvironmentActions.cpp
${_cur_dir}/PBEnvironmentConditions.h
${_cur_dir}/PBEnvironmentConditions.cpp
${_cur_dir}/PBEnvironmentEnums.cpp
${_cur_dir}/PBInhaler.h
${_cur_dir}/PBInhaler.cpp
${_cur_dir}/PBInhalerActions.h
${_cur_dir}/PBInhalerActions.cpp
${_cur_dir}/PBPatient.h
${_cur_dir}/PBPatient.cpp
${_cur_dir}/PBPatientEnums.cpp
${_cur_dir}/PBPatientActions.cpp
${_cur_dir}/PBPatientActions.h
${_cur_dir}/PBPatientActionEnums.cpp
${_cur_dir}/PBPatientAssessments.cpp
${_cur_dir}/PBPatientAssessments.h
${_cur_dir}/PBPatientAssessmentEnums.cpp
${_cur_dir}/PBPatientConditions.cpp
${_cur_dir}/PBPatientConditions.h
${_cur_dir}/PBPatientNutrition.h
${_cur_dir}/PBPatientNutrition.cpp
${_cur_dir}/PBPhysiology.h
${_cur_dir}/PBPhysiology.cpp
${_cur_dir}/PBPhysiologyEnums.cpp
${_cur_dir}/PBProperties.h
${_cur_dir}/PBProperties.cpp
${_cur_dir}/PBScenario.h
${_cur_dir}/PBScenario.cpp
${_cur_dir}/PBSubstance.h
${_cur_dir}/PBSubstance.cpp
${_cur_dir}/PBSubstanceEnums.cpp
${_cur_dir}/PBSubstanceQuantity.h
${_cur_dir}/PBSubstanceQuantity.cpp
${_cur_dir}/PBTestReport.h
${_cur_dir}/PBTestReport.cpp
)
source_group("IO\\Protobuf" FILES ${IO_PB_CDM_FILES})
list(APPEND SOURCE ${IO_PB_CDM_FILES})
......@@ -95,6 +95,7 @@ ExternalProject_Add( ${PROJECT_NAME}
#INSTALL_COMMAND ${SKIP_STEP_COMMAND}
DEPENDS ${${PROJECT_NAME}_DEPENDENCIES}
)
set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER ${PROJECT_NAME})
# Need Java Utils to generate data
if (${PROJECT_NAME}_JAVA_API)
......@@ -113,6 +114,7 @@ if (${PROJECT_NAME}_JAVA_API)
COMMAND "${_genStates}"
COMMAND_EXPAND_LISTS
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)
set_target_properties (PulseData PROPERTIES FOLDER ${PROJECT_NAME})
else()
message(WARNING "Without Java Utils, this build will not generate required data files needed for Pulse to execute")
message(WARNING "You will need to get these required data files from another build/source")
......@@ -123,6 +125,7 @@ if(${PROJECT_NAME}_DOWNLOAD_BASELINES)
add_custom_command(TARGET PulseData POST_BUILD
COMMAND ${CMAKE_COMMAND} -DTYPE:STRING=updateBaselines -P run.cmake WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)
set_target_properties (PulseData PROPERTIES FOLDER ${PROJECT_NAME})
else()
message(STATUS "NOT pulling the latest Pulse Baselines!")
endif()
......@@ -12,10 +12,15 @@ function(add_executable_ex target)
FOLDER ${PROJECT_NAME})