Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f148fc7c34 | ||
|
|
6e4fcafbc3 |
@@ -13,7 +13,6 @@ Morrison, Christopher Sean (sean, morrison, brlcad)
|
||||
Paviot, Thomas (tpaviot)
|
||||
Pictor, Mark (mpictor)
|
||||
Thomas, Dawn (homovulgaris, madant)
|
||||
Wouters, Dave (davyw)
|
||||
Yapp, Clifford (starseeker)
|
||||
|
||||
Special thanks:
|
||||
|
||||
+105
-195
@@ -38,61 +38,36 @@
|
||||
# This file contains the top level CMakeLists.txt logic for the
|
||||
# SCL software package.
|
||||
|
||||
PROJECT(SCL)
|
||||
|
||||
# SCL version
|
||||
SET(SCL_VERSION_MAJOR 0)
|
||||
SET(SCL_VERSION_MINOR 5-dev)
|
||||
SET(SCL_VERSION ${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR})
|
||||
|
||||
# SCL ABI version. SCL_ABI_SOVERSION should be incremented
|
||||
# for each release introducing API incompatibilities
|
||||
SET(SCL_ABI_SOVERSION 2)
|
||||
SET(SCL_ABI_VERSION ${SCL_ABI_SOVERSION}.0.0)
|
||||
|
||||
# Minimum required version of CMake
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||
IF(COMMAND CMAKE_POLICY)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
CMAKE_POLICY(SET CMP0003 NEW)
|
||||
ENDIF(COMMAND CMAKE_POLICY)
|
||||
|
||||
IF( NOT DEFINED SCL_BUILD_TYPE )
|
||||
SET( SCL_BUILD_TYPE "Debug" CACHE STRING "Build type" ) # By default set debug build
|
||||
ENDIF( NOT DEFINED SCL_BUILD_TYPE )
|
||||
IF(NOT SCL_IS_SUBBUILD)
|
||||
SET(CMAKE_BUILD_TYPE ${SCL_BUILD_TYPE} CACHE INTERNAL "Build type, immutable" FORCE )
|
||||
ELSE(NOT SCL_IS_SUBBUILD)
|
||||
SET(CMAKE_BUILD_TYPE ${SCL_BUILD_TYPE} )
|
||||
ENDIF(NOT SCL_IS_SUBBUILD)
|
||||
# set CMake project name
|
||||
PROJECT(SCL)
|
||||
|
||||
# Define helper macro OPTION_WITH_DEFAULT
|
||||
MACRO( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
|
||||
IF( NOT DEFINED ${OPTION_NAME} )
|
||||
SET( ${OPTION_NAME} ${OPTION_DEFAULT} )
|
||||
ENDIF( NOT DEFINED ${OPTION_NAME} )
|
||||
OPTION( ${OPTION_NAME} "${OPTION_STRING}" ${${OPTION_NAME}} )
|
||||
ENDMACRO( OPTION_WITH_DEFAULT OPTION_NAME OPTION_STRING OPTION_DEFAULT )
|
||||
if( CMAKE_BUILD_TYPE STREQUAL "" )
|
||||
message( "-- Debug build - to override, rerun cmake with '-DCMAKE_BUILD_TYPE=Release'." )
|
||||
set( CMAKE_BUILD_TYPE Debug )
|
||||
endif()
|
||||
|
||||
# build shared libs by default
|
||||
OPTION_WITH_DEFAULT(SCL_BUILD_SHARED_LIBS "Build shared libs" ON )
|
||||
OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON)
|
||||
|
||||
# don't build static libs by default
|
||||
OPTION_WITH_DEFAULT(SCL_BUILD_STATIC_LIBS "Build static libs" OFF)
|
||||
# build static libs by default
|
||||
OPTION(BUILD_STATIC_LIBS "Build static libraries" OFF)
|
||||
|
||||
OPTION_WITH_DEFAULT(SCL_PYTHON_GENERATOR "Compile fedex_python" ON)
|
||||
OPTION_WITH_DEFAULT(SCL_CPP_GENERATOR "Compile fedex_plus" ON)
|
||||
|
||||
OPTION_WITH_DEFAULT(SCL_MEMMGR_ENABLE_CHECKS "Enable scl_memmgr's memory leak detection" OFF)
|
||||
OPTION_WITH_DEFAULT(SCL_TRACE_FPRINTF "Enable extra comments in generated code so the code's source in fedex_plus may be located" OFF)
|
||||
# Set version
|
||||
SET(SCL_VERSION_MAJOR "3")
|
||||
SET(SCL_VERSION_MINOR "2")
|
||||
SET(SCL_VERSION_PATCH "0")
|
||||
SET(SCL_VERSION "${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR}.${SCL_VERSION_PATCH}")
|
||||
|
||||
# CMake derives much of its functionality from modules, typically
|
||||
# stored in one directory - let CMake know where to find them.
|
||||
SET(SCL_CMAKE_DIR "${SCL_SOURCE_DIR}/cmake")
|
||||
if(NOT IS_SUBBUILD)
|
||||
SET(CMAKE_MODULE_PATH "${SCL_CMAKE_DIR};${CMAKE_MODULE_PATH}")
|
||||
else(NOT IS_SUBBUILD)
|
||||
SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${SCL_CMAKE_DIR}")
|
||||
endif(NOT IS_SUBBUILD)
|
||||
SET(CMAKE_MODULE_PATH "${SCL_CMAKE_DIR};${CMAKE_MODULE_PATH}")
|
||||
|
||||
INCLUDE(${SCL_CMAKE_DIR}/SCL_Utils.cmake)
|
||||
|
||||
@@ -102,89 +77,91 @@ SET(_orig_lc_all $ENV{LC_ALL})
|
||||
SET(_orig_lc_messages $ENV{LC_MESSAGES})
|
||||
SET(_orig_lang $ENV{LANG})
|
||||
IF(_orig_lc_all)
|
||||
SET(ENV{LC_ALL} C)
|
||||
SET(ENV{LC_ALL} C)
|
||||
ENDIF(_orig_lc_all)
|
||||
IF(_orig_lc_messages)
|
||||
SET(ENV{LC_MESSAGES} C)
|
||||
SET(ENV{LC_MESSAGES} C)
|
||||
ENDIF(_orig_lc_messages)
|
||||
IF(_orig_lang)
|
||||
SET(ENV{LANG} C)
|
||||
SET(ENV{LANG} C)
|
||||
ENDIF(_orig_lang)
|
||||
|
||||
# For NFS volumes, to ensure proper file creation.
|
||||
IF(NOT WIN32)
|
||||
IF(NOT UMASK)
|
||||
EXEC_PROGRAM(umask ARGS 022 OUTPUT_VARIABLE exec_out)
|
||||
ELSE(NOT UMASK)
|
||||
EXEC_PROGRAM(umask ARGS ${UMASK} OUTPUT_VARIABLE exec_out)
|
||||
ENDIF(NOT UMASK)
|
||||
ENDIF(NOT WIN32)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Testing option
|
||||
OPTION_WITH_DEFAULT( SCL_ENABLE_TESTING "Enable unittesting framework" OFF )
|
||||
IF(SCL_ENABLE_TESTING)
|
||||
if( NOT DEFINED SCL_BUILD_SCHEMAS )
|
||||
set( SCL_BUILD_SCHEMAS "ALL" ) #test all schemas, unless otherwise specified
|
||||
endif()
|
||||
INCLUDE(CTest)
|
||||
ENABLE_TESTING()
|
||||
ENDIF(SCL_ENABLE_TESTING)
|
||||
OPTION( ENABLE_TESTING "Enable unittesting framework" OFF )
|
||||
IF(ENABLE_TESTING)
|
||||
set( CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage" ) #for code coverage
|
||||
set( CMAKE_SHARED_LINKER_FLAGS "-fprofile-arcs -ftest-coverage" )
|
||||
if( NOT DEFINED BUILD_SCHEMAS )
|
||||
set( BUILD_SCHEMAS "ALL" ) #test all schemas, unless otherwise specified
|
||||
endif()
|
||||
INCLUDE(CTest)
|
||||
ENABLE_TESTING()
|
||||
ENDIF(ENABLE_TESTING)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Coverage option
|
||||
OPTION_WITH_DEFAULT( SCL_ENABLE_COVERAGE "Enable code coverage test" OFF )
|
||||
IF(SCL_ENABLE_COVERAGE)
|
||||
SET(SCL_ENABLE_TESTING ON CACHE BOOL "Testing enabled by coverage option" FORCE)
|
||||
# build static libs, better coverage report
|
||||
SET(SCL_BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE )
|
||||
SET(SCL_BUILD_STATIC_LIBS ON CACHE BOOL "Build static libs" FORCE )
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
|
||||
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
|
||||
SET(CMAKE_MODULE_LINKER_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage" CACHE STRING "Extra linker flags required by code coverage" FORCE)
|
||||
SET(SCL_BUILD_TYPE "Debug" CACHE STRING "Build type required by testing framework" FORCE)
|
||||
ENDIF(SCL_ENABLE_COVERAGE)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# The following logic is what allows binaries to run successfully in
|
||||
# the build directory AND install directory. Thanks to plplot for
|
||||
# The following logic is what allows binaries to run successfully in
|
||||
# the build directory AND install directory. Thanks to plplot for
|
||||
# identifying the necessity of setting CMAKE_INSTALL_NAME_DIR on OSX.
|
||||
# Documentation of these options is available at
|
||||
# http://www.cmake.org/Wiki/CMake_RPATH_handling
|
||||
|
||||
# use, i.e. don't skip the full RPATH for the build tree
|
||||
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
|
||||
# when building, don't use the install RPATH already
|
||||
# (but later on when installing)
|
||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
||||
# the RPATH/INSTALL_NAME_DIR to be used when installing
|
||||
if (NOT APPLE)
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
|
||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
endif(NOT APPLE)
|
||||
# On OSX, we need to set INSTALL_NAME_DIR instead of RPATH
|
||||
# http://www.cmake.org/cmake/help/cmake-2-8-docs.html#variable:CMAKE_INSTALL_NAME_DIR
|
||||
set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
|
||||
# add the automatically determined parts of the RPATH which point to
|
||||
# add the automatically determined parts of the RPATH which point to
|
||||
# directories outside the build tree to the install RPATH
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Output directories.
|
||||
IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
IF(WIN32)
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
ELSE(WIN32)
|
||||
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
|
||||
IF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
|
||||
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
|
||||
ENDIF(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
|
||||
IF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
|
||||
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
|
||||
ENDIF(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
|
||||
FOREACH(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
|
||||
STRING(TOUPPER "${CFG_TYPE}" CFG_TYPE)
|
||||
IF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
ENDIF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
IF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
|
||||
ENDIF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
IF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
|
||||
ENDIF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
STRING(TOUPPER "${CFG_TYPE}" CFG_TYPE)
|
||||
IF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
IF(WIN32)
|
||||
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
ELSE(WIN32)
|
||||
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all libraries.")
|
||||
ENDIF(WIN32)
|
||||
ENDIF(NOT "CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
IF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/lib CACHE INTERNAL "Single output directory for building all archives.")
|
||||
ENDIF(NOT "CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
IF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}" ${SCL_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
|
||||
ENDIF(NOT "CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE}")
|
||||
ENDFOREACH()
|
||||
|
||||
|
||||
@@ -194,46 +171,33 @@ ENDFOREACH()
|
||||
# The location in which to install SCL. Need a good Debug location
|
||||
# for Windows. Only do this if CMAKE_INSTALL_PREFIX hasn't been set
|
||||
# already, to try and allow parent builds (if any) some control.
|
||||
if(NOT SCL_IS_SUBBUILD)
|
||||
IF(NOT WIN32)
|
||||
IF (${CMAKE_BUILD_TYPE} MATCHES "Debug")
|
||||
SET(SCL_INSTALL_PREFIX "${SCL_SOURCE_DIR}/../scl-install")
|
||||
ELSE()
|
||||
SET(SCL_INSTALL_PREFIX "/usr/local")
|
||||
ENDIF()
|
||||
ENDIF(NOT WIN32)
|
||||
SET( SCL_INSTALL_PREFIX ${SCL_INSTALL_PREFIX} CACHE
|
||||
PATH "Install prefix prepended to target to create install location" )
|
||||
SET( CMAKE_INSTALL_PREFIX ${SCL_INSTALL_PREFIX} CACHE INTERNAL "Prefix prepended to install directories if target destination is not absolute, immutable" FORCE )
|
||||
endif(NOT SCL_IS_SUBBUILD)
|
||||
IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
IF(NOT WIN32)
|
||||
IF ("${CMAKE_BUILD_TYPE}" MATCHES "Release")
|
||||
SET(CMAKE_INSTALL_PREFIX "/usr")
|
||||
ELSEIF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
|
||||
SET(CMAKE_INSTALL_PREFIX "${SCL_SOURCE_DIR}/../scl-install")
|
||||
MESSAGE("--- Setting debug install dir to ${CMAKE_INSTALL_PREFIX}")
|
||||
ELSE("${CMAKE_BUILD_TYPE}" MATCHES "Release")
|
||||
SET(CMAKE_INSTALL_PREFIX "/usr/local")
|
||||
ENDIF ("${CMAKE_BUILD_TYPE}" MATCHES "Release")
|
||||
ENDIF(NOT WIN32)
|
||||
SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "SCL install prefix" FORCE)
|
||||
SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 0)
|
||||
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
|
||||
OPTION(SCL_BUILD_EXPRESS_ONLY "Only build express parser." OFF)
|
||||
MARK_AS_ADVANCED(SCL_BUILD_EXPRESS_ONLY)
|
||||
OPTION(SCL-BUILD_EXPRESS_ONLY "Only build express parser." OFF)
|
||||
MARK_AS_ADVANCED(SCL-BUILD_EXPRESS_ONLY)
|
||||
|
||||
# Take the scl config file template as the starting point for
|
||||
# scl_cf.h.in - scripts may need to append to the template, so
|
||||
# it is read into memory initially.
|
||||
# Take the scl config file template and copy it to the build directory so CMake
|
||||
# scripts can append to it if need be
|
||||
configure_file(${SCL_SOURCE_DIR}/include/scl_cf_cmake.h.in ${SCL_BINARY_DIR}/include/scl_cf.h.in COPYONLY)
|
||||
SET(CONFIG_H_FILE ${SCL_BINARY_DIR}/include/scl_cf.h.in)
|
||||
set(CMAKE_CURRENT_PROJECT SCL)
|
||||
define_property(GLOBAL PROPERTY SCL_CONFIG_H_CONTENTS BRIEF_DOCS "config.h.in contents" FULL_DOCS "config.h.in contents for SCL project")
|
||||
if(NOT COMMAND CONFIG_H_APPEND)
|
||||
macro(CONFIG_H_APPEND PROJECT_NAME NEW_CONTENTS)
|
||||
if(PROJECT_NAME)
|
||||
get_property(${PROJECT_NAME}_CONFIG_H_CONTENTS GLOBAL PROPERTY ${PROJECT_NAME}_CONFIG_H_CONTENTS)
|
||||
set(${PROJECT_NAME}_CONFIG_H_FILE_CONTENTS "${${PROJECT_NAME}_CONFIG_H_CONTENTS}${NEW_CONTENTS}")
|
||||
set_property(GLOBAL PROPERTY ${PROJECT_NAME}_CONFIG_H_CONTENTS "${${PROJECT_NAME}_CONFIG_H_FILE_CONTENTS}")
|
||||
endif(PROJECT_NAME)
|
||||
endmacro(CONFIG_H_APPEND NEW_CONTENTS)
|
||||
endif(NOT COMMAND CONFIG_H_APPEND)
|
||||
file(READ ${SCL_SOURCE_DIR}/include/scl_cf_cmake.h.in CONFIG_H_FILE_CONTENTS)
|
||||
CONFIG_H_APPEND(SCL "${CONFIG_H_FILE_CONTENTS}")
|
||||
|
||||
INCLUDE(CheckLibraryExists)
|
||||
INCLUDE(CheckIncludeFile)
|
||||
INCLUDE(CheckFunctionExists)
|
||||
INCLUDE(CheckTypeSize)
|
||||
INCLUDE(CMakePushCheckState)
|
||||
INCLUDE(CheckCXXSourceRuns)
|
||||
INCLUDE(${SCL_CMAKE_DIR}/FindLEX.cmake)
|
||||
INCLUDE(${SCL_CMAKE_DIR}/FindYACC.cmake)
|
||||
|
||||
@@ -255,110 +219,56 @@ CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
|
||||
|
||||
CHECK_TYPE_SIZE("ssize_t" SSIZE_T)
|
||||
|
||||
set( TEST_STD_THREAD "
|
||||
#include <iostream>
|
||||
#include <thread>
|
||||
void do_work() {
|
||||
std::cout << \"thread\" << std::endl;
|
||||
}
|
||||
int main() {
|
||||
std::thread t(do_work);
|
||||
t.join();
|
||||
}
|
||||
" )
|
||||
cmake_push_check_state()
|
||||
if( UNIX )
|
||||
set( CMAKE_REQUIRED_FLAGS "-pthread -std=c++0x" )
|
||||
else( UNIX )
|
||||
# vars probably need set for MSVC11, embarcadero, etc
|
||||
endif( UNIX )
|
||||
CHECK_CXX_SOURCE_RUNS( "${TEST_STD_THREAD}" HAVE_STD_THREAD ) #quotes are *required*!
|
||||
cmake_pop_check_state()
|
||||
|
||||
# Now that all the tests are done, configure the scl_cf.h file:
|
||||
get_property(CONFIG_H_FILE_CONTENTS GLOBAL PROPERTY SCL_CONFIG_H_CONTENTS)
|
||||
file(WRITE ${CONFIG_H_FILE} "${CONFIG_H_FILE_CONTENTS}")
|
||||
configure_file(${CONFIG_H_FILE} ${SCL_BINARY_DIR}/include/scl_cf.h)
|
||||
configure_file(${SCL_BINARY_DIR}/include/scl_cf.h.in ${SCL_BINARY_DIR}/include/scl_cf.h)
|
||||
|
||||
################ create scl_version_string.h, http://stackoverflow.com/questions/3780667
|
||||
# Using 'ver_string' instead of 'scl_version_string.h' is a trick to force the
|
||||
# command to always execute when the custom target is built. It works because
|
||||
# a file by that name never exists.
|
||||
configure_file(${SCL_CMAKE_DIR}/scl_version_string.cmake ${SCL_BINARY_DIR}/scl_version_string.cmake @ONLY)
|
||||
add_custom_target(version_string ALL DEPENDS ver_string )
|
||||
add_custom_target(version_string ALL
|
||||
DEPENDS ver_string )
|
||||
# creates scl_version_string.h using cmake script
|
||||
add_custom_command(OUTPUT ver_string ${CMAKE_CURRENT_BINARY_DIR}/include/scl_version_string.h
|
||||
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${SCL_SOURCE_DIR}
|
||||
-DBINARY_DIR=${SCL_BINARY_DIR}
|
||||
-P ${SCL_BINARY_DIR}/scl_version_string.cmake)
|
||||
-P ${SCL_CMAKE_DIR}/scl_version_string.cmake)
|
||||
# scl_version_string.h is a generated file
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/include/scl_version_string.h
|
||||
PROPERTIES GENERATED TRUE
|
||||
HEADER_FILE_ONLY TRUE )
|
||||
PROPERTIES GENERATED TRUE
|
||||
HEADER_FILE_ONLY TRUE )
|
||||
################
|
||||
|
||||
if(MSVC)
|
||||
# add_definitions( -Wall )
|
||||
add_definitions( -D__MSVC__ -D__WIN32__ )
|
||||
# Disable warning for preferred usage of secure functions (example strcpy should be strcpy_s, ...)
|
||||
add_definitions( -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS )
|
||||
# add_definitions( -Wall )
|
||||
add_definitions( -D__MSVC__ -D__WIN32__ )
|
||||
# Disable warning for preferred usage of secure functions (example strcpy should be strcpy_s, ...)
|
||||
add_definitions( -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS )
|
||||
elseif(BORLAND)
|
||||
add_definitions( -D__BORLAND__ -D__WIN32__ )
|
||||
add_definitions( -D__BORLAND__ -D__WIN32__ )
|
||||
else()
|
||||
add_definitions( -pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long )
|
||||
add_definitions( -pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long )
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${SCL_SOURCE_DIR}/include
|
||||
${SCL_BINARY_DIR}/include
|
||||
)
|
||||
${SCL_SOURCE_DIR}/include
|
||||
${SCL_BINARY_DIR}/include
|
||||
)
|
||||
|
||||
ADD_SUBDIRECTORY(src/base)
|
||||
ADD_SUBDIRECTORY(src/express)
|
||||
ADD_SUBDIRECTORY(src/exppp)
|
||||
ADD_SUBDIRECTORY(src/fedex_plus)
|
||||
ADD_SUBDIRECTORY(src/fedex_python)
|
||||
ADD_SUBDIRECTORY(src/clstepcore)
|
||||
ADD_SUBDIRECTORY(src/cleditor)
|
||||
ADD_SUBDIRECTORY(src/cldai)
|
||||
ADD_SUBDIRECTORY(src/clutils)
|
||||
ADD_SUBDIRECTORY(include)
|
||||
ADD_SUBDIRECTORY(data)
|
||||
IF(SCL_ENABLE_TESTING)
|
||||
ADD_SUBDIRECTORY( test )
|
||||
ENDIF(SCL_ENABLE_TESTING)
|
||||
IF(ENABLE_TESTING)
|
||||
ADD_SUBDIRECTORY( test )
|
||||
ENDIF(ENABLE_TESTING)
|
||||
ADD_SUBDIRECTORY(doc)
|
||||
|
||||
# this is for testing - 'make core' builds everything that isn't generated
|
||||
add_custom_target( core )
|
||||
add_dependencies( core stepdai check-express stepeditor fedex_plus )
|
||||
|
||||
if(NOT SCL_IS_SUBBUILD)
|
||||
###############################################################################
|
||||
# SCL Packaging #
|
||||
# $make package #
|
||||
###############################################################################
|
||||
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "STEPcode")
|
||||
SET(CPACK_SET_DESTDIR "ON")
|
||||
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR ${SCL_VERSION_MAJOR})
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR ${SCL_VERSION_MINOR})
|
||||
SET(CPACK_PACKAGE_NAME SCL )
|
||||
|
||||
SET(CPACK_PACKAGE_CONTACT "SCL Developers <scl-dev@googlegroups.com>")
|
||||
INCLUDE(CPack)
|
||||
|
||||
########################################################################################
|
||||
# Uninstall code #
|
||||
# From http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F #
|
||||
# ######################################################################################
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
|
||||
endif(NOT SCL_IS_SUBBUILD)
|
||||
|
||||
@@ -2,7 +2,7 @@ Modifications to the original NIST code are (C)opyright by their
|
||||
respective authors. Unless otherwise specified, they are copyright
|
||||
on the date those changes were committed to whichever repository
|
||||
they were committed to first (i.e. BRL-CAD on SourceForge.net,
|
||||
mpictor/StepClassLibrary or stepcode/stepcode on github).
|
||||
mpictor/StepClassLibrary on github, etc).
|
||||
|
||||
Modifications which were first commited to the repository on github
|
||||
are licensed under the 3-clause BSD license below. Changes committed
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
Recent changes are recorded in the publicly available repository:
|
||||
http://github.com/stepcode/stepcode
|
||||
|
||||
This repo was moved and renamed in May 2012. Previously, it was at
|
||||
http://github.com/mpictor/StepClassLibrary
|
||||
https://github.com/mpictor/StepClassLibrary
|
||||
|
||||
Some are duplicates of changes recorded in the BRL-CAD repo:
|
||||
http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/src/other/step/?view=log
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
INSTALL
|
||||
|
||||
This file is contains installation instructions for STEPcode.
|
||||
This file is contains installation instructions for the
|
||||
STEP Class Library.
|
||||
|
||||
These installation requires that you have the following software
|
||||
available:
|
||||
|
||||
- C and C++ compilers (Tested with GCC, MSVC, Embarcadero)
|
||||
- C and C++ compilers (only gcc has been tested recently)
|
||||
- bison, byacc, or yacc (only bison has been tested recently)
|
||||
- flex or lex (only flex has been tested recently)
|
||||
- CMake
|
||||
@@ -20,22 +21,12 @@ Installation
|
||||
* Build system uses CMake now: configure, Makefile, and all
|
||||
autotools files have been removed, as has mkProbe.
|
||||
|
||||
* Building SCL from the command prompt:
|
||||
- cd scl
|
||||
- mkdir build
|
||||
- cd build
|
||||
- cmake ..
|
||||
- make
|
||||
- make install # optional
|
||||
|
||||
* Building SCL from the GUI:
|
||||
- Run cmake-gui, set it to build in scl/build
|
||||
- Select the correct build file generator
|
||||
- Press Configure
|
||||
- Change options as necessary, configuring again afterwards
|
||||
- If there are errors, some options may not be visible until the error is resolved
|
||||
- Press Generate
|
||||
- Open the main build file using your preferred build tool
|
||||
* To build:
|
||||
cd scl
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
|
||||
* Build options (append to the 'cmake ..' line):
|
||||
-DBUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
|
||||
@@ -54,16 +45,3 @@ Installation
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
- this causes binaries to be built without debugging information
|
||||
- without this, cmake defaults to a Debug build
|
||||
|
||||
* Using CTest to test SCL:
|
||||
- Read the comments in run_ctest.cmake
|
||||
- (OPTIONAL) Create scl/../.SCL_CTEST_PREFS.cmake, and set variables
|
||||
in it (this file is required for CDash submission to be enabled)
|
||||
- Run tests with `ctest -S run_ctest.cmake`
|
||||
|
||||
* Using CTest to regenerate the schema matrix on the github SCL wiki:
|
||||
- Requires:
|
||||
- git
|
||||
- python
|
||||
- a clone of the git repo for the wiki at scl/../wiki-scl
|
||||
- run `ctest -S ctest_matrix.cmake`
|
||||
|
||||
@@ -1,36 +1,4 @@
|
||||
STEPcode ------ http://github.com/stepcode/stepcode
|
||||
************************************************************************
|
||||
Release 0.6 (May, 2012)
|
||||
|
||||
New since v0.5:
|
||||
* Renamed from STEP Class Library to STEPcode, moved to github.com/stepcode/stepcode
|
||||
* Advances in [Python](http://github.com/stepcode/stepcode/wiki/python-generator) support (#185)
|
||||
* ABI versioning
|
||||
* Implement memory manager with reporting of memory that isn't freed,
|
||||
fix many memory leaks (#148, #160, #162, #168)
|
||||
* MSVC fixes (> 128 nested if...else - #152), etc
|
||||
* Add AP219, AP238, PDM schema, AP203a1, syntax highlighting files
|
||||
* Improvements to CMake files, mostly from Cliff @ BRL-CAD (#143, #163, #181)
|
||||
* Allow runtime bounds for aggregates (discovered with AP209e2) (#166)
|
||||
* fedex_plus fprintf's can be traced with -DSCL_TRACE_FPRINTF=ON (#176)
|
||||
************************************************************************
|
||||
Release 0.5 (Feb 23, 2012)
|
||||
|
||||
New since v0.4:
|
||||
* MSVC and Embarcadero support, along with many warning fixes
|
||||
* Experimental Python support
|
||||
* Now handles most features of EXPRESS - all included schemas,
|
||||
with the exception of AP209 CD, are parsed without error. Enums are
|
||||
now in their own dictionary. Allow indexing on aggregates, generics,
|
||||
and binaries.
|
||||
* Changes to fedex_plus that improve the generated c++ - use a
|
||||
namespace, break up large static strings, make EXPRESS multiple
|
||||
inheritance work by not printing multiple copies of inherited members.
|
||||
All schemas now compile without error, but there are numerous warnings.
|
||||
* Exchange files: handle all comments, fill in some missing attributes.
|
||||
* More cleanup of source code, more documentation in scl/doc
|
||||
* Special thanks to @davyw and @tpaviot for their large contributions
|
||||
(MSVC and Python, respectively)
|
||||
STEP Class Library ------ http://github.com/mpictor/StepClassLibrary
|
||||
************************************************************************
|
||||
Release 0.4 (Nov 13, 2011)
|
||||
|
||||
@@ -42,7 +10,7 @@ New since v0.3:
|
||||
* Enums and entities are allowed to have the same names
|
||||
(affected ap242,210e3,209)
|
||||
* Remove the SCLP23 macro
|
||||
http://github.com/stepcode/stepcode/wiki/changelog-v0.4
|
||||
http://github.com/mpictor/StepClassLibrary/wiki/changelog-v0.4
|
||||
************************************************************************
|
||||
|
||||
Release 0.3 (Oct 29, 2011)
|
||||
@@ -72,10 +40,10 @@ What's new since v0.1?
|
||||
* Add BNF files, schemas, and CAX-IF Part 21 files
|
||||
|
||||
For a detailed list of changes, see
|
||||
https://github.com/stepcode/stepcode/wiki/changelog-v0.2
|
||||
https://github.com/mpictor/StepClassLibrary/wiki/changelog-v0.2
|
||||
|
||||
For a list of closed issues, see
|
||||
https://github.com/stepcode/stepcode/issues?state=closed&milestone=2
|
||||
https://github.com/mpictor/StepClassLibrary/issues?state=closed&milestone=2
|
||||
|
||||
************************************************************************
|
||||
|
||||
@@ -98,10 +66,10 @@ What's new since the SCL 3.2 release in 1998?
|
||||
parser debug output to a specified range of lines in the schema.
|
||||
|
||||
For a detailed list of changes, see
|
||||
https://github.com/stepcode/stepcode/wiki/changelog-v0.1
|
||||
https://github.com/mpictor/StepClassLibrary/wiki/changelog-v0.1
|
||||
|
||||
For a list of closed issues, see
|
||||
https://github.com/stepcode/stepcode/issues?state=closed&milestone=1
|
||||
https://github.com/mpictor/StepClassLibrary/issues?state=closed&milestone=1
|
||||
|
||||
Pre-BRL-CAD changes:
|
||||
* Patches from http://www.statik.tu-cottbus.de/fileadmin/project_dth/scl/
|
||||
|
||||
@@ -1,34 +1,63 @@
|
||||
***********************************************************************
|
||||
STEPcode v0.6 -- http://github.com/stepcode/stepcode
|
||||
Step Class Library v0.4 -- http://github.com/mpictor/StepClassLibrary
|
||||
|
||||
* What is STEPcode? SC reads ISO10303-11 EXPRESS schemas and generates
|
||||
C++ source code that can read and write Part 21 files conforming
|
||||
to that schema. In addition to C++, SC includes experimental
|
||||
support for Python.
|
||||
* What is SCL? SCL reads ISO10303-11 EXPRESS schemas and generates
|
||||
C++ source code that can read and write Part 21 files conforming
|
||||
to that schema. SCL once worked with ObjectStore, OODB, and
|
||||
CORBA IDL - but that code has not been used in a very long time.
|
||||
We are in the process of removing this code because ObjectStore,
|
||||
CORBA, etc. are no longer part of the STEP standard.
|
||||
|
||||
* SCL is packaged along with some other tools. See
|
||||
"THE NIST STEP TOOLSET", below. In particular, Data Probe
|
||||
requires InterViews, an obsolete UI toolkit. I (mpictor) have not
|
||||
had luck building the data probe with it. It may be more productive
|
||||
to replace InterViews with a modern toolkit such as Qt. I
|
||||
expect that this would be non-trivial.
|
||||
|
||||
* Renamed in April/May 2012: SC was formerly known as STEP Class
|
||||
Libraries, SCL for short. It was renamed because the name wasn't
|
||||
accurate: the class libraries make up only a part of the code.
|
||||
* Much of the work to update SCL has been done by the developers of
|
||||
BRL-CAD, and SCL was originally created at NIST in the 90's.
|
||||
|
||||
* Much of the work to update SC has been done by the developers of
|
||||
BRL-CAD, and SC (then STEP Class Library) was originally created at
|
||||
NIST in the 90's.
|
||||
* Build system uses only CMake now: configure, Makefile, and all
|
||||
autotools files have been removed, as has mkProbe.
|
||||
|
||||
* To build:
|
||||
cd scl
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
|
||||
* Build options (append to the 'cmake ..' line):
|
||||
-DBUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
|
||||
- this generates c++ for the schema, and compiles it into a
|
||||
library. Also works with directories, as long as each dir only
|
||||
has one express file.
|
||||
- multiple files/directories are separated by semicolons
|
||||
- this also builds a 'p21read' program, which reads one step file
|
||||
and writes another. It may change whitespace or remove comments;
|
||||
otherwise, the input and output files should be identical. If
|
||||
they are not identical, either the file does not match the
|
||||
schema, or SCL generated incorrect source code.
|
||||
-DBUILD_SCHEMAS=ALL
|
||||
- Added to make use of ctest easier. If BUILD_SCHEMAS == ALL,
|
||||
then CMake adds each *.exp file found in data/.
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
- this causes binaries to be built without debugging information
|
||||
- without this, cmake defaults to a Debug build
|
||||
|
||||
* For information on changes version-by-version, see the NEWS file
|
||||
|
||||
* Building and testing SCL - see the INSTALL file
|
||||
|
||||
* For more details on the libraries and executables, see the wiki:
|
||||
http://github.com/stepcode/stepcode/wiki/About-STEPcode
|
||||
|
||||
* For license details, see the COPYING file. Summary: 3-clause BSD.
|
||||
* Using CTest to test SCL:
|
||||
- Read the comments in run_ctest.cmake
|
||||
- (OPTIONAL) Create scl/../.SCL_CTEST_PREFS.cmake, and set variables
|
||||
in it (this file is required for CDash submission to be enabled)
|
||||
- Run tests with `ctest -S run_ctest.cmake`
|
||||
|
||||
***********************************************************************
|
||||
|
||||
***********************************************************************
|
||||
CODING STANDARDS
|
||||
|
||||
SC's source has been reformatted with astyle. When making changes, try
|
||||
SCL's source has been reformatted with astyle. When making changes, try
|
||||
to match the current formatting. The main points are:
|
||||
|
||||
- compact (java-style) brackets:
|
||||
@@ -54,4 +83,542 @@ Download astyle from http://sourceforge.net/projects/astyle/files/astyle/
|
||||
|
||||
***********************************************************************
|
||||
|
||||
For more info, see the wiki.
|
||||
|
||||
***********************************************************************
|
||||
Notes/TODO items specific to the STEP libraries as included in BRL-CAD:
|
||||
|
||||
* Original build system has been replaced with Makefile.am and
|
||||
configure.ac files in the style of BRL-CAD's autotools build
|
||||
system.
|
||||
|
||||
* Changes have been made to src/express to get it compiling with
|
||||
the output of different versions of lex/flex/bison. These
|
||||
changes are not yet tested in terms of impact on functionality
|
||||
and should be a starting point for any debugging of EXPRESS
|
||||
parsing issues.
|
||||
|
||||
* Of the original test code, only p21read has been incorporated into
|
||||
the new build system, but they are still present in src/test
|
||||
|
||||
* Express and exppp header files have been relocated to subdirectories
|
||||
in include. The names of the library files being built have been
|
||||
altered, and clstepcore and cleditor now build as separate libraries.
|
||||
|
||||
* Numerous minor changes have been made, mostly including stdlib
|
||||
and other required files.
|
||||
|
||||
***********************************************************************
|
||||
|
||||
|
||||
=====================================================
|
||||
Much has changed since README.scl was written.
|
||||
However, it is reproduced in its entirety below.
|
||||
=====================================================
|
||||
|
||||
README.scl (top level README) February 1998
|
||||
|
||||
THE NIST STEP TOOLSET
|
||||
=====================
|
||||
|
||||
Included in this release of the NIST STEP Toolset are
|
||||
|
||||
STEP Class Library (SCL)
|
||||
fedex_plus
|
||||
fedex_idl
|
||||
fedex_os
|
||||
Data Probe application
|
||||
Part 21 Reader application
|
||||
mkProbe script
|
||||
NIST EXPRESS Toolkit
|
||||
NIST EXPRESS Pretty Printing Toolkit
|
||||
|
||||
The focus of our work since our last release has been on developing a
|
||||
reference implementation of the binding of EXPRESS to C++ and IDL as
|
||||
specified by STEP's Parts 23 and 26 respectively. To this we have
|
||||
added a persistence capability (based on the ObjectStore OODB from
|
||||
Object Design, Inc) and a distribution capability (based on Orbix by
|
||||
Iona Technologies, Ltd). We also experimented with the Open OODB from
|
||||
Texas Instruments and with DSOM from IBM.
|
||||
|
||||
The STEP Class Library (SCL) and fedex_plus are used to build
|
||||
STEP-related applications in C++. They support STEP Parts 21 (the
|
||||
exchange file format), 22 (the functional specification of STEP's
|
||||
Standard Data Access Interface, SDAI), 23 (the C++ binding to SDAI),
|
||||
and 26 (the IDL interface to SDAI). fedex_plus is an application of
|
||||
the NIST EXPRESS Toolkit (based on STEP Part 11) which generates a C++
|
||||
class library representation of an EXPRESS schema based on STEP's Part
|
||||
23. The generated classes work with the STEP Class Library. The NIST
|
||||
EXPRESS Pretty Printing Toolkit is used to format and output EXPRESS.
|
||||
fedex_os is used to generate software (in addition to fedex_plus)
|
||||
needed to use SCL with the ObjectStore OODB. fedex_idl translates
|
||||
EXPRESS to the Interface Definition Language (according to Part 26)
|
||||
for use with Orbix.
|
||||
|
||||
The Data Probe software and mkProbe script are used to generate
|
||||
schema-specific class libraries (a.k.a. "Schema Class Library"), Data
|
||||
Probe editors, and Part 21 file readers. mkProbe generates a C++
|
||||
library representing a schema (using fedex_plus) and links the schema
|
||||
library with other libraries of the SCL and Data Probe to create a
|
||||
schema specific editor, known as a Data Probe. The Data Probe is a
|
||||
graphical editor for STEP data; it is used to browse and edit data
|
||||
instances of the objects in an EXPRESS model. It may also be used to
|
||||
visually browse the objects contained in the EXPRESS schema itself.
|
||||
Data Probes are X Windows-based and use the InterViews Toolkit from
|
||||
Stanford University.
|
||||
|
||||
The Data Probe source code was designed with reusability in mind. The
|
||||
runtime-code uses three class libraries: the STEP Class Library
|
||||
(developed at NIST), the InterViews Toolkit (user interface
|
||||
developer's toolkit from Stanford), and a standard C++ Class Library.
|
||||
The NIST STEP Class Library is divided into component libraries
|
||||
including STEP Core, Editor, Utilities, Data Access Interface,
|
||||
Interviews extensions, and Probe. The STEP Core, Editor, and Utils
|
||||
libraries can be used without the user interface libraries (Interviews
|
||||
extensions and Probe) for applications needing to represent the
|
||||
EXPRESS data structures. At this point the Data Access Interface is a
|
||||
partial implementation of SDAI's Session schema.
|
||||
|
||||
Dependencies between these modules have been minimized so that an
|
||||
executable program, the Data Probe, can be easily reconfigured to
|
||||
support different conceptual schemas.
|
||||
|
||||
We have experimented with replacing the Interviews-based interface
|
||||
with a tcl interface with good success; however, it is not in our work
|
||||
plan to complete. If anyone is interested in extending the toolkit
|
||||
with a more modern interface, we would be glad to discuss it with you.
|
||||
|
||||
The Part 21 Reader was originally developed to test whether a Schema
|
||||
Class built and linked without problems. It is also useful for
|
||||
checking Part 21 files. It displays the error messages from the STEP
|
||||
Class Library as a file is read.
|
||||
|
||||
|
||||
SYSTEM REQUIREMENTS
|
||||
===================
|
||||
|
||||
Depending on how you want to use the toolkit, additional pieces of
|
||||
software will need to be available on your local system:
|
||||
|
||||
- UNIX SunOS 4.1.x or Solaris 5.x operating system.
|
||||
At NIST, the SCL including the Data Probe has been built on
|
||||
SunOS workstations. The SCL without the Data Probe has been
|
||||
built on Solaris. (We did not build the InterViews Library
|
||||
on Solaris.) NOTE: earlier versions of the SCL 2.1 without
|
||||
the Data Probe had been ported to AIX, HP, linux, and Windows NT.
|
||||
|
||||
- a C++ compiler -- cfront version 2.1 or higher
|
||||
|
||||
NOTE: The current SCL release has been built with SUN C/C++,
|
||||
and GNU's gcc/g++ compilers. Earlier versions of the SCL were
|
||||
built using CenterLine on SunOS and CSet++ on AIX.
|
||||
|
||||
If you successfully port the current version to other
|
||||
compilers and/or operating systems (and are willing to share)
|
||||
please contact us (stepcl@cme.nist.gov) so that we can point
|
||||
others to it.
|
||||
|
||||
- The NIST EXPRESS Toolkit -- available from NIST
|
||||
Included in this release; also available as:
|
||||
ftp.cme.nist.gov:pub/step/npttools/exptk.tar.Z
|
||||
|
||||
- The NIST EXPRESS Pretty Printer -- available from NIST
|
||||
Included in this release; also available as:
|
||||
ftp.cme.nist.gov:pub/step/npttools/exppp.tar.Z
|
||||
|
||||
The following components are optional:
|
||||
|
||||
- Version 3.1 of the InterViews Toolkit from Stanford.
|
||||
ftp://interviews.stanford.edu:pub/3.1.tar.Z
|
||||
|
||||
NOTE: InterViews is only needed for the Data Probe portion of
|
||||
the toolkit. The STEP Class Library without the Data Probe
|
||||
and InterViews has been built on more platforms than with these
|
||||
components.
|
||||
|
||||
- Orbix version 2.0. Available from Iona Technologies:
|
||||
http://www.iona.com
|
||||
|
||||
- Object Store version 4. Available from Object Design Inc.:
|
||||
http://www.odi.com.
|
||||
|
||||
|
||||
INSTALLATION INSTRUCTIONS
|
||||
=========================
|
||||
|
||||
Refer to the file INSTALL.
|
||||
|
||||
In the instructions below, you will see references to the directory
|
||||
<ARCH_DIR>. This directory name should be interpreted as the directory
|
||||
which is named to reflect your compiler and/or system architecture
|
||||
when installing the SCL using configure: i.e. "arch.centerline" or
|
||||
"arch-gnu.solaris"
|
||||
|
||||
|
||||
CREATING A NEW SCHEMA CLASS LIBRARY AND/OR DATA PROBE
|
||||
=====================================================
|
||||
|
||||
The <ARCH_DIR>/bin/mkProbe script automates the process of building
|
||||
new Schema Class Libraries and Data Probe executables. When run with
|
||||
the -l option only the Schema Class Library will be created. See man
|
||||
page in ~scl/man.
|
||||
|
||||
Examples
|
||||
|
||||
Input command line output (name and location)
|
||||
----------------------------------------------------
|
||||
mkProbe part41.exp pt41 ./pt41/dp_pt41
|
||||
|
||||
mkProbe -i part101.exp dp ~scl/<ARCH_DIR>/Probes/dp/dp_dp
|
||||
|
||||
mkProbe -l example.exp example ./example/libCexample.a
|
||||
|
||||
mkProbe -p example.exp example ./example/p21read_example
|
||||
|
||||
|
||||
CONTENTS
|
||||
========
|
||||
|
||||
This directory contains the following files and subdirectories.
|
||||
|
||||
This software release includes all the NIST software needed for
|
||||
creating new versions of the Data Probe program. Two example schemas
|
||||
are included in the data directory.
|
||||
|
||||
INSTALL - File discussing installation of SCL.
|
||||
|
||||
README.scl - This file.
|
||||
|
||||
src/test/README - README discussing SCL coding examples under src/test/
|
||||
|
||||
disclaim.txt - NIST disclaimer for this distribution.
|
||||
|
||||
build-apps.txt - Discusses how to build applications using the STEP
|
||||
Class Library.
|
||||
|
||||
whatsnew.3-1.txt- Discusses new features in the STEP Class Library and
|
||||
Data Probe 3.1 release.
|
||||
|
||||
whatsnew.2-1.txt- This was the `whatsnew' file released with SCL 2.1.
|
||||
Most of the information is still relevant.
|
||||
|
||||
configure - Script used to install the SCL.
|
||||
|
||||
configure.in - File used to create the configure script using gnu's
|
||||
autoconf software.
|
||||
|
||||
configure.files_notes.txt - Discusses various files used by the
|
||||
configure script.
|
||||
|
||||
Makefile - Contains a default rule to build SCL using the
|
||||
configure installation script.
|
||||
|
||||
<ARCH_DIR>/bin/mkProbe - Script used to generate a new Schema Class Library
|
||||
and/or Data Probe executable.
|
||||
(see CREATING A NEW SCHEMA CLASS LIBRARY AND/OR DATA PROBE)
|
||||
|
||||
config/ - Directory containing various templates needed by the
|
||||
configure installation script.
|
||||
|
||||
config/examples/ - Directory containing examples of using configure to
|
||||
install SCL.
|
||||
|
||||
arch_template/ - Directory containing templates used by configure to
|
||||
create an architecture specific SCL installation.
|
||||
|
||||
src/ - Source code files for the C++ libraries included in this
|
||||
release.
|
||||
|
||||
src/cl* - Directories containing the source code for the C++
|
||||
libraries in the STEP Class Library. These
|
||||
libraries are documented in the VTS Design document
|
||||
(see DOCUMENTATION below). They are as follows:
|
||||
|
||||
src/clutils - utilities needed by the other libraries.
|
||||
|
||||
src/clstepcore - "core" classes representing EXPRESS types
|
||||
and dictionary info.
|
||||
|
||||
src/cldai - classes for a partial implementation of the
|
||||
Session schema of STEP's Standard Data
|
||||
Access Interface (STEP Part 23).
|
||||
|
||||
src/cleditor - classes for managing data instances and
|
||||
exchange files.
|
||||
|
||||
src/clivfasd - customizations to the Interviews class
|
||||
library.
|
||||
|
||||
src/clprobe-ui - user interface classes for the Data Probe.
|
||||
|
||||
src/clSchemas - Contain subdirectories with schema specific source
|
||||
code generated by the mkProbe script.
|
||||
|
||||
src/express - Directory containing the EXPRESS Toolkit.
|
||||
|
||||
src/exppp - Directory containing EXPRESS Pretty Printer Toolkit.
|
||||
|
||||
src/test - Directory containing example STEP Class Library
|
||||
applications.
|
||||
|
||||
src/fedex_plus - Directory containing source code and makefile for
|
||||
fedex_plus, fedex_idl, fedex_os
|
||||
|
||||
<ARCH_DIR>
|
||||
|
||||
- <ARCH_DIR> is the installer-supplied name of the
|
||||
directory which is created when you run configure to
|
||||
install SCL. (See the file INSTALL for more
|
||||
information.) This directory contains computer
|
||||
architecture-specific files. Additional arch dirs
|
||||
may be created to support multiple platforms or C++
|
||||
compilers which all refer to the same source
|
||||
code under src/. The arch dir contains the subdirectories
|
||||
ofiles, bin, lib, and Probes.
|
||||
|
||||
<ARCH_DIR>/ofiles/ - Directory containing object (.o) files for SCL.
|
||||
|
||||
<ARCH_DIR>/ofiles/sdaiOrbix - Directory containing IDL files and
|
||||
Makefile needed to build and use SCL with Orbix.
|
||||
|
||||
<ARCH_DIR>/lib/ - Directory containing library (.a) files for SCL.
|
||||
|
||||
<ARCH_DIR>/Probes/ - The <ARCH_DIR>/Probes directory will contain
|
||||
directories for versions of the Schema Class Library
|
||||
and Data Probe generated using the mkProbe script
|
||||
with the -i option.
|
||||
|
||||
<ARCH_DIR>/bin/ - The fedex, fedex_plus, fedex_idl, and fedex_os,
|
||||
exppp, and symlink executables and mkProbe,
|
||||
sclbuild, and setup-arch scripts are placed in this
|
||||
directory during installation.
|
||||
|
||||
data/ - Directory containing sample EXPRESS files to use to
|
||||
create SCL applications such as the Data Probe or
|
||||
Part 21 Reader. Also contains data for some of the
|
||||
examples.
|
||||
|
||||
bin/ - Directory containing various scripts.
|
||||
|
||||
man/ - Directory containing man pages for the software in
|
||||
the release. You may look at the man page by
|
||||
issuing the command: nroff -man <manpagefile> or by
|
||||
adding this directory to your MANPATH.
|
||||
|
||||
|
||||
EXAMPLES
|
||||
========
|
||||
|
||||
Example of creating a Data Probe
|
||||
--------------------------------
|
||||
|
||||
To create a new version of the Data Probe run the script mkProbe. For
|
||||
example, to create a Data Probe based on the "example_schema" EXPRESS
|
||||
schema included in this release, issue the following command in a
|
||||
directory from which you would like a subdirectory containing the new
|
||||
Data Probe to be created:
|
||||
|
||||
% mkProbe ~scl/data/example/example.exp example
|
||||
|
||||
This command creates a new version of the Data Probe in the file:
|
||||
|
||||
% ./example/dp_example
|
||||
|
||||
(It also creates subdirectory example/ if it does not exist already.)
|
||||
|
||||
|
||||
Examples of using the STEP Class Library
|
||||
----------------------------------------
|
||||
|
||||
To use the Schema Class Library source code (without the Data Probe
|
||||
software) refer to the examples in the directory src/test.
|
||||
|
||||
Example of a Part 21 file reader
|
||||
--------------------------------
|
||||
|
||||
To create a file reader based on STEP's Part 21 format use the mkProbe
|
||||
script with the -p option.
|
||||
|
||||
% mkProbe -p ~scl/data/example/example.exp example
|
||||
|
||||
The executable p21read_example is created. Run it as follows:
|
||||
|
||||
% p21read_example your_part_21_file
|
||||
|
||||
This program reads a file the name of which is supplied as an
|
||||
argument to the program. Any errors encountered when reading the file
|
||||
are reported to standard output. A summary of the file is also
|
||||
reported. The file is then written back out to a file the name of
|
||||
which may be supplied as the second argument to the program. If no
|
||||
name is given, "file.out" is used.
|
||||
|
||||
|
||||
FOR MORE INFORMATION
|
||||
====================
|
||||
|
||||
SCL HOME PAGE
|
||||
-------------
|
||||
|
||||
The SCL home page is located on the world wide web at,
|
||||
|
||||
http://www.nist.gov/scl
|
||||
|
||||
The SCL home page will provide important, up-to-date information on
|
||||
the status of the SCL, new developments and fixes, links to related
|
||||
software and projects, and may eventually contain an FAQ sheet.
|
||||
|
||||
SCL DOCUMENTATION
|
||||
-----------------
|
||||
|
||||
Documentation can be accessed from the SCL world wide web home page
|
||||
located at http://www.nist.gov/scl
|
||||
The following files (in postscript format) are particularly relevant:
|
||||
|
||||
Design of a C++ Software Library for Implementing EXPRESS: The NIST
|
||||
STEP Class Library
|
||||
|
||||
Data Probe User's Guide
|
||||
|
||||
Data Probe: A Tool for EXPRESS-based Data
|
||||
|
||||
Architecture for the Validation Testing System Software
|
||||
|
||||
Validation Testing System Software Reusable Software Component Design
|
||||
|
||||
Diagrams of basic SCL data structures
|
||||
|
||||
|
||||
ISO DOCUMENTATION
|
||||
-----------------
|
||||
|
||||
Copies of the International Standard documents (including STEP Part 11
|
||||
the EXPRESS Language Reference Manual, Part 21 the STEP Exchange File
|
||||
Format, Part 22 STEP's Standard Data Access Interface, and Part 23 the
|
||||
C++ language binding to SDAI) can be ordered from the ISO
|
||||
International Organization of Standardization or your national
|
||||
body. The United States distribution is managed by the US Product Data
|
||||
Exchange Association at:
|
||||
|
||||
U.S. Product Data Association (USPro)
|
||||
Trident Research Center, Suite 204
|
||||
5300 International Blvd.
|
||||
N. Charleston, SC 29418
|
||||
|
||||
http://www.uspro.scra.org
|
||||
uspro@scra.org
|
||||
Ph: 803-760-3327
|
||||
FAX: 803-760-3349
|
||||
|
||||
MAILING LIST
|
||||
------------
|
||||
|
||||
Announcements of new releases or bug fixes will also be sent to the
|
||||
mailing list scl@cme.nist.gov. To be added to the scl mailing list
|
||||
send a request to majordomo@cme.nist.gov. Include in the body of the
|
||||
message:
|
||||
|
||||
subscribe scl
|
||||
|
||||
For additional help, include in the body of the message:
|
||||
|
||||
help
|
||||
|
||||
If you use a signature within your email, end your majordomo
|
||||
command sequence with the word "end". For example,
|
||||
|
||||
subscribe scl
|
||||
end
|
||||
|
||||
|
||||
REPORTING PROBLEMS AND SUGGESTIONS
|
||||
==================================
|
||||
|
||||
We would like feedback on all parts of the software. Please let us
|
||||
know if you
|
||||
|
||||
- have problems following the instructions in the README file,
|
||||
- have problems installing the software,
|
||||
- have problems compiling your own valid EXPRESS schema, or
|
||||
- have suggestions for improvements to the software.
|
||||
- really like the software :)
|
||||
|
||||
Send your comments to
|
||||
|
||||
stepcl@cme.nist.gov
|
||||
|
||||
(For users of version 2, note the new mailing address of "stepcl...".)
|
||||
|
||||
Questions about availability or accessing the software should be
|
||||
directed to the SOLIS administrator
|
||||
|
||||
Gaylen Rinaudot
|
||||
npt-info@cme.nist.gov
|
||||
301-975-3386
|
||||
|
||||
ACKNOWLEDGMENTS
|
||||
===============
|
||||
|
||||
The STEP Class Library (SCL) was developed by the Manufacturing
|
||||
Systems Integration Division at the National Institute of Standards
|
||||
and Technology (http://www.mel/nist.gov/msid) to support testing of
|
||||
the Standard for the Exchange of Product Model Data (a.k.a STEP) and
|
||||
validation of STEP's emerging implementation specifications. Funding
|
||||
for the project has come from the U.S. Department of Commerce, and the
|
||||
Department of Defense agencies including the Office of the Defense
|
||||
CALS (Continuous Acquisition and Life-Cycle Support) Executive and the
|
||||
Defense Advanced Research Projects Agency (DARPA). Recent
|
||||
enhancements were sponsored by the National Industrial Information
|
||||
Infrastructure Consortium (NIIIP) (http://www.niiip.org) and the NAMT
|
||||
Framework project
|
||||
(http://www.mel.nist.gov/msid/projs/97projs/framewrk.htm) of NIST's
|
||||
Systems Integration for Manufacturing Applications (SIMA) program
|
||||
(http://www.mel.nist.gov/msid/sima/sima.htm).
|
||||
|
||||
LICENSING RESTRICTIONS and DISCLAIMERS
|
||||
======================================
|
||||
|
||||
This software was produced by the National Institute of Standards and
|
||||
Technology (NIST), an agency of the U.S. government, and by statute
|
||||
is not subject to copyright in the United States. Recipients of this
|
||||
software assume all responsibility associated with its operation,
|
||||
modification, maintenance, and subsequent re-distribution.
|
||||
|
||||
There is no warranty for the NIST STEP Toolkit.
|
||||
If the NIST STEP Toolkit is modified by someone else and passed on,
|
||||
NIST wants the Toolkit's recipients to know that what they have is not
|
||||
what NIST originally distributed.
|
||||
|
||||
Distribution Rights
|
||||
1. Anyone may copy and distribute verbatim copies of the NIST STEP Toolkit
|
||||
source code as received in any medium.
|
||||
|
||||
2. Anyone may modify their copy or copies of the NIST STEP Toolkit source
|
||||
code or any portion of it, and copy and distribute such modifications
|
||||
provided that all modifications are clearly associated with the entity
|
||||
that performs the modifications.
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!DISCLAIMERS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
Names of companies and products are provided in order to adequately
|
||||
specify procedures and equipment used. In no case does such
|
||||
identification imply recommendation or endorsement by the National
|
||||
Institute of Standards and Technology, nor does it imply that the
|
||||
products are necessarily the best available for the purpose.
|
||||
|
||||
NO WARRANTY
|
||||
===========
|
||||
|
||||
NIST PROVIDES ABSOLUTELY NO WARRANTY. THE NIST STEP TOOLKIT
|
||||
IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
|
||||
EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS
|
||||
WITH YOU. SHOULD ANY PORTION OF THE NIST STEP TOOLKIT PROVE DEFECTIVE,
|
||||
YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
|
||||
|
||||
IN NO EVENT WILL NIST BE LIABLE FOR DAMAGES, INCLUDING ANY LOST
|
||||
PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL
|
||||
DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE (INCLUDING BUT NOT
|
||||
LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE, OR LOSSES
|
||||
SUSTAINED BY THIRD PARTIES, OR A FAILURE OF THE PROGRAM TO OPERATE
|
||||
WITH PROGRAMS NOT DISTRIBUTED BY NIST) THE PROGRAMS, EVEN IF YOU HAVE
|
||||
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY
|
||||
ANY OTHER PARTY.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
0.6
|
||||
0.4
|
||||
|
||||
@@ -151,6 +151,9 @@ IF(LEX_EXECUTABLE)
|
||||
SET(FILE_RUN_DEFINITIONS "-DYYTEXT_POINTER=1")
|
||||
CHECK_C_FILE_RUNS(${CMAKE_CURRENT_SOURCE_DIR}/cmake/test_srcs/sys_wait_test.c YYTEXT_POINTER)
|
||||
SET(FILE_RUN_DEFINITIONS)
|
||||
IF(CONFIG_H_FILE)
|
||||
FILE(APPEND ${CONFIG_H_FILE} "#cmakedefine YYTEXT_POINTER 1\n")
|
||||
ENDIF(CONFIG_H_FILE)
|
||||
|
||||
|
||||
ENDIF(LEX_EXECUTABLE)
|
||||
|
||||
+58
-120
@@ -1,137 +1,75 @@
|
||||
# Will need windows logic someday, even though it doesn't work yet, so go ahead
|
||||
# and add the DLL_DEFINE macro
|
||||
|
||||
# set compile definitions for dll exports on windows
|
||||
MACRO(DEFINE_DLL_EXPORTS libname)
|
||||
IF( MSVC OR BORLAND )
|
||||
if( ${libname} MATCHES "sdai_.*" )
|
||||
set( export "SCL_SCHEMA_DLL_EXPORTS" )
|
||||
else()
|
||||
STRING(REGEX REPLACE "lib" "" shortname "${libname}")
|
||||
STRING(REGEX REPLACE "step" "" LOWERCORE "${shortname}")
|
||||
STRING(TOUPPER ${LOWERCORE} UPPER_CORE)
|
||||
set( export "SCL_${UPPER_CORE}_DLL_EXPORTS" )
|
||||
endif()
|
||||
get_target_property(defs ${libname} COMPILE_DEFINITIONS )
|
||||
if( defs ) #if no properties, ${defs} will be defs-NOTFOUND which CMake interprets as false
|
||||
set( defs "${defs};${export}")
|
||||
else( defs )
|
||||
set( defs "${export}")
|
||||
endif( defs )
|
||||
set_target_properties(${libname} PROPERTIES COMPILE_DEFINITIONS "${defs}" )
|
||||
ENDIF( MSVC OR BORLAND )
|
||||
ENDMACRO(DEFINE_DLL_EXPORTS libname)
|
||||
MACRO(DLL_DEFINE libname)
|
||||
IF(MSVC)
|
||||
STRING(REGEX REPLACE "lib" "" LOWERCORE "${libname}")
|
||||
STRING(TOUPPER ${LOWERCORE} UPPER_CORE)
|
||||
add_definitions("-D${UPPER_CORE}_EXPORT_DLL")
|
||||
ENDIF(MSVC)
|
||||
ENDMACRO()
|
||||
|
||||
# set compile definitions for dll imports on windows
|
||||
MACRO( DEFINE_DLL_IMPORTS tgt libs )
|
||||
IF( MSVC OR BORLAND )
|
||||
get_target_property(defs ${tgt} COMPILE_DEFINITIONS )
|
||||
if( NOT defs ) #if no properties, ${defs} will be defs-NOTFOUND which CMake interprets as false
|
||||
set( defs "")
|
||||
endif( NOT defs )
|
||||
foreach( lib ${libs} )
|
||||
STRING(REGEX REPLACE "lib" "" shortname "${lib}")
|
||||
STRING(REGEX REPLACE "step" "" LOWERCORE "${shortname}")
|
||||
STRING(TOUPPER ${LOWERCORE} UPPER_CORE)
|
||||
list( APPEND defs "SCL_${UPPER_CORE}_DLL_IMPORTS" )
|
||||
endforeach( lib ${libs} )
|
||||
if( DEFINED defs )
|
||||
if( defs )
|
||||
set_target_properties( ${tgt} PROPERTIES COMPILE_DEFINITIONS "${defs}" )
|
||||
endif( defs )
|
||||
endif( DEFINED defs )
|
||||
ENDIF( MSVC OR BORLAND )
|
||||
ENDMACRO( DEFINE_DLL_IMPORTS tgt libs )
|
||||
|
||||
#EXCLUDE_OR_INSTALL(target destination ARGV3)
|
||||
# installs ${target} in ${destination} unless testing is enabled AND ${arg_3} == "TESTABLE",
|
||||
# in which case the EXCLUDE_FROM_ALL property is set for testing.
|
||||
# EXCLUDE_FROM_ALL cannot be set on targets that are to be installed,
|
||||
# so either test the target or install it - but not both
|
||||
MACRO(EXCLUDE_OR_INSTALL target dest arg_3 )
|
||||
if( NOT ( ( SCL_ENABLE_TESTING ) AND ( "${arg_3}" STREQUAL "TESTABLE" ) ) )
|
||||
INSTALL(TARGETS ${target} DESTINATION ${dest})
|
||||
else( NOT ( ( SCL_ENABLE_TESTING ) AND ( "${arg_3}" STREQUAL "TESTABLE" ) ) )
|
||||
set_target_properties( ${target} PROPERTIES EXCLUDE_FROM_ALL ON )
|
||||
endif( NOT ( ( SCL_ENABLE_TESTING ) AND ( "${arg_3}" STREQUAL "TESTABLE" ) ) )
|
||||
ENDMACRO(EXCLUDE_OR_INSTALL target dest arg_3 )
|
||||
|
||||
#SCL_ADDEXEC( execname "source files" "linked libs" ["TESTABLE"] ["MSVC flag" ...])
|
||||
# optional 4th argument of "TESTABLE", passed to EXCLUDE_OR_INSTALL macro
|
||||
# optional args can also be used by MSVC-specific code, but it looks like these two uses
|
||||
# will not conflict because the MSVC args must contain "STRICT"
|
||||
MACRO(SCL_ADDEXEC execname srcs libs)
|
||||
STRING(REGEX REPLACE " " ";" srcslist "${srcs}")
|
||||
STRING(REGEX REPLACE " " ";" libslist "${libs}")
|
||||
add_executable(${execname} ${srcslist})
|
||||
target_link_libraries(${execname} ${libslist})
|
||||
DEFINE_DLL_IMPORTS(${execname} "${libslist}") #add import definitions for all libs that the executable is linked to
|
||||
EXCLUDE_OR_INSTALL( ${execname} "bin" "${ARGV3}" )
|
||||
# Enable extra compiler flags if local executables and/or global options dictate
|
||||
SET(LOCAL_COMPILE_FLAGS "")
|
||||
FOREACH(extraarg ${ARGN})
|
||||
IF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
SET(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
|
||||
ENDIF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
ENDFOREACH(extraarg ${ARGN})
|
||||
IF(LOCAL_COMPILE_FLAGS)
|
||||
SET_TARGET_PROPERTIES(${execname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(LOCAL_COMPILE_FLAGS)
|
||||
STRING(REGEX REPLACE " " ";" srcslist "${srcs}")
|
||||
STRING(REGEX REPLACE " " ";" libslist "${libs}")
|
||||
add_executable(${execname} ${srcslist})
|
||||
target_link_libraries(${execname} ${libslist})
|
||||
INSTALL(TARGETS ${execname} DESTINATION bin)
|
||||
# Enable extra compiler flags if local executables and/or global options dictate
|
||||
SET(LOCAL_COMPILE_FLAGS "")
|
||||
FOREACH(extraarg ${ARGN})
|
||||
IF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
SET(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
|
||||
ENDIF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
ENDFOREACH(extraarg ${ARGN})
|
||||
IF(LOCAL_COMPILE_FLAGS)
|
||||
SET_TARGET_PROPERTIES(${execname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(LOCAL_COMPILE_FLAGS)
|
||||
ENDMACRO(SCL_ADDEXEC execname srcs libs)
|
||||
|
||||
#SCL_ADDLIB( libname "source files" "linked libs" ["TESTABLE"] ["MSVC flag" ...])
|
||||
# optional 4th argument of "TESTABLE", passed to EXCLUDE_OR_INSTALL macro
|
||||
# optional args can also be used by MSVC-specific code, but it looks like these two uses
|
||||
# will not conflict because the MSVC args must contain "STRICT"
|
||||
MACRO(SCL_ADDLIB libname srcs libs)
|
||||
STRING(REGEX REPLACE " " ";" srcslist "${srcs}")
|
||||
STRING(REGEX REPLACE " " ";" libslist1 "${libs}")
|
||||
STRING(REGEX REPLACE "-framework;" "-framework " libslist "${libslist1}")
|
||||
IF(SCL_BUILD_SHARED_LIBS)
|
||||
add_library(${libname} SHARED ${srcslist})
|
||||
DEFINE_DLL_EXPORTS(${libname})
|
||||
if(NOT ${libs} MATCHES "NONE")
|
||||
target_link_libraries(${libname} ${libslist})
|
||||
DEFINE_DLL_IMPORTS(${libname} "${libslist}" )
|
||||
endif(NOT ${libs} MATCHES "NONE")
|
||||
SET_TARGET_PROPERTIES(${libname} PROPERTIES VERSION ${SCL_ABI_VERSION} SOVERSION ${SCL_ABI_SOVERSION} )
|
||||
EXCLUDE_OR_INSTALL( ${libname} "lib" "${ARGV3}" )
|
||||
if(APPLE)
|
||||
set_target_properties(${libname} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
|
||||
endif(APPLE)
|
||||
ENDIF(SCL_BUILD_SHARED_LIBS)
|
||||
IF(SCL_BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
add_library(${libname}-static STATIC ${srcslist})
|
||||
DEFINE_DLL_EXPORTS(${libname}-static)
|
||||
if(NOT ${libs} MATCHES "NONE")
|
||||
target_link_libraries(${libname}-static "${libslist}")
|
||||
DEFINE_DLL_IMPORTS(${libname}-static ${libslist} )
|
||||
endif(NOT ${libs} MATCHES "NONE")
|
||||
IF(NOT WIN32)
|
||||
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES OUTPUT_NAME "${libname}")
|
||||
ENDIF(NOT WIN32)
|
||||
IF(WIN32)
|
||||
# We need the lib prefix on win32, so add it even if our add_library
|
||||
# wrapper function has removed it due to the target name - see
|
||||
# http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_make_my_shared_and_static_libraries_have_the_same_root_name.2C_but_different_suffixes.3F
|
||||
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES PREFIX "lib")
|
||||
ENDIF(WIN32)
|
||||
EXCLUDE_OR_INSTALL( ${libname}-static "lib" "${ARGV3}" )
|
||||
if(APPLE)
|
||||
set_target_properties(${libname}-static PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
|
||||
endif(APPLE)
|
||||
ENDIF(SCL_BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
DLL_DEFINE(${libname})
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
add_library(${libname} SHARED ${srcslist})
|
||||
if(NOT ${libs} MATCHES "NONE")
|
||||
target_link_libraries(${libname} ${libslist})
|
||||
endif(NOT ${libs} MATCHES "NONE")
|
||||
SET_TARGET_PROPERTIES(${libname} PROPERTIES VERSION ${SCL_VERSION_MAJOR}.${SCL_VERSION_MINOR} SOVERSION ${SCL_VERSION_MAJOR} )
|
||||
INSTALL(TARGETS ${libname} DESTINATION lib)
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
IF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
add_library(${libname}-static STATIC ${srcslist})
|
||||
if(NOT ${libs} MATCHES "NONE")
|
||||
target_link_libraries(${libname}-static ${libslist})
|
||||
endif(NOT ${libs} MATCHES "NONE")
|
||||
IF(NOT WIN32)
|
||||
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES OUTPUT_NAME "${libname}")
|
||||
ENDIF(NOT WIN32)
|
||||
IF(WIN32)
|
||||
# We need the lib prefix on win32, so add it even if our add_library
|
||||
# wrapper function has removed it due to the target name - see
|
||||
# http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_make_my_shared_and_static_libraries_have_the_same_root_name.2C_but_different_suffixes.3F
|
||||
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES PREFIX "lib")
|
||||
ENDIF(WIN32)
|
||||
INSTALL(TARGETS ${libname}-static DESTINATION lib)
|
||||
ENDIF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
# Enable extra compiler flags if local libraries and/or global options dictate
|
||||
SET(LOCAL_COMPILE_FLAGS "")
|
||||
FOREACH(extraarg ${ARGN})
|
||||
IF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
SET(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
|
||||
ENDIF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
IF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
SET(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
|
||||
ENDIF(${extraarg} MATCHES "STRICT" AND SCL-ENABLE_STRICT)
|
||||
ENDFOREACH(extraarg ${ARGN})
|
||||
IF(LOCAL_COMPILE_FLAGS)
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
SET_TARGET_PROPERTIES(${libname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
IF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
SET_TARGET_PROPERTIES(${libname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
IF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
SET_TARGET_PROPERTIES(${libname}-static PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
|
||||
ENDIF(BUILD_STATIC_LIBS AND NOT MSVC)
|
||||
ENDIF(LOCAL_COMPILE_FLAGS)
|
||||
ENDMACRO(SCL_ADDLIB libname srcs libs)
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
|
||||
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
|
||||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
list(REVERSE files)
|
||||
foreach (file ${files})
|
||||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
||||
if (EXISTS "$ENV{DESTDIR}${file}")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E remove "$ENV{DESTDIR}${file}"
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RESULT_VARIABLE rm_retval
|
||||
)
|
||||
if(NOT ${rm_retval} EQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
||||
endif (NOT ${rm_retval} EQUAL 0)
|
||||
else (EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
|
||||
endif (EXISTS "$ENV{DESTDIR}${file}")
|
||||
endforeach(file)
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
#scl_version_string.h defines scl_version() which returns a pretty commit description and a build timestamp.
|
||||
|
||||
set(SCL_IS_SUBBUILD "@SCL_IS_SUBBUILD@")
|
||||
|
||||
set(VERS_FILE ${SOURCE_DIR}/SCL_VERSION.txt )
|
||||
if( EXISTS ${SOURCE_DIR}/.git )
|
||||
find_package(Git QUIET)
|
||||
@@ -16,21 +14,15 @@ if( EXISTS ${SOURCE_DIR}/.git )
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags RESULT_VARIABLE res_var OUTPUT_VARIABLE GIT_COMMIT_ID )
|
||||
if( NOT ${res_var} EQUAL 0 )
|
||||
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
|
||||
if(NOT SCL_IS_SUBBUILD)
|
||||
message( WARNING "Git failed (probably no tags in repo). Build will contain revision info from ${VERS_FILE}." )
|
||||
endif(NOT SCL_IS_SUBBUILD)
|
||||
message( WARNING "Git failed (probably no tags in repo). Build will contain revision info from ${VERS_FILE}." )
|
||||
endif()
|
||||
else(GIT_FOUND)
|
||||
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
|
||||
if(NOT SCL_IS_SUBBUILD)
|
||||
message( WARNING "Git not found. Build will contain revision info from ${VERS_FILE}." )
|
||||
endif(NOT SCL_IS_SUBBUILD)
|
||||
message( WARNING "Git not found. Build will contain revision info from ${VERS_FILE}." )
|
||||
endif(GIT_FOUND)
|
||||
else()
|
||||
file( READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255 )
|
||||
if(NOT SCL_IS_SUBBUILD)
|
||||
message( WARNING "Git failed ('.git' not found). Build will contain revision info from ${VERS_FILE}." )
|
||||
endif(NOT SCL_IS_SUBBUILD)
|
||||
message( WARNING "Git failed ('.git' not found). Build will contain revision info from ${VERS_FILE}." )
|
||||
endif()
|
||||
|
||||
string( REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COMMIT_ID} )
|
||||
@@ -38,10 +30,10 @@ string( REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COMMIT_ID} )
|
||||
set( vstring "//scl_version_string.h - written by cmake. Changes will be lost!\n"
|
||||
"#ifndef SCL_VERSION_STRING\n"
|
||||
"#define SCL_VERSION_STRING\n\n"
|
||||
"/*\n** Returns a string like \"test-1-g5e1fb47, built at TIME on DATE\", where test is the\n"
|
||||
"/*\n** Returns a string like \"test-1-g5e1fb47, built on <timestamp>\", where test is the\n"
|
||||
"** name of the last tagged git revision, 1 is the number of commits since that tag,\n"
|
||||
"** 'g' is unknown, 5e1fb47 is the first 7 chars of the git sha1 commit id, and TIME\n"
|
||||
"** and DATE are substituted by the compiler.\n*/\n\n"
|
||||
"** 'g' is unknown, 5e1fb47 is the first 7 chars of the git sha1 commit id, and\n"
|
||||
"** <timestamp> is the output of your system's 'date' command.\n*/\n\n"
|
||||
"const char* scl_version() {\n"
|
||||
" return \"git commit id ${GIT_COMMIT_ID}, built at \"__TIME__\" on \"__DATE__\;\n"
|
||||
"}\n\n"
|
||||
@@ -53,6 +45,4 @@ file(WRITE scl_version_string.h.txt ${vstring} )
|
||||
# reduces needless rebuilds
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
scl_version_string.h.txt ${BINARY_DIR}/include/scl_version_string.h)
|
||||
if(NOT SCL_IS_SUBBUILD)
|
||||
message("-- scl_version_string.h is up-to-date.")
|
||||
endif(NOT SCL_IS_SUBBUILD)
|
||||
message("-- scl_version_string.h is up-to-date.")
|
||||
|
||||
+36
-4
@@ -8,17 +8,49 @@ set( CTEST_MEMORYCHECK_COMMAND /usr/bin/valgrind )
|
||||
set( CTEST_INITIAL_CACHE "
|
||||
SITE:STRING=${CTEST_SITE}
|
||||
BUILDNAME:STRING=${CTEST_BUILD_NAME}
|
||||
SCL_ENABLE_TESTING:BOOL=ON
|
||||
SCL_BUILD_TYPE:STRING=Debug
|
||||
ENABLE_TESTING:BOOL=ON
|
||||
CMAKE_BUILD_TYPE:STRING=Debug
|
||||
")
|
||||
|
||||
# find number of processors, for faster builds
|
||||
# from http://www.kitware.com/blog/home/post/63
|
||||
if(NOT DEFINED PROCESSOR_COUNT)
|
||||
# Unknown:
|
||||
set(PROCESSOR_COUNT 0)
|
||||
|
||||
# Linux:
|
||||
set(cpuinfo_file "/proc/cpuinfo")
|
||||
if(EXISTS "${cpuinfo_file}")
|
||||
file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$")
|
||||
list(LENGTH procs PROCESSOR_COUNT)
|
||||
endif()
|
||||
|
||||
# Mac:
|
||||
if(APPLE)
|
||||
find_program(cmd_sys_pro "system_profiler")
|
||||
if(cmd_sys_pro)
|
||||
execute_process(COMMAND ${cmd_sys_pro} OUTPUT_VARIABLE info)
|
||||
string(REGEX REPLACE "^.*Total Number Of Cores: ([0-9]+).*$" "\\1"
|
||||
PROCESSOR_COUNT "${info}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Windows:
|
||||
if(WIN32)
|
||||
set(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}")
|
||||
|
||||
|
||||
ctest_start(matrix)
|
||||
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
|
||||
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" OPTIONS -DSCL_ENABLE_TESTING=ON )
|
||||
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" OPTIONS -DENABLE_TESTING=ON )
|
||||
ctest_build( BUILD "${CTEST_BINARY_DIRECTORY}" )
|
||||
message("running tests")
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" INCLUDE_LABEL "cpp_schema_....*" )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL ${PROCESSOR_COUNT}
|
||||
INCLUDE_LABEL "cpp_schema_....*" )
|
||||
|
||||
message("running python script")
|
||||
execute_process( COMMAND python ../misc/wiki-scripts/update-matrix.py
|
||||
|
||||
+32
-11
@@ -1,5 +1,14 @@
|
||||
|
||||
#this sets a property so that the target doesn't get built by 'make' or 'make all'
|
||||
#useful when testing generation of schema code/compiling schem libs/etc
|
||||
FUNCTION( TESTABLE_TARGET target )
|
||||
if(ENABLE_TESTING)
|
||||
set_target_properties( ${target} PROPERTIES EXCLUDE_FROM_ALL ON )
|
||||
endif()
|
||||
ENDFUNCTION( TESTABLE_TARGET )
|
||||
|
||||
# To build one or more schemas, configure with
|
||||
# 'cmake -DSCL_BUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
|
||||
# 'cmake -DBUILD_SCHEMAS="path/to/schema.exp;path/to/schema2.exp"
|
||||
|
||||
# This function runs fedex on one express file. The generated source goes in a dir
|
||||
# in the build dir, and it is compiled into a library. A p21read executable is
|
||||
@@ -42,7 +51,7 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
|
||||
# multiple schemas, each one will use the include dirs from all previous schemas. Since
|
||||
# one header (schema.h) is always named the same, this will not work. only workaround
|
||||
# seems to be set_target_properties( <target> PROPERTIES COMPILE_FLAGS <flags> )
|
||||
set( ${PROJECT_NAME}_COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR} -I${SCL_SOURCE_DIR}/src/cldai -I${SCL_SOURCE_DIR}/src/cleditor -I${SCL_SOURCE_DIR}/src/clutils -I${SCHEMA_OUTPUT_DIR} -I${SCL_SOURCE_DIR}/src/clstepcore -I${SCL_SOURCE_DIR}/src/base" )
|
||||
set( ${PROJECT_NAME}_COMPILE_FLAGS "-I${CMAKE_CURRENT_SOURCE_DIR} -I${SCL_SOURCE_DIR}/src/cldai -I${SCL_SOURCE_DIR}/src/cleditor -I${SCL_SOURCE_DIR}/src/clutils -I${SCHEMA_OUTPUT_DIR} -I${SCL_SOURCE_DIR}/src/clstepcore" )
|
||||
|
||||
add_custom_target( generate_cpp_${SCHEMA_SHORT_NAME} SOURCES ${FEDEX_OUT} )
|
||||
add_custom_command( OUTPUT ${SCHEMA_OUTPUT_DIR}
|
||||
@@ -54,11 +63,20 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
|
||||
WORKING_DIRECTORY ${SCHEMA_OUTPUT_DIR}
|
||||
COMMENT "Running fedex_plus for ${SCHEMA_SHORT_NAME}..."
|
||||
VERBATIM )
|
||||
# if testing is enabled, "TESTABLE" sets property EXCLUDE_FROM_ALL and prevents installation
|
||||
SCL_ADDLIB( ${PROJECT_NAME} "${FEDEX_OUT}" "stepdai stepcore express stepeditor steputils base" "TESTABLE" )
|
||||
if(MSVC OR BORLAND)
|
||||
add_definitions( -DSCL_SCHEMA_DLL_EXPORTS )
|
||||
add_definitions( -DSCL_EXPRESS_DLL_IMPORTS )
|
||||
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
|
||||
add_definitions( -DSCL_DAI_DLL_IMPORTS )
|
||||
add_definitions( -DSCL_CORE_DLL_IMPORTS )
|
||||
add_definitions( -DSCL_EDITOR_DLL_IMPORTS )
|
||||
endif()
|
||||
add_library( ${PROJECT_NAME} SHARED ${FEDEX_OUT} )
|
||||
target_link_libraries(${PROJECT_NAME} stepdai stepcore express stepeditor steputils )
|
||||
add_dependencies( ${PROJECT_NAME} generate_cpp_${SCHEMA_SHORT_NAME} )
|
||||
set_target_properties( ${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
|
||||
${${PROJECT_NAME}_COMPILE_FLAGS} )
|
||||
TESTABLE_TARGET( ${PROJECT_NAME} )
|
||||
|
||||
add_test( NAME generate_cpp_${SCHEMA_SHORT_NAME}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
@@ -76,16 +94,19 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
|
||||
set_tests_properties( build_cpp_${PROJECT_NAME} PROPERTIES DEPENDS generate_cpp_${SCHEMA_SHORT_NAME} LABELS cpp_schema_build )
|
||||
|
||||
if(MSVC OR BORLAND)
|
||||
set( WIN_EXTRA_SRCS ${SCL_SOURCE_DIR}/src/fedex_plus/xgetopt.cc )
|
||||
add_executable( p21read_${PROJECT_NAME} ${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc ${SCL_SOURCE_DIR}/src/fedex_plus/xgetopt.cc )
|
||||
else()
|
||||
add_executable( p21read_${PROJECT_NAME} ${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc )
|
||||
endif()
|
||||
SCL_ADDEXEC( p21read_${PROJECT_NAME} "${SCL_SOURCE_DIR}/src/test/p21read/p21read.cc ${WIN_EXTRA_SRCS}" "${PROJECT_NAME}" "TESTABLE" )
|
||||
add_dependencies( p21read_${PROJECT_NAME} version_string )
|
||||
target_link_libraries( p21read_${PROJECT_NAME} ${PROJECT_NAME} )
|
||||
set_target_properties( p21read_${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
|
||||
${${PROJECT_NAME}_COMPILE_FLAGS} )
|
||||
TESTABLE_TARGET( p21read_${PROJECT_NAME} )
|
||||
|
||||
#find all part 21 files in schema dir, add a test for each one
|
||||
get_filename_component( SCHEMA_DIR ${SCHEMA_FILE} PATH )
|
||||
file( GLOB_RECURSE P21_FILES ${SCHEMA_DIR}/*.stp ${SCHEMA_DIR}/*.step ${SCHEMA_DIR}/*.p21 ${SCHEMA_DIR}/*.ifc )
|
||||
file( GLOB_RECURSE P21_FILES ${SCHEMA_DIR}/*.stp ${SCHEMA_DIR}/*.step ${SCHEMA_DIR}/*.p21 )
|
||||
foreach( TEST_FILE ${P21_FILES} )
|
||||
get_filename_component( FNAME ${TEST_FILE} NAME_WE )
|
||||
add_test( NAME read_write_cpp_${SCHEMA_SHORT_NAME}_${FNAME}
|
||||
@@ -96,11 +117,11 @@ FUNCTION(BUILD_A_SCHEMA SCHEMA_FILE)
|
||||
|
||||
ENDFUNCTION(BUILD_A_SCHEMA)
|
||||
|
||||
if( DEFINED SCL_BUILD_SCHEMAS )
|
||||
if( SCL_BUILD_SCHEMAS STREQUAL "ALL" )
|
||||
file( GLOB_RECURSE SCL_BUILD_SCHEMAS ${SCL_SOURCE_DIR}/data/*.exp )
|
||||
if( DEFINED BUILD_SCHEMAS )
|
||||
if( BUILD_SCHEMAS STREQUAL "ALL" )
|
||||
file( GLOB_RECURSE BUILD_SCHEMAS ${SCL_SOURCE_DIR}/data/*.exp )
|
||||
endif()
|
||||
foreach( ap ${SCL_BUILD_SCHEMAS} )
|
||||
foreach( ap ${BUILD_SCHEMAS} )
|
||||
BUILD_A_SCHEMA( ${ap} )
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
+5
-12
@@ -1,14 +1,7 @@
|
||||
SET(scl_MANS
|
||||
man/man1/dataprobe.1
|
||||
man/man1/fedex.1
|
||||
man/man1/fedex_plus.1
|
||||
man/man1/mkProbe.1
|
||||
man/man1/dataprobe.1
|
||||
man/man1/fedex.1
|
||||
man/man1/fedex_plus.1
|
||||
man/man1/mkProbe.1
|
||||
)
|
||||
|
||||
if(NOT DEFINED MAN_DIR)
|
||||
set(MAN_DIR share/man)
|
||||
endif(NOT DEFINED MAN_DIR)
|
||||
|
||||
IF(NOT WIN32)
|
||||
INSTALL(FILES ${scl_MANS} DESTINATION ${CMAKE_INSTALL_PREFIX}/${MAN_DIR}/man1)
|
||||
ENDIF(NOT WIN32)
|
||||
INSTALL(FILES ${scl_MANS} DESTINATION ${MAN_DIR}/man1)
|
||||
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -37,7 +37,7 @@ PROJECT_NUMBER = 3.2
|
||||
# for a project that appears at the top of each page and should give viewer
|
||||
# a quick idea about the purpose of the project. Keep the description short.
|
||||
|
||||
PROJECT_BRIEF = "STEPcode"
|
||||
PROJECT_BRIEF = "STEP Class Library"
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify an logo or icon that is
|
||||
# included in the documentation. The maximum height of the logo should not
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -68,7 +68,7 @@
|
||||
<qtHelp collectionFile="./doc/helpcollection.qhc"
|
||||
projectFile="./doc/helpcollection.qhcp"
|
||||
storage="./doc/qch" copyAction="copy">
|
||||
<title>STEPcode</title>
|
||||
<title>StepClassLibrary</title>
|
||||
<startPage>qthelp://com.github.mpictor/doc/index.html</startPage>
|
||||
<!-- See http://doc.trolltech.com/assistant-custom-help-viewer.html for more
|
||||
settings in the <assistant> section. -->
|
||||
@@ -100,7 +100,7 @@
|
||||
-->
|
||||
<project>
|
||||
<!-- The name of the project -->
|
||||
<name>STEPcode</name>
|
||||
<name>StepClassLibrary</name>
|
||||
<!-- The version number of the documentation -->
|
||||
<version>0.2</version>
|
||||
<!-- Whether to build version specific documentation for the projects or not.
|
||||
|
||||
@@ -47,16 +47,16 @@ $mathjax
|
||||
<!-- add module list -->
|
||||
<div id="navrow0" class="tabs">
|
||||
<ul class="tablist">
|
||||
<li><a href="../../doc.STEPcode/doxygen-html/index.html"><span>Main</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.CLDAI/doxygen-html/index.html"><span>CLDAI</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.CLEditor/doxygen-html/index.html"><span>CLEditor</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.CLProbe-ui/doxygen-html/index.html"><span>CLProbe-ui</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.CLStepCore/doxygen-html/index.html"><span>CLStepCore</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.CLUtils/doxygen-html/index.html"><span>CLUtils</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.ExPPP/doxygen-html/index.html"><span>ExPPP</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.Express/doxygen-html/index.html"><span>Express</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.Fedex-Plus/doxygen-html/index.html"><span>Fedex-Plus</span></a></li>
|
||||
<li><a href="../../doc.STEPcode.Tests/doxygen-html/index.html"><span>Tests</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary/doxygen-html/index.html"><span>Main</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.CLDAI/doxygen-html/index.html"><span>CLDAI</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.CLEditor/doxygen-html/index.html"><span>CLEditor</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.CLProbe-ui/doxygen-html/index.html"><span>CLProbe-ui</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.CLStepCore/doxygen-html/index.html"><span>CLStepCore</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.CLUtils/doxygen-html/index.html"><span>CLUtils</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.ExPPP/doxygen-html/index.html"><span>ExPPP</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.Express/doxygen-html/index.html"><span>Express</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.Fedex-Plus/doxygen-html/index.html"><span>Fedex-Plus</span></a></li>
|
||||
<li><a href="../../doc.StepClassLibrary.Tests/doxygen-html/index.html"><span>Tests</span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- end module list -->
|
||||
|
||||
Binary file not shown.
+6105
File diff suppressed because it is too large
Load Diff
@@ -106,7 +106,6 @@ GLOBAL SCL_EXPRESS_EXPORT char DICT_type; /**< set as a side-effect of DICT loo
|
||||
/***********************/
|
||||
|
||||
extern SCL_EXPRESS_EXPORT void DICTinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void DICTcleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT int DICTdefine PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
|
||||
extern SCL_EXPRESS_EXPORT int DICT_define PROTO( ( Dictionary, char *, Generic, Symbol *, char ) );
|
||||
extern SCL_EXPRESS_EXPORT void DICTundefine PROTO( ( Dictionary, char * ) );
|
||||
|
||||
@@ -184,12 +184,10 @@ static_inline void ERRORflush_messages( void ) {
|
||||
|
||||
extern SCL_EXPRESS_EXPORT void ERRORinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORinitialize_after_LIST PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORcleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORnospace PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORabort PROTO( ( int ) );
|
||||
extern SCL_EXPRESS_EXPORT Error ERRORcreate PROTO( ( char *, Severity ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORreport PROTO( ( Error, ... ) );
|
||||
extern SCL_EXPRESS_EXPORT void ERRORdestroy PROTO( ( Error ) );
|
||||
|
||||
struct Symbol_; /* mention Symbol to avoid warning on following line */
|
||||
extern SCL_EXPRESS_EXPORT void ERRORreport_with_symbol PROTO( ( Error, struct Symbol_ *, ... ) );
|
||||
|
||||
@@ -270,7 +270,6 @@ extern SCL_EXPRESS_EXPORT Expression BIN_EXPcreate PROTO( ( Op_Code, Expressio
|
||||
extern SCL_EXPRESS_EXPORT Expression TERN_EXPcreate PROTO( ( Op_Code, Expression, Expression, Expression ) );
|
||||
extern SCL_EXPRESS_EXPORT Expression QUERYcreate PROTO( ( Symbol *, Expression ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPcleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT Type EXPtype PROTO( ( Expression, struct Scope_ * ) );
|
||||
extern SCL_EXPRESS_EXPORT int EXPget_integer_value PROTO( ( Expression ) );
|
||||
|
||||
|
||||
@@ -266,10 +266,8 @@ GLOBAL SCL_EXPRESS_EXPORT char * KW_XOR INITIALLY( "XOR" );
|
||||
/***********************/
|
||||
|
||||
extern SCL_EXPRESS_EXPORT Express EXPRESScreate PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPRESSdestroy PROTO( ( Express ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPRESSparse PROTO( ( Express, FILE *, char * ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPRESSinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPRESScleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void EXPRESSresolve PROTO( ( Express ) );
|
||||
extern SCL_EXPRESS_EXPORT char * EXPRESSversion PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT int EXPRESS_fail PROTO( ( Express ) );
|
||||
|
||||
@@ -135,7 +135,6 @@ GLOBAL SCL_EXPRESS_EXPORT Linked_List LINK__l; /* for LISTcreate_with macro
|
||||
/***********************/
|
||||
|
||||
extern SCL_EXPRESS_EXPORT void LISTinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void LISTcleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List LISTcreate PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List LISTcopy PROTO( ( Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic LISTadd_first PROTO( ( Linked_List, Generic ) );
|
||||
|
||||
@@ -108,7 +108,6 @@ GLOBAL SCL_EXPRESS_EXPORT struct Object * OBJ;
|
||||
/***********************/
|
||||
|
||||
extern SCL_EXPRESS_EXPORT void OBJinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void OBJcleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void OBJcreate PROTO( ( char, struct Symbol_ * ( * )( Generic ), char *, int ) );
|
||||
extern SCL_EXPRESS_EXPORT Symbol * UNK_get_symbol PROTO( ( Generic x ) );
|
||||
|
||||
|
||||
@@ -82,7 +82,6 @@ GLOBAL SCL_EXPRESS_EXPORT Error ERROR_ambiguous_group INITIALLY( ERROR_
|
||||
/***********************/
|
||||
|
||||
extern SCL_EXPRESS_EXPORT void RESOLVEinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void RESOLVEcleanup PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPEresolve_expressions_statements PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPEresolve_subsupers PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPEresolve_types PROTO( ( Scope ) );
|
||||
|
||||
@@ -155,7 +155,6 @@ extern SCL_EXPRESS_EXPORT Generic SCHEMAfind PROTO( ( Schema, char * name, int
|
||||
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate PROTO( ( char ) );
|
||||
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate_tiny PROTO( ( char ) );
|
||||
extern SCL_EXPRESS_EXPORT Scope SCOPEcreate_nostab PROTO( ( char ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPEdestroy PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCHEMAget_entities_use PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCHEMAget_entities_ref PROTO( ( Scope ) );
|
||||
|
||||
|
||||
@@ -132,13 +132,6 @@ struct Scope_ {
|
||||
#define SCOPEdo_entities(s,t,de) DICTdo_type_init(s->symbol_table,&de,OBJ_ENTITY); { \
|
||||
Entity t; \
|
||||
while (0 != (t = (Entity)DICTdo(&de))) {
|
||||
#define SCOPEdo_functions(s,t,de) DICTdo_type_init(s->symbol_table,&de,OBJ_FUNCTION); { \
|
||||
Entity t; \
|
||||
while (0 != (t = (Entity)DICTdo(&de))) {
|
||||
#define SCOPEdo_rules(s,t,de) DICTdo_type_init(s->symbol_table,&de,OBJ_RULE); { \
|
||||
Entity t; \
|
||||
while (0 != (t = (Entity)DICTdo(&de))) {
|
||||
|
||||
#define SCOPEod }}
|
||||
|
||||
/***********************/
|
||||
@@ -150,9 +143,5 @@ extern SCL_EXPRESS_EXPORT void SCOPE_get_entities PROTO( ( Scope, Linked_Lis
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_entities PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_entities_superclass_order PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT Generic SCOPEfind PROTO( ( Scope, char *, int ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPE_get_functions PROTO( ( Scope, Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_functions PROTO( ( Scope ) );
|
||||
extern SCL_EXPRESS_EXPORT void SCOPE_get_rules PROTO( ( Scope, Linked_List ) );
|
||||
extern SCL_EXPRESS_EXPORT Linked_List SCOPEget_rules PROTO( ( Scope ) );
|
||||
|
||||
#endif /* SCOPE_H */
|
||||
|
||||
@@ -235,8 +235,6 @@ GLOBAL SCL_EXPRESS_EXPORT Error ERROR_corrupted_type INITIALLY( ERROR_none );
|
||||
#define TYPEis_identifier(t) ((t)->u.type->body->type == identifier_)
|
||||
#define TYPEis_logical(t) ((t)->u.type->body->type == logical_)
|
||||
#define TYPEis_boolean(t) ((t)->u.type->body->type == boolean_)
|
||||
#define TYPEis_real(t) ((t)->u.type->body->type == real_)
|
||||
#define TYPEis_integer(t) ((t)->u.type->body->type == integer_)
|
||||
#define TYPEis_string(t) ((t)->u.type->body->type == string_)
|
||||
#define TYPEis_expression(t) ((t)->u.type->body->type == op_)
|
||||
#define TYPEis_oneof(t) ((t)->u.type->body->type == oneof_)
|
||||
@@ -304,7 +302,6 @@ extern SCL_EXPRESS_EXPORT Type TYPEcreate_name PROTO( ( struct Symbol_ * ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEcreate_nostab PROTO( ( struct Symbol_ *, Scope, char ) );
|
||||
extern SCL_EXPRESS_EXPORT TypeBody TYPEBODYcreate PROTO( ( enum type_enum ) );
|
||||
extern SCL_EXPRESS_EXPORT void TYPEinitialize PROTO( ( void ) );
|
||||
extern SCL_EXPRESS_EXPORT void TYPEcleanup PROTO( ( void ) );
|
||||
|
||||
extern SCL_EXPRESS_EXPORT bool TYPEinherits_from PROTO( ( Type, enum type_enum ) );
|
||||
extern SCL_EXPRESS_EXPORT Type TYPEget_nonaggregate_base_type PROTO( ( Type ) );
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
#cmakedefine HAVE_PROCESS_H 1
|
||||
#cmakedefine HAVE_IO_H 1
|
||||
|
||||
#cmakedefine YYTEXT_POINTER 1
|
||||
#cmakedefine SCL_TRACE_FPRINTF 1
|
||||
#cmakedefine SCL_MEMMGR_ENABLE_CHECKS 1
|
||||
|
||||
#cmakedefine HAVE_ABS 1
|
||||
#cmakedefine HAVE_MEMCPY 1
|
||||
#cmakedefine HAVE_MEMMOVE 1
|
||||
@@ -24,6 +20,4 @@
|
||||
|
||||
#cmakedefine HAVE_SSIZE_T 1
|
||||
|
||||
#cmakedefine HAVE_STD_THREAD 1
|
||||
|
||||
#endif /* SCL_CF_H */
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
#ifndef SCL_EXPORT_H
|
||||
#define SCL_EXPORT_H
|
||||
|
||||
/* Import/Export flags for base. */
|
||||
#ifndef SCL_BASE_EXPORT
|
||||
# if defined(SCL_BASE_DLL_EXPORTS) && defined(SCL_BASE_DLL_IMPORTS)
|
||||
# error "Only SCL_BASE_DLL_EXPORTS or SCL_BASE_DLL_IMPORTS can be defined, not both."
|
||||
# elif defined(SCL_BASE_DLL_EXPORTS)
|
||||
# define SCL_BASE_EXPORT __declspec(dllexport)
|
||||
# elif defined(SCL_BASE_DLL_IMPORTS)
|
||||
# define SCL_BASE_EXPORT __declspec(dllimport)
|
||||
# else
|
||||
# define SCL_BASE_EXPORT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Import/Export flags for express. */
|
||||
#ifndef SCL_EXPRESS_EXPORT
|
||||
# if defined(SCL_EXPRESS_DLL_EXPORTS) && defined(SCL_EXPRESS_DLL_IMPORTS)
|
||||
|
||||
@@ -1,229 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE language SYSTEM "language.dtd">
|
||||
<!--
|
||||
EXPRESS syntax definition based on sql-mysql.xml by Shane Wright (me@shanewright.co.uk)
|
||||
|
||||
This is for Kate, the KDE editor. Rename to express.xml and place in the syntax directory (on Debian, this is /usr/share/kde4/apps/katepart/syntax )
|
||||
-->
|
||||
<language name="EXPRESS" version="0.1" kateversion="2.5" section="Database" extensions="*.exp;*.EXP;*.p11" mimetype="text/x-express" casesensitive="0" author="Mark Pictor (mpictor@gmail.com)" license="">
|
||||
<highlighting>
|
||||
<list name="keywords">
|
||||
<item> of </item>
|
||||
<item> or </item>
|
||||
<item> to </item>
|
||||
<item> where </item>
|
||||
<item> subtype </item>
|
||||
<item> supertype </item>
|
||||
<item> abstract </item>
|
||||
<item> oneof </item>
|
||||
<item> not </item>
|
||||
<item> in </item>
|
||||
<item> and </item>
|
||||
<item> return </item>
|
||||
<item> then </item>
|
||||
<item> derive </item>
|
||||
<item> optional </item>
|
||||
<!-- put SCHEMA and END_SCHEMA here so code folding will fold
|
||||
everything in a schema, and not collapse the schema itself -->
|
||||
<item> schema </item>
|
||||
<item> end_schema </item>
|
||||
</list>
|
||||
<list name="kw_begin"> <!-- kw's that can begin a foldable region -->
|
||||
<item> type </item>
|
||||
<item> entity </item>
|
||||
<item> function </item>
|
||||
<item> rule </item>
|
||||
<item> constant </item>
|
||||
<item> if </item>
|
||||
<item> local </item>
|
||||
<item> repeat </item>
|
||||
<item> begin </item>
|
||||
<item> case </item>
|
||||
</list>
|
||||
<list name="kw_end"> <!-- kw's that can end a foldable region -->
|
||||
<item> end </item>
|
||||
<item> end_type </item>
|
||||
<item> end_entity </item>
|
||||
<item> end_function </item>
|
||||
<item> end_rule </item>
|
||||
<item> end_constant </item>
|
||||
<item> end_if </item>
|
||||
<item> end_local </item>
|
||||
<item> end_repeat </item>
|
||||
<item> end_case </item>
|
||||
</list>
|
||||
<list name="kw_end_begin"> <!-- end one foldable region, begin another -->
|
||||
<item> else </item>
|
||||
</list>
|
||||
<list name="interface_specification"> <!-- USE FROM, REFERENCE FROM -->
|
||||
<item> use </item>
|
||||
<item> reference </item>
|
||||
</list>
|
||||
|
||||
<list name="operators">
|
||||
<item> : </item>
|
||||
<item> , </item>
|
||||
<item> || </item>
|
||||
<item> . </item>
|
||||
<item> = </item>
|
||||
<item> ** </item>
|
||||
<item> | </item>
|
||||
<item> <* </item>
|
||||
<item> >= </item>
|
||||
<item> > </item>
|
||||
<item> :=: </item>
|
||||
<item> :<>: </item>
|
||||
<item> [ </item>
|
||||
<item> { </item>
|
||||
<item> ( </item>
|
||||
<item> <= </item>
|
||||
<item> < </item>
|
||||
<item> - </item>
|
||||
<item> <> </item>
|
||||
<item> + </item>
|
||||
<item> / </item>
|
||||
<item> ] </item>
|
||||
<item> } </item>
|
||||
<item> ) </item>
|
||||
<item> * </item>
|
||||
<item> \\ </item>
|
||||
</list>
|
||||
<list name="functions">
|
||||
<item> ABS </item>
|
||||
<item> ACOS </item>
|
||||
<item> ASIN </item>
|
||||
<item> ATAN </item>
|
||||
<item> BLENGTH </item>
|
||||
<item> COS </item>
|
||||
<item> EXISTS </item>
|
||||
<item> EXP </item>
|
||||
<item> FORMAT </item>
|
||||
<item> HIBOUND </item>
|
||||
<item> HIINDEX </item>
|
||||
<item> LENGTH </item>
|
||||
<item> LOBOUND </item>
|
||||
<item> LOINDEX </item>
|
||||
<item> LOG </item>
|
||||
<item> LOG2 </item>
|
||||
<item> LOG10 </item>
|
||||
<item> NVL </item>
|
||||
<item> ODD </item>
|
||||
<item> ROLESOF </item>
|
||||
<item> SIN </item>
|
||||
<item> SIZEOF </item>
|
||||
<item> SQRT </item>
|
||||
<item> TAN </item>
|
||||
<item> TYPEOF </item>
|
||||
<item> USEDIN </item>
|
||||
<item> VALUE </item>
|
||||
<item> VALUE_IN </item>
|
||||
<item> VALUE_UNIQUE </item>
|
||||
<item> QUERY </item>
|
||||
</list>
|
||||
<list name="constants">
|
||||
<item> CONST_E </item>
|
||||
<item> PI </item>
|
||||
<item> SELF </item>
|
||||
<!-- <item> ? </item> -->
|
||||
</list>
|
||||
<list name="types">
|
||||
<item> binary </item>
|
||||
<item> boolean </item>
|
||||
<item> integer </item>
|
||||
<item> logical </item>
|
||||
<item> number </item>
|
||||
<item> real </item>
|
||||
<item> string </item>
|
||||
<item> enumeration </item>
|
||||
<item> select </item>
|
||||
<item> array </item>
|
||||
<item> list </item>
|
||||
<item> bag </item>
|
||||
<item> set </item>
|
||||
<item> generic </item>
|
||||
</list>
|
||||
<contexts>
|
||||
<context name="Normal" attribute="Normal Text" lineEndContext="#stay">
|
||||
<DetectSpaces />
|
||||
<!-- Make code folding work for SCHEMA/END_SCHEMA, TYPE/END_TYPE, etc -->
|
||||
<!-- <RegExpr attribute="Block" context="#stay" String="(?:^|[^\w'])(?:SCHEMA|TYPE|ENTITY|FUNCTION|RULE|CONSTANT|IF|LOCAL|REPEAT|BEGIN)" insensitive="false" beginRegion="Blk" firstNonSpace="false" /> -->
|
||||
<!-- <RegExpr attribute="Block" context="#stay" String="END_(?:SCHEMA|TYPE|ENTITY|FUNCTION|RULE|CONSTANT|IF|LOCAL|REPEAT)" insensitive="false" endRegion="Blk" firstNonSpace="false" /> -->
|
||||
<!-- <RegExpr attribute="Block" context="#stay" String="END(?:[^_]|$)" endRegion="Blk" firstNonSpace="false" /> -->
|
||||
<!-- <RegExpr attribute="Block" context="#stay" String="(?:^|[^\w])ELSE(?:$|[^\w])" endRegion="Blk" beginRegion="Blk" firstNonSpace="false" /> -->
|
||||
|
||||
<!-- using the lists -->
|
||||
<keyword attribute="Keyword" context="#stay" String="keywords"/>
|
||||
<keyword attribute="Keyword" context="#stay" String="kw_begin" beginRegion="Blk" firstNonSpace="false"/>
|
||||
<keyword attribute="Keyword" context="#stay" String="kw_end_begin" endRegion="Blk" beginRegion="Blk" firstNonSpace="false" />
|
||||
<keyword attribute="Keyword" context="#stay" String="kw_end" endRegion="Blk" firstNonSpace="false"/>
|
||||
|
||||
<keyword attribute="Operator" context="#stay" String="operators"/>
|
||||
<keyword attribute="Function" context="#stay" String="functions"/>
|
||||
<keyword attribute="Constants" context="#stay" String="constants"/>
|
||||
<keyword attribute="Data Type" context="#stay" String="types"/>
|
||||
|
||||
<keyword attribute="Interface Specification" context="Interface Specification" String="interface_specification" firstNonSpace="true" />
|
||||
|
||||
<DetectIdentifier />
|
||||
<!-- extra data types -->
|
||||
<!-- numbers -->
|
||||
<HlCHex attribute="Hex" context="#stay"/>
|
||||
<Float attribute="Float" context="#stay"/>
|
||||
<Int attribute="Decimal" context="#stay"/>
|
||||
<!-- strings -->
|
||||
<DetectChar attribute="String" context="String" char="'"/>
|
||||
<DetectChar attribute="String" context="String2" char="""/>
|
||||
<!-- comments -->
|
||||
<Detect2Chars attribute="Comment" context="SingleLineComment" char="-" char1="-"/>
|
||||
<Detect2Chars attribute="Comment" context="MultiLineComment" char="(" char1="*" beginRegion="Comment"/>
|
||||
|
||||
<DetectChar attribute="Constants" context="#stay" char="?"/>
|
||||
</context>
|
||||
<!-- 'string' -->
|
||||
<context name="String" attribute="String" lineEndContext="#stay">
|
||||
<LineContinue attribute="String" context="#pop"/>
|
||||
<DetectChar attribute="String" context="#pop" char="'"/>
|
||||
</context>
|
||||
<!-- "string", extra context needed to enable "str'ing" and 'str"ing' -->
|
||||
<context name="String2" attribute="String" lineEndContext="#stay">
|
||||
<LineContinue attribute="String" context="#pop"/>
|
||||
<HlCStringChar attribute="String Char" context="#stay"/>
|
||||
<DetectChar attribute="String" context="#pop" char="""/>
|
||||
</context>
|
||||
<!-- comments -->
|
||||
<context name="SingleLineComment" attribute="Comment" lineEndContext="#pop"/>
|
||||
<context name="MultiLineComment" attribute="Comment" lineEndContext="#stay">
|
||||
<Detect2Chars attribute="Comment" context="#pop" char="*" char1=")" endRegion="Comment" />
|
||||
</context>
|
||||
<context name="Interface Specification" attribute="Interface Specification" >
|
||||
<!-- lineEndContext="#pop" -->
|
||||
<DetectChar attribute="Interface Specification" context="#pop" char=";"/>
|
||||
</context>
|
||||
</contexts>
|
||||
<itemDatas>
|
||||
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
|
||||
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
|
||||
<itemData name="Block" defStyleNum="dsKeyword" spellChecking="false"/>
|
||||
<itemData name="Operator" defStyleNum="dsNormal" spellChecking="false"/>
|
||||
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
|
||||
<itemData name="Constants" defStyleNum="dsOthers" spellChecking="false"/>
|
||||
<itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/>
|
||||
<itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/>
|
||||
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/>
|
||||
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/>
|
||||
<itemData name="String" defStyleNum="dsString"/>
|
||||
<itemData name="String Char" defStyleNum="dsChar" spellChecking="false"/>
|
||||
<itemData name="Comment" defStyleNum="dsComment"/>
|
||||
<itemData name="Interface Specification" defStyleNum="dsOthers" spellChecking="false"/>
|
||||
</itemDatas>
|
||||
</highlighting>
|
||||
<general>
|
||||
<comments>
|
||||
<comment name="singleLine" start="--"/>
|
||||
<comment name="multiLine" start="(*" end="*)"/>
|
||||
</comments>
|
||||
<keywords casesensitive="0" additionalDeliminator="'" />
|
||||
<!-- weakDeliminator="+-*/|=!<>~^:." -->
|
||||
</general>
|
||||
</language>
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<NotepadPlus>
|
||||
<UserLang name="Express Schema" ext="exp">
|
||||
<Settings>
|
||||
<Global caseIgnored="yes" />
|
||||
<TreatAsSymbol comment="no" commentLine="no" />
|
||||
<Prefix words1="no" words2="no" words3="no" words4="no" />
|
||||
</Settings>
|
||||
<KeywordLists>
|
||||
<Keywords name="Delimiters">000000</Keywords>
|
||||
<Keywords name="Folder+">type entity function rule constant if local repeat begin case else</Keywords>
|
||||
<Keywords name="Folder-">end_type end_entity end_function end_rule end_constant end_if end_local end_repeat end end_base else</Keywords>
|
||||
<Keywords name="Operators">" , . / : ; [ \ ] { | } < = ></Keywords>
|
||||
<Keywords name="Comment"> 1(* 2*) 0--</Keywords>
|
||||
<Keywords name="Words1">of or to where subtype supertype abstract oneof not in and return then derive optional schema end_schema</Keywords>
|
||||
<Keywords name="Words2">abs acos asin atan blength cos exists exp format hibound hiindex length lobound loindex log log2 log10 nvl odd rolesof sin sizeof sqrt tan typeof usedin value value_in value_unique query</Keywords>
|
||||
<Keywords name="Words3">const_e pi self</Keywords>
|
||||
<Keywords name="Words4">binary boolean integer logical number real string enumeration select array list bag set generic</Keywords>
|
||||
</KeywordLists>
|
||||
<Styles>
|
||||
<WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="FOLDEROPEN" styleID="12" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="KEYWORD1" styleID="5" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="KEYWORD2" styleID="6" fgColor="800000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="KEYWORD3" styleID="7" fgColor="FF8000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="KEYWORD4" styleID="8" fgColor="0000FF" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="NUMBER" styleID="4" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="OPERATOR" styleID="10" fgColor="FF0000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="DELIMINER1" styleID="14" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
|
||||
<WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontStyle="0" />
|
||||
</Styles>
|
||||
</UserLang>
|
||||
</NotepadPlus>
|
||||
+42
-21
@@ -8,8 +8,8 @@ set( CTEST_MEMORYCHECK_COMMAND /usr/bin/valgrind )
|
||||
set( CTEST_INITIAL_CACHE "
|
||||
SITE:STRING=${CTEST_SITE}
|
||||
BUILDNAME:STRING=${CTEST_BUILD_NAME}
|
||||
SCL_ENABLE_TESTING:BOOL=ON
|
||||
SCL_BUILD_TYPE:STRING=Debug
|
||||
ENABLE_TESTING:BOOL=ON
|
||||
CMAKE_BUILD_TYPE:STRING=Debug
|
||||
")
|
||||
|
||||
|
||||
@@ -50,6 +50,38 @@ function( SUBMIT_TEST part )
|
||||
endif()
|
||||
endfunction( SUBMIT_TEST part )
|
||||
|
||||
# find number of processors, for faster builds
|
||||
# from http://www.kitware.com/blog/home/post/63
|
||||
if(NOT DEFINED PROCESSOR_COUNT)
|
||||
# Unknown:
|
||||
set(PROCESSOR_COUNT 0)
|
||||
|
||||
# Linux:
|
||||
set(cpuinfo_file "/proc/cpuinfo")
|
||||
if(EXISTS "${cpuinfo_file}")
|
||||
file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$")
|
||||
list(LENGTH procs PROCESSOR_COUNT)
|
||||
endif()
|
||||
|
||||
# Mac:
|
||||
if(APPLE)
|
||||
find_program(cmd_sys_pro "system_profiler")
|
||||
if(cmd_sys_pro)
|
||||
execute_process(COMMAND ${cmd_sys_pro} OUTPUT_VARIABLE info)
|
||||
string(REGEX REPLACE "^.*Total Number Of Cores: ([0-9]+).*$" "\\1"
|
||||
PROCESSOR_COUNT "${info}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Windows:
|
||||
if(WIN32)
|
||||
set(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}")
|
||||
|
||||
|
||||
######################################################
|
||||
##### To disable reporting of a set of tests, comment
|
||||
##### out the SUBMIT_TEST line immediately following
|
||||
@@ -62,33 +94,29 @@ endfunction( SUBMIT_TEST part )
|
||||
ctest_start(Experimental)
|
||||
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
|
||||
|
||||
file(WRITE "${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake" "
|
||||
set( CTEST_CUSTOM_ERROR_EXCEPTION \"{standard input}:[0-9][0-9]*: WARNING: \")
|
||||
")
|
||||
|
||||
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND OPTIONS -DSCL_ENABLE_TESTING=ON )
|
||||
ctest_configure( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND OPTIONS -DENABLE_TESTING=ON )
|
||||
SUBMIT_TEST( Configure )
|
||||
ctest_build( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND )
|
||||
SUBMIT_TEST( Build )
|
||||
# ctest_memcheck( BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res )
|
||||
# ctest_memcheck( BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL ${PROCESSOR_COUNT} )
|
||||
|
||||
if(NOT SKIP_TEST_UNITARY_SCHEMAS )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
INCLUDE_LABEL "unitary_schemas" )
|
||||
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "unitary_schemas" )
|
||||
SUBMIT_TEST( Test )
|
||||
endif()
|
||||
|
||||
if(NOT SKIP_CPP_TEST_SCHEMA_GEN )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
INCLUDE_LABEL "cpp_schema_gen" )
|
||||
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_gen" )
|
||||
SUBMIT_TEST( Test )
|
||||
if(NOT SKIP_CPP_TEST_SCHEMA_BUILD )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
INCLUDE_LABEL "cpp_schema_build" )
|
||||
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_build" )
|
||||
SUBMIT_TEST( Test )
|
||||
if(NOT SKIP_CPP_TEST_SCHEMA_RW )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
INCLUDE_LABEL "cpp_schema_rw" )
|
||||
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "cpp_schema_rw" )
|
||||
SUBMIT_TEST( Test )
|
||||
endif()
|
||||
endif()
|
||||
@@ -97,19 +125,12 @@ endif()
|
||||
if(NOT SKIP_TEST_EXCHANGE_FILE )
|
||||
if( SKIP_CPP_TEST_SCHEMA_BUILD )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
INCLUDE "build_cpp_sdai_AP214E3_2010" )
|
||||
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE "build_cpp_sdai_AP214E3_2010" )
|
||||
SUBMIT_TEST( Test )
|
||||
endif()
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
INCLUDE_LABEL "exchange_file" )
|
||||
PARALLEL_LEVEL ${PROCESSOR_COUNT} INCLUDE_LABEL "exchange_file" )
|
||||
SUBMIT_TEST( Test )
|
||||
endif()
|
||||
|
||||
if(NOT SKIP_TEST_CPP_SCHEMA_SPECIFIC )
|
||||
ctest_test( BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
|
||||
INCLUDE_LABEL "cpp_schema_specific" )
|
||||
SUBMIT_TEST( Test )
|
||||
endif()
|
||||
|
||||
|
||||
# ctest_coverage( )
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
set(SCL_BASE_SOURCES
|
||||
scl_memmgr.cc
|
||||
scl_trace_fprintf.c
|
||||
)
|
||||
|
||||
include_directories(
|
||||
${SCL_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
if(MSVC OR BORLAND)
|
||||
add_definitions( -DSCL_BASE_DLL_EXPORTS )
|
||||
endif()
|
||||
|
||||
SCL_ADDLIB(base "${SCL_BASE_SOURCES}" "")
|
||||
@@ -1,408 +0,0 @@
|
||||
|
||||
#define SCL_MEMMGR_CC
|
||||
|
||||
#include <scl_cf.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
#if __APPLE__
|
||||
# include <malloc/malloc.h>
|
||||
#else
|
||||
# include <malloc.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
|
||||
#include <string>
|
||||
#include <set>
|
||||
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
|
||||
/**
|
||||
scl_memmgr_error definition
|
||||
*/
|
||||
class scl_memmgr_error {
|
||||
private:
|
||||
std::string _srcfile;
|
||||
unsigned int _srcline;
|
||||
unsigned int _occurences;
|
||||
public:
|
||||
scl_memmgr_error( const std::string &file, const unsigned int line );
|
||||
scl_memmgr_error( const scl_memmgr_error &rhs );
|
||||
~scl_memmgr_error( void );
|
||||
|
||||
bool operator<( const scl_memmgr_error &rhs ) const;
|
||||
|
||||
std::string getsrcfile( void ) const;
|
||||
unsigned int getsrcline( void ) const;
|
||||
unsigned int getoccurences( void ) const;
|
||||
};
|
||||
|
||||
typedef std::set<scl_memmgr_error> scl_memmgr_errors;
|
||||
typedef std::set<scl_memmgr_error>::iterator scl_memmgr_error_iterator;
|
||||
|
||||
/**
|
||||
scl_memmgr_record definition
|
||||
*/
|
||||
class scl_memmgr_record {
|
||||
private:
|
||||
void * _addr;
|
||||
size_t _size;
|
||||
std::string _srcfile;
|
||||
unsigned int _srcline;
|
||||
public:
|
||||
scl_memmgr_record( void * addr, size_t size, const char *file, const unsigned int line );
|
||||
scl_memmgr_record( void * addr );
|
||||
scl_memmgr_record( const scl_memmgr_record &rhs );
|
||||
~scl_memmgr_record( void );
|
||||
|
||||
bool operator<( const scl_memmgr_record &rhs ) const;
|
||||
|
||||
void * getaddr( void ) const;
|
||||
size_t getsize( void ) const;
|
||||
std::string getsrcfile( void ) const;
|
||||
unsigned int getsrcline( void ) const;
|
||||
};
|
||||
|
||||
typedef std::set<scl_memmgr_record> scl_memmgr_records;
|
||||
typedef std::set<scl_memmgr_record>::iterator scl_memmgr_record_iterator;
|
||||
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
|
||||
/**
|
||||
scl_memmgr definition
|
||||
*/
|
||||
class scl_memmgr {
|
||||
private:
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
bool _record_insert_busy, _record_erase_busy;
|
||||
// memory allocation/reallocation records, inserted at allocation, erased at deallocation.
|
||||
scl_memmgr_records _records;
|
||||
// memory stats
|
||||
unsigned int _allocated; // amount of memory allocated simultaniously
|
||||
unsigned int _maximum_allocated; // maximum amount of memory allocated simultaniously
|
||||
unsigned int _allocated_total; // total amount of memory allocated in bytes
|
||||
unsigned int _reallocated_total; // total amount of memory reallocated in bytes
|
||||
unsigned int _deallocated_total; // total amount of memory deallocated in bytes
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
protected:
|
||||
public:
|
||||
scl_memmgr(void);
|
||||
~scl_memmgr(void);
|
||||
|
||||
void * allocate( size_t size, const char *file, const int line );
|
||||
void * reallocate( void * addr, size_t size, const char *file, const int line );
|
||||
void deallocate( void * addr, const char *file, const int line );
|
||||
};
|
||||
|
||||
/**
|
||||
scl_memmgr instance.
|
||||
There should be one static instance of memmgr.
|
||||
This instance is automatically destroyed when application exits, so this allows us to add
|
||||
memory leak detection in it's destructor.
|
||||
*/
|
||||
scl_memmgr memmgr;
|
||||
|
||||
/**
|
||||
c memory functions implementation
|
||||
*/
|
||||
extern "C" {
|
||||
|
||||
void * scl_malloc_fn( unsigned int size, const char * file, const int line ) {
|
||||
return memmgr.allocate(size, file, line);
|
||||
}
|
||||
|
||||
void * scl_calloc_fn( unsigned int count, unsigned int size, const char * file, const int line ) {
|
||||
return memmgr.allocate(count * size, file, line);
|
||||
}
|
||||
|
||||
void * scl_realloc_fn( void * addr, unsigned int size, const char * file, const int line ) {
|
||||
return memmgr.reallocate(addr, size, file, line);
|
||||
}
|
||||
|
||||
void scl_free_fn( void * addr ) {
|
||||
memmgr.deallocate(addr, "", 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
c++ memory operators implementation
|
||||
*/
|
||||
void * scl_operator_new( size_t size, const char * file, const int line ) {
|
||||
return memmgr.allocate(size, file, line);
|
||||
}
|
||||
|
||||
void scl_operator_delete( void * addr, const char * file, const int line ) {
|
||||
memmgr.deallocate(addr, file, line);
|
||||
}
|
||||
|
||||
void scl_operator_delete( void * addr ) {
|
||||
memmgr.deallocate(addr, "", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
scl_memmgr implementation
|
||||
*/
|
||||
scl_memmgr::scl_memmgr(void) {
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
_record_insert_busy = false;
|
||||
_record_erase_busy = false;
|
||||
|
||||
_allocated = 0;
|
||||
_maximum_allocated = 0;
|
||||
_allocated_total = 0;
|
||||
_reallocated_total = 0;
|
||||
_deallocated_total = 0;
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
}
|
||||
|
||||
/**
|
||||
Destructor:
|
||||
scl_memmgr::~scl_memmgr(void)
|
||||
Description:
|
||||
The scl_memmgr destructor is used to check for memory leaks when enabled.
|
||||
All records still present when scl_memmgr instance is destroyed can be considered as
|
||||
memory leaks.
|
||||
*/
|
||||
scl_memmgr::~scl_memmgr(void) {
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
scl_memmgr_record_iterator irecord;
|
||||
scl_memmgr_errors errors;
|
||||
scl_memmgr_error_iterator ierror;
|
||||
|
||||
// Check if total allocated equals total deallocated
|
||||
if (_allocated_total != _deallocated_total) {
|
||||
// todo: generate warning for possible memory leaks, enable full memory leak checking
|
||||
printf("scl_memmgr warning: Possible memory leaks detected (%d of %d bytes)\n", _allocated_total - _deallocated_total, _allocated_total);
|
||||
}
|
||||
|
||||
// Compact leaks into an error list to prevent same leak being reported multiple times.
|
||||
_record_insert_busy = true;
|
||||
_record_erase_busy = true;
|
||||
for (irecord = _records.begin();
|
||||
irecord != _records.end();
|
||||
irecord ++) {
|
||||
scl_memmgr_error error(irecord->getsrcfile(), irecord->getsrcline());
|
||||
ierror = errors.find(error);
|
||||
if (ierror == errors.end())
|
||||
errors.insert(error);
|
||||
//else
|
||||
// ierror->occurences ++;
|
||||
}
|
||||
_record_insert_busy = false;
|
||||
_record_erase_busy = false;
|
||||
|
||||
// Loop through memory leaks to generate/buffer errors
|
||||
for (ierror = errors.begin();
|
||||
ierror != errors.end();
|
||||
ierror ++) {
|
||||
// todo: generate error for memory leak
|
||||
printf("scl_memmgr warning: Possible memory leak in %s line %d\n", ierror->getsrcfile().c_str(), ierror->getsrcline());
|
||||
}
|
||||
|
||||
// Clear remaining records
|
||||
_record_erase_busy = true;
|
||||
_records.clear();
|
||||
errors.clear();
|
||||
_record_erase_busy = false;
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
}
|
||||
|
||||
void * scl_memmgr::allocate( size_t size, const char *file, const int line ) {
|
||||
void * addr;
|
||||
|
||||
// Allocate
|
||||
addr = malloc(size);
|
||||
if (addr == NULL) {
|
||||
// todo: error allocation failed
|
||||
printf("scl_memmgr error: Memory allocation failed in %s line %d\n", file, line);
|
||||
}
|
||||
|
||||
// Some stl implementations (for example debian gcc) use the new operator to construct
|
||||
// new elements when inserting scl_memmgr_record. When this our new operator gets used
|
||||
// for this operation, this would result in an infinite loop. This is fixed by the
|
||||
// _record_insert_busy flag.
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
if (!_record_insert_busy)
|
||||
{
|
||||
// Store record for this allocation
|
||||
_record_insert_busy = true;
|
||||
_records.insert(scl_memmgr_record(addr, size, file, line));
|
||||
_record_insert_busy = false;
|
||||
|
||||
// Update stats
|
||||
_allocated += size;
|
||||
if (_allocated > _maximum_allocated)
|
||||
_maximum_allocated = _allocated;
|
||||
_allocated_total += size;
|
||||
}
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
void * scl_memmgr::reallocate( void * addr, size_t size, const char *file, const int line ) {
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
scl_memmgr_record_iterator record;
|
||||
|
||||
if (!_record_insert_busy)
|
||||
{
|
||||
// Find record of previous allocation/reallocation
|
||||
record = _records.find(scl_memmgr_record(addr));
|
||||
if (record == _records.end()) {
|
||||
// todo: error reallocating memory not allocated?
|
||||
printf("scl_memmgr warning: Reallocation of not allocated memory at %s line %d\n", file, line);
|
||||
}
|
||||
else {
|
||||
// Update stats
|
||||
_allocated -= record->getsize();
|
||||
_deallocated_total += record->getsize();
|
||||
|
||||
// Erase previous allocation/reallocation
|
||||
_record_erase_busy = true;
|
||||
_records.erase(record);
|
||||
_record_erase_busy = false;
|
||||
}
|
||||
}
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
|
||||
// Reallocate
|
||||
addr = realloc(addr, size);
|
||||
if (addr == NULL) {
|
||||
// todo: error reallocation failed
|
||||
printf("scl_memmgr error: Reallocation failed at %s line %d\n", file, line);
|
||||
}
|
||||
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
if (!_record_insert_busy)
|
||||
{
|
||||
// Store record for this reallocation
|
||||
_record_insert_busy = true;
|
||||
_records.insert(scl_memmgr_record(addr, size, file, line));
|
||||
_record_insert_busy = false;
|
||||
|
||||
// Update stats
|
||||
_allocated += size;
|
||||
if (_allocated > _maximum_allocated)
|
||||
_maximum_allocated = _allocated;
|
||||
_allocated_total += size;
|
||||
_reallocated_total += size;
|
||||
}
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
void scl_memmgr::deallocate( void * addr, const char *file, const int line ) {
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
scl_memmgr_record_iterator record;
|
||||
|
||||
if (!_record_erase_busy)
|
||||
{
|
||||
// Find record of previous allocation/reallocation
|
||||
record = _records.find(scl_memmgr_record(addr));
|
||||
if (record == _records.end()) {
|
||||
// todo: error free called for not allocated memory?
|
||||
printf("scl_memmgr warning: Deallocate of not allocated memory at %s line %d\n", file, line);
|
||||
}
|
||||
else {
|
||||
// Update stats
|
||||
_allocated -= record->getsize();
|
||||
_deallocated_total += record->getsize();
|
||||
|
||||
// Erase record
|
||||
_record_erase_busy = true;
|
||||
_records.erase(record);
|
||||
_record_erase_busy = false;
|
||||
}
|
||||
}
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
|
||||
// Deallocate
|
||||
free(addr);
|
||||
}
|
||||
|
||||
#ifdef SCL_MEMMGR_ENABLE_CHECKS
|
||||
/**
|
||||
scl_memmgr_error implementation
|
||||
*/
|
||||
scl_memmgr_error::scl_memmgr_error( const std::string &file, const unsigned int line ) {
|
||||
_srcfile = file;
|
||||
_srcline = line;
|
||||
_occurences = 1;
|
||||
}
|
||||
|
||||
scl_memmgr_error::scl_memmgr_error( const scl_memmgr_error &rhs ) {
|
||||
_srcfile = rhs._srcfile;
|
||||
_srcline = rhs._srcline;
|
||||
_occurences = rhs._occurences;
|
||||
}
|
||||
|
||||
scl_memmgr_error::~scl_memmgr_error( void ) {
|
||||
}
|
||||
|
||||
bool scl_memmgr_error::operator<( const scl_memmgr_error &rhs ) const {
|
||||
if (_srcfile == rhs._srcfile)
|
||||
return _srcline < rhs._srcline;
|
||||
return _srcfile < rhs._srcfile;
|
||||
}
|
||||
|
||||
std::string scl_memmgr_error::getsrcfile( void ) const {
|
||||
return _srcfile;
|
||||
}
|
||||
|
||||
unsigned int scl_memmgr_error::getsrcline( void ) const {
|
||||
return _srcline;
|
||||
}
|
||||
|
||||
unsigned int scl_memmgr_error::getoccurences( void ) const {
|
||||
return _occurences;
|
||||
}
|
||||
|
||||
/**
|
||||
scl_memmgr_record implementation
|
||||
*/
|
||||
scl_memmgr_record::scl_memmgr_record( void * addr, size_t size, const char *file, const unsigned int line ) {
|
||||
_addr = addr;
|
||||
_size = size;
|
||||
_srcfile = file;
|
||||
_srcline = line;
|
||||
}
|
||||
|
||||
scl_memmgr_record::scl_memmgr_record( void * addr ) {
|
||||
_addr = addr;
|
||||
_size = 0;
|
||||
_srcfile = "";
|
||||
_srcline = -1;
|
||||
}
|
||||
|
||||
scl_memmgr_record::scl_memmgr_record( const scl_memmgr_record &rhs ) {
|
||||
_addr = rhs._addr;
|
||||
_size = rhs._size;
|
||||
_srcfile = rhs._srcfile;
|
||||
_srcline = rhs._srcline;
|
||||
}
|
||||
|
||||
scl_memmgr_record::~scl_memmgr_record( void ) {
|
||||
}
|
||||
|
||||
bool scl_memmgr_record::operator<( const scl_memmgr_record &rhs ) const {
|
||||
return _addr < rhs._addr;
|
||||
}
|
||||
|
||||
void * scl_memmgr_record::getaddr( void ) const {
|
||||
return _addr;
|
||||
}
|
||||
|
||||
size_t scl_memmgr_record::getsize( void ) const {
|
||||
return _size;
|
||||
}
|
||||
|
||||
std::string scl_memmgr_record::getsrcfile( void ) const {
|
||||
return _srcfile;
|
||||
}
|
||||
|
||||
unsigned int scl_memmgr_record::getsrcline( void ) const {
|
||||
return _srcline;
|
||||
}
|
||||
|
||||
#endif /* SCL_MEMMGR_ENABLE_CHECKS */
|
||||
@@ -1,80 +0,0 @@
|
||||
#ifndef SCL_MEMMGR_H
|
||||
#define SCL_MEMMGR_H
|
||||
|
||||
#include <scl_export.h>
|
||||
|
||||
/**
|
||||
Platform specific defines
|
||||
*/
|
||||
#if defined(__MSVC__) || defined(__BORLAND__)
|
||||
#define THROW_STD_BAD_ALLOC
|
||||
#define THROW_EMPTY
|
||||
#else
|
||||
#define THROW_STD_BAD_ALLOC throw (std::bad_alloc)
|
||||
#define THROW_EMPTY throw ()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <cstddef>
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
SCL_BASE_EXPORT void * scl_malloc_fn( unsigned int size, const char *file, const int line );
|
||||
SCL_BASE_EXPORT void * scl_calloc_fn( unsigned int count, unsigned int size, const char *file, const int line );
|
||||
SCL_BASE_EXPORT void * scl_realloc_fn( void * addr, unsigned int size, const char *file, const int line );
|
||||
SCL_BASE_EXPORT void scl_free_fn( void * addr );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
SCL_BASE_EXPORT void * scl_operator_new( size_t size, const char * file, const int line );
|
||||
SCL_BASE_EXPORT void scl_operator_delete( void * addr, const char *file, const int line );
|
||||
SCL_BASE_EXPORT void scl_operator_delete( void * addr );
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef SCL_MEMMGR_CC
|
||||
|
||||
#define scl_malloc(size) scl_malloc_fn(size, __FILE__, __LINE__)
|
||||
#define scl_calloc(count, size) scl_calloc_fn(count, size, __FILE__, __LINE__)
|
||||
#define scl_realloc(addr, size) scl_realloc_fn(addr, size, __FILE__, __LINE__)
|
||||
#define scl_free(addr) scl_free_fn(addr)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <new>
|
||||
|
||||
inline void * operator new( size_t size, const char *file, const int line ) THROW_STD_BAD_ALLOC {
|
||||
return scl_operator_new(size, file, line);
|
||||
}
|
||||
|
||||
inline void * operator new[]( size_t size, const char *file, const int line ) THROW_STD_BAD_ALLOC {
|
||||
return scl_operator_new(size, file, line);
|
||||
}
|
||||
|
||||
inline void operator delete( void *addr, const char *file, const int line ) THROW_STD_BAD_ALLOC {
|
||||
scl_operator_delete(addr, file, line);
|
||||
}
|
||||
|
||||
inline void operator delete[]( void *addr, const char *file, const int line ) THROW_STD_BAD_ALLOC {
|
||||
scl_operator_delete(addr, file, line);
|
||||
}
|
||||
|
||||
inline void operator delete( void * addr ) THROW_EMPTY {
|
||||
scl_operator_delete(addr);
|
||||
}
|
||||
|
||||
inline void operator delete[]( void * addr ) THROW_EMPTY {
|
||||
scl_operator_delete(addr);
|
||||
}
|
||||
|
||||
#define new new(__FILE__, __LINE__)
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* SCL_MEMMGR_CC */
|
||||
|
||||
#endif /* SCL_MEMMGR_H */
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "scl_trace_fprintf.h"
|
||||
|
||||
void trace_fprintf (char const *sourcefile, int line, FILE* file, const char *format, ...) {
|
||||
va_list args;
|
||||
if( (file != stdout) && (file != stderr ) ) {
|
||||
fprintf(file, "/* source: %s:%d */", sourcefile, line);
|
||||
}
|
||||
va_start (args, format);
|
||||
vfprintf(file, format, args);
|
||||
va_end (args);
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#ifndef SCL_TRACE_FPRINTF_H
|
||||
#define SCL_TRACE_FPRINTF_H
|
||||
|
||||
/** \file scl_trace_fprintf.h
|
||||
* Used to track the source file and line where generated code is printed from
|
||||
* When enabled, comments are printed into the generated files for every 'fprintf':
|
||||
* / * source: scl/src/fedex_plus/selects.c:1375 * /
|
||||
* To enable, configure with 'cmake .. -DSCL_TRACE_FPRINTF=ON'
|
||||
*
|
||||
* This header must be included *after* all other headers, otherwise the compiler will
|
||||
* report errors in system headers.
|
||||
* \sa trace_fprintf
|
||||
**/
|
||||
|
||||
#include "scl_export.h"
|
||||
|
||||
/** used to find where generated c++ originates from in fedex_plus
|
||||
* To enable, configure with 'cmake .. -DSCL_TRACE_FPRINTF=ON'
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
SCL_BASE_EXPORT void trace_fprintf (char const *sourcefile, int line, FILE* file, const char *format, ...);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SCL_TRACE_FPRINTF
|
||||
# define fprintf(...) trace_fprintf(__FILE__, __LINE__, __VA_ARGS__)
|
||||
#endif /* SCL_TRACE_FPRINTF */
|
||||
|
||||
#endif /* SCL_TRACE_FPRINTF_H */
|
||||
@@ -8,9 +8,9 @@ set(LIBSTEPDAI_SRCS
|
||||
sdaiEntity_extent_set.cc
|
||||
sdaiModel_contents.cc
|
||||
sdaiModel_contents_list.cc
|
||||
sdaiEnum.cc
|
||||
sdaiString.cc
|
||||
sdaiBinary.cc
|
||||
sdaiEnum.cc
|
||||
sdaiString.cc
|
||||
sdaiBinary.cc
|
||||
)
|
||||
|
||||
SET(LIBSTEPDAI_PRIVATE_HDRS
|
||||
@@ -23,16 +23,24 @@ SET(LIBSTEPDAI_PRIVATE_HDRS
|
||||
sdaiObject.h
|
||||
sdaiSession_instance.h
|
||||
StrUtil.hh
|
||||
sdaiEnum.h
|
||||
sdaiString.h
|
||||
sdaiBinary.h
|
||||
sdaiEnum.h
|
||||
sdaiString.h
|
||||
sdaiBinary.h
|
||||
)
|
||||
|
||||
IF(MSVC OR BORLAND)
|
||||
add_definitions( -DSCL_DAI_DLL_EXPORTS )
|
||||
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
|
||||
ENDIF()
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${SCL_SOURCE_DIR}/src/base
|
||||
${SCL_SOURCE_DIR}/src/clstepcore
|
||||
${SCL_SOURCE_DIR}/src/clutils
|
||||
)
|
||||
|
||||
SCL_ADDLIB(stepdai "${LIBSTEPDAI_SRCS}" "steputils base")
|
||||
SCL_ADDLIB(stepdai "${LIBSTEPDAI_SRCS}" "steputils")
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(stepdai PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
|
||||
endif(APPLE)
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include <memory.h>
|
||||
#include <math.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
// to help ObjectCenter
|
||||
#ifndef HAVE_MEMMOVE
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include <sstream>
|
||||
#include <sdai.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
SDAI_Binary::SDAI_Binary( const char * str, int max ) {
|
||||
content = std::string( str, max );
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include <math.h>
|
||||
|
||||
#include <sdai.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
// to help ObjectCenter
|
||||
#ifndef HAVE_MEMMOVE
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
//#include <EntityExtent.h>
|
||||
|
||||
#include <sdai.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
SDAI_Entity_extent::SDAI_Entity_extent( )
|
||||
: _definition( 0 ), _definition_name( 0 ), _owned_by( 0 ) {
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <math.h>
|
||||
|
||||
#include <sdai.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
/*
|
||||
#include <EntityExtent.h>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
#include <sdai.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
/*
|
||||
* NIST STEP Core Class Library
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
#include <sdai.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
///////// SDAI_Model_contents_instances
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
* UArray implementation.
|
||||
*/
|
||||
#include <sdai.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
// to help ObjectCenter
|
||||
#ifndef HAVE_MEMMOVE
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include <sdai.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
SDAI_sdaiObject::SDAI_sdaiObject() {
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include <sdai.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
SDAI_Session_instance::SDAI_Session_instance() {
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include <sdai.h>
|
||||
#include <sstream>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
SDAI_String::SDAI_String( const char * str, int max ) {
|
||||
content = std::string( str, max );
|
||||
|
||||
@@ -35,10 +35,20 @@ SET(LIBSTEPEDITOR_PRIVATE_HDRS
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${SCL_SOURCE_DIR}/src/base
|
||||
${SCL_SOURCE_DIR}/src/cldai
|
||||
${SCL_SOURCE_DIR}/src/clstepcore
|
||||
${SCL_SOURCE_DIR}/src/clutils
|
||||
)
|
||||
|
||||
SCL_ADDLIB(stepeditor "${LIBSTEPEDITOR_SRCS}" "stepcore stepdai steputils base")
|
||||
if(MSVC OR BORLAND)
|
||||
add_definitions( -DSCL_EDITOR_DLL_EXPORTS )
|
||||
add_definitions( -DSCL_CORE_DLL_IMPORTS )
|
||||
add_definitions( -DSCL_DAI_DLL_IMPORTS )
|
||||
add_definitions( -DSCL_UTILS_DLL_IMPORTS )
|
||||
endif()
|
||||
|
||||
SCL_ADDLIB(stepeditor "${LIBSTEPEDITOR_SRCS}" stepcore stepdai steputils)
|
||||
|
||||
if(APPLE)
|
||||
set_target_properties(stepeditor PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
|
||||
endif(APPLE)
|
||||
|
||||
+740
-160
File diff suppressed because it is too large
Load Diff
+19
-25
@@ -49,35 +49,29 @@ class SCL_EDITOR_EXPORT STEPfile {
|
||||
Registry & reg() {
|
||||
return _reg;
|
||||
}
|
||||
int _fileIdIncr; ///< Increment value to be added to FileId Numbers on input
|
||||
int _fileIdIncr; //Increment value to be added to FileId Numbers on input
|
||||
|
||||
//header information
|
||||
InstMgr * _headerInstances;
|
||||
Registry * _headerRegistry;
|
||||
|
||||
int _headerId; ///< STEPfile_id given to SDAI_Application_instance from header section
|
||||
int _headerId; //STEPfile_id given to SDAI_Application_instance from header section
|
||||
|
||||
//file information
|
||||
DirObj * _currentDir;
|
||||
std::string _fileName;
|
||||
|
||||
//the following are used to compute read/write progress
|
||||
std::ifstream::pos_type _iFileSize; ///< input file size
|
||||
std::ifstream::pos_type _iFileCurrentPosition; ///< input file position (from ifstream::tellg())
|
||||
bool _iFileStage1Done; ///< set immediately before ReadData1() returns
|
||||
int _oFileInstsWritten; ///< number of instances that have been written
|
||||
|
||||
//error information
|
||||
ErrorDescriptor _error;
|
||||
|
||||
// new errors
|
||||
int _entsNotCreated; ///< num entities not created in first pass
|
||||
int _entsInvalid; ///< num entities that had invalid attr values
|
||||
int _entsIncomplete; /**< num entities that had missing attr values
|
||||
(includes entities that had invalid values
|
||||
for required attrs)*/
|
||||
int _entsWarning; /**< num entities that may have had problems
|
||||
with attrs - reported as an attr user msg */
|
||||
int _entsNotCreated; // num entities not created in first pass
|
||||
int _entsInvalid; // num entities that had invalid attr values
|
||||
int _entsIncomplete; // num entities that had missing attr values
|
||||
// (includes entities that had invalid values
|
||||
// for required attrs)
|
||||
int _entsWarning; // num entities that may have had problems
|
||||
// with attrs - reported as an attr user msg
|
||||
|
||||
// old errors
|
||||
int _errorCount;
|
||||
@@ -117,8 +111,6 @@ class SCL_EDITOR_EXPORT STEPfile {
|
||||
}
|
||||
const std::string SetFileName( const std::string name = "" );
|
||||
const std::string TruncFileName( const std::string name ) const;
|
||||
float GetReadProgress() const;
|
||||
float GetWriteProgress() const;
|
||||
|
||||
//error information
|
||||
ErrorDescriptor & Error() { /* const */
|
||||
@@ -173,8 +165,8 @@ class SCL_EDITOR_EXPORT STEPfile {
|
||||
|
||||
protected:
|
||||
//member functions
|
||||
const std::string schemaName(); /**< Returns and copies out schema name from header instances.
|
||||
Called by ReadExchangeFile */
|
||||
const std::string schemaName(); // returns and copies out schema name from header instances
|
||||
//called by ReadExchangeFile
|
||||
istream * OpenInputFile( const std::string filename = "" );
|
||||
void CloseInputFile( istream * in );
|
||||
|
||||
@@ -186,8 +178,9 @@ class SCL_EDITOR_EXPORT STEPfile {
|
||||
int HeaderId( int increment = 1 );
|
||||
int HeaderId( const std::string name );
|
||||
|
||||
int ReadData1( istream & in ); /**< First pass, to create instances */
|
||||
int ReadData2( istream & in, bool useTechCor = true ); /**< Second pass, to read instances */
|
||||
int ReadData1( istream & in ); // first pass to create instances
|
||||
// second pass to read instances
|
||||
int ReadData2( istream & in, bool useTechCor = true );
|
||||
|
||||
// obsolete
|
||||
int ReadWorkingData1( istream & in );
|
||||
@@ -195,17 +188,18 @@ class SCL_EDITOR_EXPORT STEPfile {
|
||||
|
||||
void ReadRestOfFile( istream & in );
|
||||
|
||||
/// create instance - used by ReadData1()
|
||||
// create instance - used by ReadData1()
|
||||
SDAI_Application_instance * CreateInstance( istream & in, ostream & out );
|
||||
/// create complex instance - used by CreateInstance()
|
||||
// create complex instance - used by CreateInstance()
|
||||
SDAI_Application_instance * CreateSubSuperInstance( istream & in, int fileid,
|
||||
ErrorDescriptor & );
|
||||
|
||||
/// read the instance - used by ReadData2()
|
||||
// read the instance - used by ReadData2()
|
||||
SDAI_Application_instance * ReadInstance( istream & in, ostream & out,
|
||||
std::string & cmtStr, bool useTechCor = true );
|
||||
|
||||
/// reading scopes are still incomplete, CreateScopeInstances and ReadScopeInstances are stubs
|
||||
// reading scopes are still incomplete
|
||||
// these functions are stubs
|
||||
Severity CreateScopeInstances( istream & in, SDAI_Application_instance_ptr ** scopelist );
|
||||
Severity ReadScopeInstances( istream & in );
|
||||
// Severity ReadSubSuperInstance(istream& in);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <cmath>
|
||||
|
||||
#include <cstring>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
extern void HeaderSchemaInit( Registry & reg );
|
||||
|
||||
@@ -29,9 +28,7 @@ STEPfile::STEPfile( Registry & r, InstMgr & i, const std::string filename, bool
|
||||
_instances( i ), _reg( r ), _fileIdIncr( 0 ), _headerId( 0 ),
|
||||
_entsNotCreated( 0 ), _entsInvalid( 0 ), _entsIncomplete( 0 ),
|
||||
_entsWarning( 0 ), _errorCount( 0 ), _warningCount( 0 ),
|
||||
_maxErrorCount( 5000 ), _strict( strict ),_iFileSize( 0 ),
|
||||
_iFileCurrentPosition( 0 ), _oFileInstsWritten( 0 ),
|
||||
_iFileStage1Done( false ) {
|
||||
_maxErrorCount( 5000 ), _strict( strict ) {
|
||||
SetFileType( VERSION_CURRENT );
|
||||
SetFileIdIncrement();
|
||||
_currentDir = new DirObj( "" );
|
||||
@@ -45,6 +42,8 @@ STEPfile::STEPfile( Registry & r, InstMgr & i, const std::string filename, bool
|
||||
STEPfile::~STEPfile() {
|
||||
delete _currentDir;
|
||||
|
||||
// remove everything from the Registry before deleting it
|
||||
_headerRegistry->DeleteContents();
|
||||
delete _headerRegistry;
|
||||
|
||||
_headerInstances->DeleteInstances();
|
||||
@@ -174,8 +173,6 @@ Severity STEPfile::AppendWorkingFile( const std::string filename, bool useTechCo
|
||||
|
||||
/******************************************************/
|
||||
istream * STEPfile::OpenInputFile( const std::string filename ) {
|
||||
_iFileCurrentPosition = 0;
|
||||
|
||||
// if there's no filename to use, fail
|
||||
if( filename.empty() && FileName().empty() ) {
|
||||
_error.AppendToUserMsg( "Unable to open file for input. No current file name.\n" );
|
||||
@@ -207,10 +204,6 @@ istream * STEPfile::OpenInputFile( const std::string filename ) {
|
||||
return ( 0 );
|
||||
}
|
||||
|
||||
//check size of file
|
||||
in->seekg( 0, std::ifstream::end );
|
||||
_iFileSize = in->tellg();
|
||||
in->seekg( 0, std::ifstream::beg );
|
||||
return in;
|
||||
}
|
||||
|
||||
@@ -219,10 +212,6 @@ void STEPfile::CloseInputFile( istream * in ) {
|
||||
if( in && *in != std::cin ) {
|
||||
delete in;
|
||||
}
|
||||
|
||||
//reset file size
|
||||
_iFileSize = 0;
|
||||
_iFileCurrentPosition = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -250,12 +239,10 @@ ofstream * STEPfile::OpenOutputFile( const std::string filename ) {
|
||||
_error.AppendToUserMsg( "unable to open file for output\n" );
|
||||
_error.GreaterSeverity( SEVERITY_INPUT_ERROR );
|
||||
}
|
||||
_oFileInstsWritten = 0;
|
||||
return out;
|
||||
}
|
||||
|
||||
void STEPfile::CloseOutputFile( ostream * out ) {
|
||||
_oFileInstsWritten = 0;
|
||||
delete out;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ extern ofstream * logStream;
|
||||
#include <ExpDict.h>
|
||||
#include <STEPattribute.h>
|
||||
#include <SdaiHeaderSchema.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
Schema * s_header_section_schema = 0;
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
// regenerate it.
|
||||
|
||||
#include <SdaiHeaderSchema.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
void HeaderInitSchemasAndEnts( Registry & reg ) {
|
||||
Uniqueness_rule_ptr ur;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <ExpDict.h>
|
||||
#include <STEPattribute.h>
|
||||
#include <SdaiHeaderSchema.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
void SdaiHEADER_SECTION_SCHEMAInit( Registry & reg ) {
|
||||
header_section_schemat_time_stamp_text->ReferentType( t_sdaiSTRING );
|
||||
@@ -53,13 +52,12 @@ void SdaiHEADER_SECTION_SCHEMAInit( Registry & reg ) {
|
||||
header_section_schemae_file_population->AddExplicitAttr( a_3determination_method );
|
||||
SetTypeDescriptor * t_0 = new SetTypeDescriptor;
|
||||
t_0->AssignAggrCreator( ( AggregateCreator ) create_StringAggregate ); // Creator function
|
||||
t_0->SetBound1( 1 );
|
||||
t_0->SetBound2( 2147483647 );
|
||||
t_0->Bound1( 1 );
|
||||
t_0->Bound2( 2147483647 );
|
||||
t_0->FundamentalType( SET_TYPE );
|
||||
t_0->Description( "SET [1:?] OF section_name" );
|
||||
t_0->OriginatingSchema( s_header_section_schema );
|
||||
t_0->ReferentType( header_section_schemat_section_name );
|
||||
s_header_section_schema->AddUnnamedType(t_0);
|
||||
a_4governed_sections =
|
||||
new AttrDescriptor( "governed_sections", t_0, LTrue, LFalse, AttrType_Explicit,
|
||||
*header_section_schemae_file_population );
|
||||
@@ -81,26 +79,24 @@ void SdaiHEADER_SECTION_SCHEMAInit( Registry & reg ) {
|
||||
header_section_schemae_file_name->AddExplicitAttr( a_6time_stamp );
|
||||
ListTypeDescriptor * t_1 = new ListTypeDescriptor;
|
||||
t_1->AssignAggrCreator( ( AggregateCreator ) create_StringAggregate ); // Creator function
|
||||
t_1->SetBound1( 1 );
|
||||
t_1->SetBound2( 2147483647 );
|
||||
t_1->Bound1( 1 );
|
||||
t_1->Bound2( 2147483647 );
|
||||
t_1->FundamentalType( LIST_TYPE );
|
||||
t_1->Description( "LIST [1:?] OF STRING (256)" );
|
||||
t_1->OriginatingSchema( s_header_section_schema );
|
||||
t_1->ReferentType( t_sdaiSTRING );
|
||||
s_header_section_schema->AddUnnamedType(t_1);
|
||||
a_7author =
|
||||
new AttrDescriptor( "author", t_1, LFalse, LFalse, AttrType_Explicit,
|
||||
*header_section_schemae_file_name );
|
||||
header_section_schemae_file_name->AddExplicitAttr( a_7author );
|
||||
ListTypeDescriptor * t_2 = new ListTypeDescriptor;
|
||||
t_2->AssignAggrCreator( ( AggregateCreator ) create_StringAggregate ); // Creator function
|
||||
t_2->SetBound1( 1 );
|
||||
t_2->SetBound2( 2147483647 );
|
||||
t_2->Bound1( 1 );
|
||||
t_2->Bound2( 2147483647 );
|
||||
t_2->FundamentalType( LIST_TYPE );
|
||||
t_2->Description( "LIST [1:?] OF STRING (256)" );
|
||||
t_2->OriginatingSchema( s_header_section_schema );
|
||||
t_2->ReferentType( t_sdaiSTRING );
|
||||
s_header_section_schema->AddUnnamedType(t_2);
|
||||
a_8organization =
|
||||
new AttrDescriptor( "organization", t_2, LFalse, LFalse, AttrType_Explicit,
|
||||
*header_section_schemae_file_name );
|
||||
@@ -132,13 +128,12 @@ void SdaiHEADER_SECTION_SCHEMAInit( Registry & reg ) {
|
||||
header_section_schemae_section_context->AddExplicitAttr( a_12section );
|
||||
ListTypeDescriptor * t_3 = new ListTypeDescriptor;
|
||||
t_3->AssignAggrCreator( ( AggregateCreator ) create_StringAggregate ); // Creator function
|
||||
t_3->SetBound1( 1 );
|
||||
t_3->SetBound2( 2147483647 );
|
||||
t_3->Bound1( 1 );
|
||||
t_3->Bound2( 2147483647 );
|
||||
t_3->FundamentalType( LIST_TYPE );
|
||||
t_3->Description( "LIST [1:?] OF context_name" );
|
||||
t_3->OriginatingSchema( s_header_section_schema );
|
||||
t_3->ReferentType( header_section_schemat_context_name );
|
||||
s_header_section_schema->AddUnnamedType(t_3);
|
||||
a_13context_identifiers =
|
||||
new AttrDescriptor( "context_identifiers", t_3, LFalse, LFalse, AttrType_Explicit,
|
||||
*header_section_schemae_section_context );
|
||||
@@ -150,13 +145,12 @@ void SdaiHEADER_SECTION_SCHEMAInit( Registry & reg ) {
|
||||
|
||||
ListTypeDescriptor * t_4 = new ListTypeDescriptor;
|
||||
t_4->AssignAggrCreator( ( AggregateCreator ) create_StringAggregate ); // Creator function
|
||||
t_4->SetBound1( 1 );
|
||||
t_4->SetBound2( 2147483647 );
|
||||
t_4->Bound1( 1 );
|
||||
t_4->Bound2( 2147483647 );
|
||||
t_4->FundamentalType( LIST_TYPE );
|
||||
t_4->Description( "LIST [1:?] OF STRING (256)" );
|
||||
t_4->OriginatingSchema( s_header_section_schema );
|
||||
t_4->ReferentType( t_sdaiSTRING );
|
||||
s_header_section_schema->AddUnnamedType(t_4);
|
||||
a_14description =
|
||||
new AttrDescriptor( "description", t_4, LFalse, LFalse, AttrType_Explicit,
|
||||
*header_section_schemae_file_description );
|
||||
@@ -173,14 +167,13 @@ void SdaiHEADER_SECTION_SCHEMAInit( Registry & reg ) {
|
||||
|
||||
ListTypeDescriptor * t_5 = new ListTypeDescriptor;
|
||||
t_5->AssignAggrCreator( ( AggregateCreator ) create_StringAggregate ); // Creator function
|
||||
t_5->SetBound1( 1 );
|
||||
t_5->SetBound2( 2147483647 );
|
||||
t_5->Bound1( 1 );
|
||||
t_5->Bound2( 2147483647 );
|
||||
t_5->UniqueElements( LTrue );
|
||||
t_5->FundamentalType( LIST_TYPE );
|
||||
t_5->Description( "LIST [1:?] OF UNIQUE schema_name" );
|
||||
t_5->OriginatingSchema( s_header_section_schema );
|
||||
t_5->ReferentType( header_section_schemat_schema_name );
|
||||
s_header_section_schema->AddUnnamedType(t_5);
|
||||
a_16schema_identifiers =
|
||||
new AttrDescriptor( "schema_identifiers", t_5, LFalse, LFalse, AttrType_Explicit,
|
||||
*header_section_schemae_file_schema );
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
// regenerate it.
|
||||
|
||||
#include <SdaiSchemaInit.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
void HeaderSchemaInit( Registry & reg ) {
|
||||
HeaderInitSchemasAndEnts( reg );
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
|
||||
#include <cmdmgr.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
|
||||
ReplicateLinkNode * ReplicateList::FindNode( MgrNode * mn ) {
|
||||
ReplicateLinkNode * rln = ( ReplicateLinkNode * )GetHead();
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <dispnode.h>
|
||||
#include <dispnodelist.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
// define this to be the name of the display object
|
||||
class StepEntityEditor;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <mgrnodelist.h>
|
||||
#include <dispnode.h>
|
||||
#include <dispnodelist.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
|
||||
void DisplayNodeList::Remove( GenericNode * node ) {
|
||||
GenNodeList::Remove( node );
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <sdai.h>
|
||||
#include <instmgr.h>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// debug_level >= 2 => tells when a command is chosen
|
||||
|
||||
@@ -53,11 +53,11 @@ class SCL_EDITOR_EXPORT InstMgr {
|
||||
virtual ~InstMgr();
|
||||
|
||||
// MASTER LIST OPERATIONS
|
||||
int InstanceCount() const {
|
||||
int InstanceCount() {
|
||||
return master->Count();
|
||||
}
|
||||
|
||||
int OwnsInstances() const {
|
||||
int OwnsInstances() {
|
||||
return _ownsInstances;
|
||||
}
|
||||
void OwnsInstances( int ownsInstances ) {
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <sdai.h>
|
||||
|
||||
#include <iostream>
|
||||
#include "scl_memmgr.h"
|
||||
|
||||
void * MgrNode::SEE() {
|
||||
return ( di ? di->SEE() : 0 );
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user