Compare commits

..
269 Commits
Author SHA1 Message Date
Clifford Yapp 5cf8fc1a89 Merge branch 'develop'
v0.8.2
2023-09-17 12:07:49 -04:00
Clifford Yapp c0d3fac5f7 Merge pull request #452 from starseeker/headers
Relocate headers to include, add explicit directory prefixes
2023-09-03 23:32:12 -04:00
Clifford Yapp 56da4ab614 Update ap203min example for new header setup. 2023-09-02 20:26:58 -04:00
Clifford Yapp 111d7e94b0 Merge pull request #456 from starseeker/develop
Fixes for newer clang compilers and more robust parallel building
2023-09-02 20:15:42 -04:00
Clifford Yapp db2c3d8e5b Minor updates for newer compilers
The Wstrict-prototypes flag didn't like some of the stepcode function
definitions.

Also add a couple includes and defines for isascii.
2023-08-23 14:57:10 -04:00
Clifford Yapp 592823b64b List the generated .h file explicitly as an output
Occasional compile problems with libexpress appear to be an attempt to
compile with an incompletely generated header.  Make the dependency
explicit to assist CMake in generating proper build ordering rules.
2023-08-23 14:54:33 -04:00
Clifford Yapp ed8390a0b4 Merge pull request #453 from starseeker/develop
Make expparse explicitly depend on scanner header
2022-10-19 18:13:14 -04:00
Clifford Yapp 6fd22a1e0a Make expparse explicitly depend on scanner header
Without this dependency, we get intermittent failures where parallel
builds attempt the expparse.c compile before the necessary header is in
place.
2022-10-17 10:02:16 -04:00
Clifford Yapp f35d25d93d Missed a header conversion 2022-10-03 21:41:17 -04:00
Clifford Yapp d824fc0c4e Keep longer directory names
We want to be consistent with the previous layout, to avoid needlessly
breaking existing codes.  The header update means client codes are not
required to include all of the stepcode library includes explicitly -
i.e., stepcode itself does not force this requirement with its own
internal includes.  However, if client codes do not want to add the
library prefixes to their own includes as we have for stepcode, they
should still be able to add the various includes and work as before.
Adjust the include directory names accordingly.
2022-10-02 17:57:57 -04:00
Clifford Yapp 1bd7ad942b Remove includes of other lib src directories 2022-10-02 17:57:57 -04:00
Clifford Yapp bc96f29d6b Move utils headers 2022-10-02 17:57:57 -04:00
Clifford Yapp 820ca86159 Move the cllazyfile headers, trim down judy arrays
I'm not sure if this logic was ever brought to a production level -
needs investigateion...  maybe we should just arcive it if there isn't
any active development?  Regardless, there appears to be no upstream
activity on the judy code, so just make it a part of cllazy directly.
2022-10-02 17:57:57 -04:00
Clifford Yapp f9f5c71204 Move editor headers 2022-10-02 17:57:57 -04:00
Clifford Yapp 84d939baa7 Missed sdaiString.h 2022-10-02 17:57:57 -04:00
Clifford Yapp 04a5404e60 Move cldai headers 2022-10-02 17:57:57 -04:00
Clifford Yapp c85720fbb4 Stub in CMake logic for other header dirs 2022-10-02 17:57:57 -04:00
Clifford Yapp ac19698fde Move remaining stepcore headers 2022-10-02 17:57:57 -04:00
Clifford Yapp b36b78ffce Need to process a few more directories 2022-10-02 17:57:57 -04:00
Clifford Yapp 77a43bc3f2 Move all non STEP* headers in stepcore 2022-10-02 17:57:57 -04:00
Clifford Yapp fc4edb9b06 Move stepcore headers through r* 2022-10-02 17:57:57 -04:00
Clifford Yapp 6e53c8f833 Relocate i* stepcore headers 2022-10-02 17:57:56 -04:00
Clifford Yapp 9d1583be63 Move the e* clstepcore headers 2022-10-02 17:57:56 -04:00
Clifford Yapp 94c978359d Move d* headers in clstepcore 2022-10-02 17:57:56 -04:00
Clifford Yapp 8a7e0af3b5 See if we can script some of the move process 2022-10-02 17:57:56 -04:00
Clifford Yapp 840d57c2f1 Move a few more headers 2022-10-02 17:57:56 -04:00
Clifford Yapp 33102ee9e3 First steps of resituating stepcode headers
Goal is for client codes to be able to simply include the stepcode
direcotry and have everything work, rather than having to worry about
individual step libraries.  Will also make it clear with the dir
prefixes when libraries are using .h files from other libraries, rather
than their own.
2022-10-02 17:57:56 -04:00
Chris HORLER 131fe6e7b4 Merge branch 'develop'
v0.8.1
2022-10-02 20:54:53 +01:00
Chris HORLER 627c0935a8 Merge branch 'master' into develop
v0.8.1 prep
2022-10-02 20:42:36 +01:00
Chris HORLER c2842f884a exp2py: bump package version number and replace SCL references in README and setup.cfg 2022-10-02 16:49:06 +01:00
Chris HORLER 80b4588f6a exp2py: tests SCL -> stepcode 2022-10-02 16:49:06 +01:00
Chris HORLER e05bfc7bd4 exp2py: change file header StepClassLibrary (SCL) to STEPCODE project 2022-10-02 16:49:06 +01:00
Chris HORLER f83e0abc74 exp2py: change SCL package to stepcode package 2022-10-02 16:49:06 +01:00
luz paz 0978cfcd00 Fix typos in src/clstepcore subdir 2022-10-01 17:08:39 +01:00
bitbybit3d 28783de62b fix target_compile_definitions misspelling 2022-09-26 23:05:39 +01:00
Clifford Yapp 7dbda20be0 Remove base library from stepcode
Move specific pieces of logic still in use next to the individual parts
of the code that use them, and eliminate base from the code.
2022-09-26 20:52:17 +01:00
Clifford Yapp fdf271c888 Merge pull request #448 from stepcode/update_dev_guidelines
update contributing guidelines to allow more flexibility when accepti…
2022-09-25 15:21:15 -04:00
John Smith 8e9a68968c Changed Python SCL setup.cfg name to "stepcode-scl" so the package can be deployed to pypi.
The current package name, SCL, is too similar to existing pypi package names that the repository will not allow it to be committed. This change does not affect internal package name, which remains "SCL", just the name used to fetch the package from the pypi repository.

After this change is committed and posted to pypi, users will be able to fetch the package with `pip install stepcode-scl`.
2022-09-25 16:43:00 +01:00
Chris HORLER 520e7a3789 update contributing guidelines to allow more flexibility when accepting PRs 2022-09-25 16:24:30 +01:00
Clifford Yapp 4bab26918d strcpy -> strncpy 2022-06-11 20:14:25 +01:00
Clifford Yapp efd353858e Use strncpy to transfer nm to name 2022-06-11 20:14:25 +01:00
Clifford Yapp 9b15e1c697 Make a variety of adjustments to string printing, free temporary copy of EXPRto_String output. 2022-06-11 20:14:25 +01:00
Clifford Yapp 64873b4dd7 Use strncat to copy name to buf 2022-06-11 20:14:25 +01:00
Clifford Yapp 28c5d26429 As with BUFSIZ, make sure MAX_LEN buffers have room to null terminate. 2022-06-11 20:14:25 +01:00
Clifford Yapp 43231cdbc9 Set default types, note a bad problem with how sc_hash is set up. 2022-06-11 20:14:25 +01:00
Clifford Yapp 7209a3e75d Use free on fileList[index] 2022-06-11 20:14:25 +01:00
Clifford Yapp 88e512c92c Use strncpy to copy path to buf 2022-06-11 20:14:25 +01:00
Clifford Yapp 09deafbe23 Use strncpy to initialize schName and newName 2022-06-11 20:14:25 +01:00
Clifford Yapp 830e29fb80 Add more initializers 2022-06-11 20:14:25 +01:00
Clifford Yapp 3c17e71b63 Make sure we have item, and don't continue after we delete it. 2022-06-11 20:14:25 +01:00
Clifford Yapp 1d46986e80 Passing back the internal pointer to a std::string is evidently a Bad Idea - just send back a std::string. 2022-06-11 20:14:25 +01:00
Clifford Yapp ca1d62719a If we need to allocate an EntityNode, clean it up. 2022-06-11 20:14:25 +01:00
Clifford Yapp a6bea3572e Delete temporary element after use 2022-06-11 20:14:25 +01:00
Clifford Yapp ae933edba5 Add destructor, use array delete 2022-06-11 20:14:25 +01:00
Clifford Yapp 93c79df2df Initialize, fix variable types. 2022-06-11 20:14:25 +01:00
Clifford Yapp 3e9fe17fcd Delete _headerInstances in destructor 2022-06-11 20:14:25 +01:00
Clifford Yapp 874dca8499 Add destructor for CmdMgr 2022-06-11 20:14:25 +01:00
Clifford Yapp c7bd9fa995 Use array deletes, clean up temporary objects. 2022-06-11 20:14:25 +01:00
Clifford Yapp 4446d02063 Adjust name of example header as well 2022-06-11 17:41:58 +01:00
Clifford Yapp 97c3d193a1 sc_cf.h -> config.h
Remove unused sc_cf_cmake.h.in, rename sc_cf.h to the more standard name
"config.h", don't call the generator twice
2022-06-11 17:41:58 +01:00
Clifford Yapp 65e0f704fd Using newer standards, remove sc_stdbool.h 2022-06-11 17:41:13 +01:00
Clifford Yapp d36c0dde5b Add initializers for TYPEis entities 2022-06-11 17:40:25 +01:00
Clifford Yapp 8ed3d2fe33 Fix output for SC_TRACE_FPRINTF option (used for debugging - reports where generated code in exp2cxx output comes from.) 2022-06-11 17:40:25 +01:00
Clifford Yapp 61d34a352c Add some default initializers in the generated C++ code. 2022-06-11 17:40:25 +01:00
Clifford Yapp 6c9a2582c6 Use calloc to initialize the names array. 2022-06-11 17:33:24 +01:00
Clifford Yapp 0fd354cb39 Make sure BUFSIZ buffers have room for NULL
In case we do end up with buffers with contents at the BUFSIZ limit,
make sure we leave room to set a null termination char.  Not always
clear where these buffers might get used or re-used, so just bump their
size across the board.
2022-06-11 17:33:24 +01:00
Chris HORLER fd8b7e3a6b exp2py: reduce TYPE output to class level pass statement for simple types 2022-06-11 14:18:23 +01:00
Chris HORLER 0be8f439ef exp2py: add initial OP_GROUP support 2022-06-11 14:18:23 +01:00
Chris HORLER 8a8ea3e23a exp2py: fix comparisons with None 2022-06-11 14:18:23 +01:00
Chris HORLER 70b5d0d0af exp2py: expressions are held in a 2-tree, processed recursively
* set OP_UNKNOWN on LHS
  * test for OP_DOT and OP_GROUP when processing identifier_
2022-06-11 14:18:23 +01:00
Chris HORLER 06ee050fb2 exp2py: add "property" to reserved words 2022-06-11 14:18:23 +01:00
Chris HORLER 472bd4cb12 exp2py: fix some indentation errors found in for and while loops 2022-06-11 14:18:23 +01:00
Chris HORLER fed696dc63 exp2py: raise NotImplementedError when appropriate 2022-06-11 14:18:23 +01:00
Chris HORLER 35da61660b exp2py: update repo gitignore to ignore all __pycache__ folders 2022-06-11 14:18:23 +01:00
Chris HORLER 0ef7755151 exp2py: first steps to fix output order and dependency logic 2022-06-11 14:18:23 +01:00
Chris HORLER 7aa4309848 exp2py: use relative imports for SCL library 2022-06-11 14:18:23 +01:00
Chris HORLER 3c21bf00ac Part21 Legacy Parser
* optimisations
    - remove list copy and try clauses
    - stop using token iterator
    - tab modules (for ply optimised mode)
    - add missing t_error function (for ply optimised mode)
  * useability
    - add option to only parse the header then exit
  * fixes
    - fix ComplexEntity creation, and simpify / correct AST creation
2022-06-11 14:18:23 +01:00
Chris HORLER 0f303d5c06 Part21 alternative Lexer / Parser specification
populates an sqlite database
2022-06-11 14:18:23 +01:00
Chris HORLER cfbd07306d prototype re2c based LL(3) Part21 parser 2022-06-11 14:18:23 +01:00
Chris HORLER cd8efa604f exploration of sqlite3 plugin (based on json1.c) for allowing high performance predicates, intended as a layer between ORM and direct database manipulation 2022-06-11 14:18:23 +01:00
Chris HORLER af637a28d8 remove unitary_schemas, these should be dynamically generated 2022-06-11 13:12:41 +01:00
Chris HORLER 0cefcae153 fixup: python SCL standardise all class declarations (remove object base) 2022-06-11 13:12:41 +01:00
Chris HORLER b42a909e65 python SCL standardise all class declarations (remove object base) 2022-06-11 13:12:41 +01:00
Chris HORLER dace0f70ef Simplified setup.cfg package search to use explicit package listing. 2022-06-11 13:12:41 +01:00
Devon Sparks 43329f557f Add notes about test suite to README 2022-06-11 13:12:41 +01:00
Chris HORLER 3e8b836b3e fixup path for unitary schema tests 2022-06-11 13:12:41 +01:00
Chris HORLER ead7c6c8c3 Added README to setup.cfg 2022-06-11 13:12:41 +01:00
Chris HORLER fc3bcf0578 Minor updates to README. 2022-06-11 13:12:41 +01:00
Devon Sparks 68cca0e222 Added initial README 2022-06-11 13:12:41 +01:00
Chris HORLER bfe5219dc2 Added new sanity test for Part 21 parser. 2022-06-11 13:12:41 +01:00
Chris HORLER ae6f9d9310 move tests to python folder 2022-06-11 13:12:41 +01:00
Chris HORLER f8b786ac40 fixup some exp2py tests 2022-06-11 13:12:41 +01:00
Chris HORLER 53a2bcdd8b PEP-517 compliance, e.g. pip install . 2022-06-11 13:12:41 +01:00
Chris HORLER f11d325641 remove Python 2.6 compatibility code 2022-06-11 13:12:41 +01:00
Cliff Yapp aa6cbe2d72 Fix example build (Issue #404) by adding the sc_cf.h.in file (making a copy rather than a symlink for the sake of Windows.) 2022-06-11 13:12:41 +01:00
Clifford Yapp 50e2cdb527 Fix git clone lines to use https
Github has disabled git:// protocol support, so we need to switch:
https://github.blog/2021-09-01-improving-git-protocol-security-github/
2022-06-11 01:26:02 +01:00
Chris HORLER 1f184eae8c Merge pull request #442 from cshorler/fix_workflow_actions_for_pr
fix workflow actions for pull requests, and add manual trigger for up…
2022-06-10 00:02:06 +01:00
Chris HORLER 90f3c5ce26 fix workflow actions for pull requests, and add manual trigger for updated branches 2022-06-09 23:10:37 +01:00
Christopher Sean Morrison aa85c396bf Merge pull request #439 from brianmoose/fileexists
Fix FileExists() logic
2022-03-31 16:09:12 -04:00
Brian Alger f19cfecebe Fix FileExists() logic 2022-03-22 07:45:44 -06:00
Clifford Yapp 7456652b67 Still getting appveyor in checks list (??) 2021-09-06 19:56:51 -04:00
Clifford Yapp 2a50010e6f No longer using appveyor 2021-09-06 19:53:23 -04:00
Clifford Yapp bf14461dae Point to the main stepcode repository 2021-09-06 17:22:05 -04:00
Chris HORLER ec12b1ce7c Merge pull request #413 from stepcode/github_actions
Start of a Github Actions CI setup.
2021-09-05 22:02:33 +01:00
Chris HORLER de375f8cea fix github actions / ci directory name 2021-09-05 21:01:50 +01:00
Clifford Yapp 30534dbf0e Remove the old CI files 2021-09-05 21:01:50 +01:00
Clifford Yapp 5fddadb1e4 Test with the Ubuntu clang compiler as well. 2021-09-05 21:01:50 +01:00
Clifford Yapp 20c6d4c800 Enable all tests, set up BRL-CAD step-g WIN32 test
With all the recent patches to develop applied, the following tests all
succeeded as Github Actions in a test repository.
2021-09-05 21:01:50 +01:00
Clifford Yapp 125820c84c Start of a Github Actions CI setup. 2021-09-05 21:01:50 +01:00
Cliff Yapp 6984cf6a46 Merge pull request #425 from stepcode/perplex_cmake
Add a sentinel target for perplex generated output
2021-08-23 16:08:13 -04:00
Cliff Yapp 322018c6db Merge pull request #423 from stepcode/windent
Remove unneeded indentation in generated output.
2021-08-23 16:07:56 -04:00
Cliff Yapp d5f60d72e0 Merge pull request #422 from stepcode/warnings
Clear some C++ compilation warnings from the main stepcode libs
2021-08-23 16:07:42 -04:00
Cliff Yapp aa5b0e3fa2 Merge pull request #421 from stepcode/depcpy
Clear deprecated-copy warning from C++ class.
2021-08-23 16:07:15 -04:00
Cliff Yapp c81d05cff6 Merge pull request #418 from stepcode/desc
Remove Raw() and getEDesc(), restore C asStr()
2021-08-23 16:06:55 -04:00
Cliff Yapp 799a51f340 Merge pull request #417 from stepcode/errorget_export
Export ERRORget_warnings_help for MSVC
2021-08-23 16:06:36 -04:00
Cliff Yapp 89b00f1596 Merge pull request #416 from stepcode/copy_constructor
Define a default copy constructor.
2021-08-23 16:06:23 -04:00
Clifford Yapp ccb6728efa Add some more patterns to the gitignore file. 2021-08-17 16:29:06 -04:00
Clifford Yapp 75af3df51c Shouldn't need the SC_VERSION.txt file 2021-08-17 16:24:20 -04:00
Clifford Yapp 0f1196ef94 Remove references to stepcode.org 2021-08-17 16:20:22 -04:00
Clifford Yapp e4277656ef Add a sentinel target for perplex generated output
Getting an intermittent failure on Windows where the expscan.h header
apparently isn't present on the file system soon enough for the build to
succeed (a subsequent reinvocation of the build command does succeed.)

Try the standard technique of making another file write depend on the
outputs of the header and src file, then define a target depending on
that sentinel file and make the obj libraries depend on that target.
2021-08-17 13:00:15 -04:00
Wolfgang E. Sanyer 8dc5dceb59 Fix compile error related to ODR violation.
These structs were already declared in alg.h, leading to build issues.

fixes #404

Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer@gmail.com>
(cherry picked from commit fa87ef1e6d2e670730c3b7b19e8acaa4186eaac5)
2021-08-17 10:31:30 -04:00
Clifford Yapp 093e59e5a7 Per suggestion from Sean, go ahead and export all symbols. 2021-08-16 19:41:23 -04:00
Cliff Yapp 177eef8acf Merge pull request #420 from stepcode/nullck
Check before deferencing, and initialize to NULL.
2021-08-16 16:56:14 -04:00
Clifford Yapp 211bc660da Per suggestion from Sean, don't hardcode file or line numbers. 2021-08-16 16:50:37 -04:00
Cliff Yapp 0b6853f5a7 Merge pull request #419 from stepcode/dll
Export MEMORYinitialize and FACTORYinitialize for Windows.
2021-08-16 16:38:36 -04:00
Clifford Yapp b158a79f6c Remove unneeded indentation in generated output.
Newer GCC doesn't like the indenting of this line, since in some
situations it looks as if the logic is being guarded by an if clause
when it is not.
2021-08-16 15:47:16 -04:00
Clifford Yapp 1f1965beae Clear some C++ compilation warnings from the main stepcode libs 2021-08-16 15:24:58 -04:00
Clifford Yapp 9f35265f75 Clear deprecated-copy warning from C++ class.
Getting a -Wdeprecated-copy trigger from ap210e3's use of
SDAI_BOOLEAN - make an explicit assignment operator.
2021-08-16 14:26:09 -04:00
Clifford Yapp 345bcd8174 Check before deferencing, and initialize to NULL.
Crash was observed in Release build for BRL-CAD's step-g on Ubuntu
Linux without this check.
2021-08-16 14:20:57 -04:00
Clifford Yapp f05ce582ac Export MEMORYinitialize and FACTORYinitialize for Windows. 2021-08-16 14:15:34 -04:00
Clifford Yapp 5e1ad8f1c8 Remove Raw() and getEDesc(), restore C asStr()
This commit removes the Raw and getEDesc methods in favor of the
simplicity of just making ptr and eDesc public.

Add back in previous version of asStr() that returns a C string.

aDesc is also made public.

These changes are motivated by BRL-CAD's use of stepcode.
2021-08-16 14:09:10 -04:00
Clifford Yapp dcb156f1eb Export ERRORget_warnings_help for MSVC 2021-08-16 13:42:07 -04:00
Clifford Yapp 1bf945d60b Define a default copy constructor.
Werror=deprecated-copy with GCC was triggered by code generated from
this exp2cxx output.  Go ahead and define the copy constructor to
avoid the deprecated behavior.
2021-08-16 13:37:39 -04:00
Chris HORLER 380618fa7e Merge pull request #414 from stepcode/rework_cmake_update
cmake update
2021-08-15 19:36:16 +01:00
Chris HORLER 55d36377c3 Adjust whitespace 2021-08-15 09:22:59 +01:00
Clifford Yapp 62be4c90c6 Use CMake 3.12 everywhere. 2021-08-15 09:22:59 +01:00
Clifford Yapp c2fddd8a7a Restore SC_BUILD_EXPRESS_ONLY option 2021-08-15 09:22:59 +01:00
Clifford Yapp 8adb5e638d Remove no-longer-used CMake files. 2021-08-15 09:22:59 +01:00
Clifford Yapp fceb57390c Until we need the newer re2c, don't insist on it.
BRL-CAD's supporting system for building this will need some updates
once we require a newer re2c - to make testing easier in the meantime,
don't require the newer version.
2021-08-15 09:22:59 +01:00
Clifford Yapp ae18190f69 Make copy more robust for parallel builds
This is a classic problem - the file copy will begin, the file will be
"present" in some sense on the file system, and build steps that need it
will begin - but they won't find what they actually need because the
copy isn't fully executed.  The standard approach for this is to add a
second file which is only created after the first is done, and then make
the target depend on the second file rather than the first.
2021-08-15 09:22:59 +01:00
Clifford Yapp 8c9b3471fb Build again w/ the generator tools. 2021-08-15 09:22:59 +01:00
Chris HORLER 22c437d45e Simplify the Lemon and RE2C modules
Original work adapted from commits:
b1844be9cc
92cb70de2b
2021-08-15 09:22:59 +01:00
Clifford Yapp 5ea56aac02 update build system
(cherry picked from commit b1844be9cc)
2021-08-15 09:22:59 +01:00
Clifford Yapp 14c5476537 Use straight-up CMake commands in lieu of wrapping
The basic CMake commands are more straightforward to work with for
someone not familiar with stepcode, and we don't really have enough
targets w/ apply-this-to-everything add-ons to need the more elaborate
logic the way BRL-CAD does (which is what originally inspired them.)
2021-08-15 09:22:59 +01:00
Clifford Yapp f7e929fe6a Add DLL defines for obj libs 2021-08-15 09:22:59 +01:00
Clifford Yapp 736d637d63 Remove MD5 verification logic. 2021-08-15 09:22:59 +01:00
Chris HORLER 6cf5d1e860 CMake update
- variable usage, RPATHs, config header generation
 - remove the CMake core target
2021-08-15 09:22:29 +01:00
Chris HORLER faadf26cdf add missing feature define for stat S_IFDIR 2021-08-14 10:24:35 +01:00
Chris HORLER e617808be1 simplify SC_VERSION and library versioning 2021-08-14 10:24:35 +01:00
Chris HORLER 97de8f9069 replace nullptr by NULL 2021-08-14 10:24:35 +01:00
Clifford Yapp 4f20f391c6 Reverting develop back to commit 548fd82ad7 2021-08-04 16:04:32 -04:00
Clifford Yapp 29f87a6d58 Reverting back to state at commit 548fd82ad7
Subsequent changes caused problems for development, and will need to be
merged in more carefully from develop
2021-08-04 15:54:49 -04:00
Cliff Yapp 880a42bb90 Fix example build (Issue #404) by adding the sc_cf.h.in file (making a copy rather than a symlink for the sake of Windows.) 2021-01-09 21:17:44 -05:00
Cliff Yapp a1462e99b0 Simplify header generation. 2020-12-17 23:57:22 -05:00
Cliff Yapp bbc20e3ba2 Check for null before deferencing, and initialize to NULL. (Crash observed in Release build for BRL-CAD's step-g on Ubuntu Linux.) 2020-12-15 16:03:48 -05:00
Cliff Yapp 359f949ed6 Formatting fixes. 2020-12-15 15:13:47 -05:00
Cliff Yapp d27564c5ed Switch SdaiBinary content container to a plain C string to avoid the 4251 warning. 2020-12-15 15:13:04 -05:00
Cliff Yapp 30683985ca Stray version header includes in test cc files 2020-12-15 15:07:37 -05:00
Cliff Yapp fe796629a2 Fix p21read compilation. 2020-12-15 14:49:54 -05:00
Cliff Yapp bfff9e6f86 Remove the C4251 warning elements from sc_benchmark.h, adjust code. 2020-12-15 14:37:25 -05:00
Cliff Yapp b2287b3b53 Simplify for BRL-CAD build. 2020-12-15 09:23:59 -05:00
Cliff Yapp beeb5614c1 Clear deprecated-copy warning from C++ class.
Getting a -Wdeprecated-copy trigger from ap210e3's use of
SDAI_BOOLEAN - make an explicit assignment operator.
2020-12-14 16:35:07 -05:00
Cliff Yapp ec35904342 Wignored-qualifiers errors make looking for any other issues difficult - suppress them until we can figure out how not to trigger them. 2020-12-14 16:27:15 -05:00
Cliff Yapp 9bba7d5157 Simplify build options.
This strips down the build options to more vanilla CMake,
removes the uninstall target, and goes back to respecting
CMAKE_INSTALL_PREFIX.
2020-12-14 16:16:56 -05:00
Cliff Yapp 4bf478b6e3 Remove the express-only option 2020-12-14 16:09:26 -05:00
Cliff Yapp 853aeb4e8b Minor CMakeLists.txt cleanups 2020-12-14 16:03:30 -05:00
Cliff Yapp 725ec378c7 Remove unused file, line wrap scanner README 2020-12-14 16:00:58 -05:00
Cliff Yapp 5d8c597d8f Simplify BUILD_SHARED_LIBS and BUILD_STATIC_LIBS options. 2020-12-14 15:58:24 -05:00
Cliff Yapp a366339220 See if we can just do a straight up check on these. 2020-12-14 15:49:37 -05:00
Cliff Yapp 44fb19669b Simplify relative directory settings 2020-12-14 15:43:54 -05:00
Cliff Yapp 18a6528090 Look for a different root file 2020-12-14 15:28:42 -05:00
Cliff Yapp 6368ed08f9 Dispense with the separate version header 2020-12-14 15:26:31 -05:00
Cliff Yapp 46717ab714 remove nullptr.h, minor CMake cleanup, one more posix define 2020-12-14 15:17:05 -05:00
Cliff Yapp 7a3d8f0ce5 Turn on the C/C++11 standards. Rather than enable extensions, add a few defines in particular locations. 2020-12-14 14:57:18 -05:00
Cliff Yapp 670600e67b Try removing some consts for Wignored-qualifiers
Const setting on return casts is tripping a lot of
Wignored-qualifiers on return types.  Figuring out when to
use them is going to be tricky - checkpoint a few minor
changes in that direction.
2020-12-14 14:41:56 -05:00
Cliff Yapp f8783577d5 Clear some C++ compilation warnings from the main stepcode libs 2020-12-14 12:58:49 -05:00
Cliff Yapp 713b3e67b6 Try exporting MEMORYinitialize and FACTORYinitialize for Windows. 2020-12-09 09:29:59 -05:00
Cliff Yapp 93cb422595 Update formatting with astyle - use K&R 2020-12-09 09:26:27 -05:00
Cliff Yapp 74d9062ff1 Start making some fixes to tests 2020-12-08 19:57:58 -05:00
Cliff Yapp 9eb23dc2a9 Make sure we have the policy before we try to set it. 2020-12-08 19:44:28 -05:00
Cliff Yapp 2f378267dc BRL-CAD also uses aDesc directly 2020-12-08 19:19:45 -05:00
Cliff Yapp 1f4f78f905 Remove Raw() and getEDesc(), restore C asStr()
This commit removes the Raw and getEDesc methods in favor of the
simplicity of just making ptr and eDesc public.

Also, add back in previous version of asStr() that returns a C
string.  (These changes are motivated by BRL-CAD's step code.)
2020-12-08 19:03:12 -05:00
Cliff Yapp 0b69a9a5e5 Install check-express 2020-12-03 08:54:29 -05:00
Cliff Yapp 30d570a3a0 Simplify the libexpress build logic.
This approach seems to be more reliable when it comes to generating
expscan.h in the proper sequence for building.
2020-12-02 23:02:20 -05:00
Cliff Yapp 18b4d8282a Remove a couple uses of version_string target 2020-12-02 21:07:02 -05:00
Cliff Yapp 142edd5698 Go with the simpler version string.
The relatively complicated logic trying to pull in the git sha1 id for
each build is proving fragile in some scenarios.  Just go with a
simpler encoding of the defined library version.
2020-12-02 20:38:55 -05:00
Cliff Yapp 371d498c0a Don't set RPATH settings if they've already been defined. 2020-12-02 19:37:46 -05:00
Cliff Yapp 63fe2f69ee Export ERRORget_warnings_help for MSVC 2020-12-02 19:36:42 -05:00
Cliff Yapp 029eac6065 Bump minimum CMake to 3.12 2020-12-02 19:36:00 -05:00
Cliff Yapp 90de683f5a Adjust versioning of shared libraries.
Simplify - just use the library versions for the shared library links.
Also, accommodate OpenBSD's particular convention for such libraries.
2020-12-01 12:07:13 -05:00
Cliff Yapp b9189212bd Define a default copy constructor.
Werror=deprecated-copy with GCC was triggered by code generated from
this exp2cxx output.  Go ahead and define the copy constructor to
avoid the deprecated behavior.
2020-12-01 09:23:09 -05:00
Cliff Yapp 9e31f561c6 Remove unneeded indentation in generated output.
Newer GCC doesn't like the indenting of this line, since in some
situations it looks as if it is being guarded by an if clause when
it is not.
2020-11-30 21:52:36 -05:00
Cliff Yapp 414b8705a2 Remove md5 verification of generated sources.
This has proven to be more trouble than it is worth - changes
to the lexer and parser inputs are relatively rare at this point,
and different versions of re2c/lemon can break the checks.
2020-11-30 21:36:27 -05:00
Cliff Yapp 3f8bde4319 Update Find* modules to the latest from BRL-CAD 2020-11-30 21:15:25 -05:00
Chris HORLER 548fd82ad7 Merge pull request #401 from luzpaz/typos
Fix typos
2020-10-09 14:01:11 +01:00
Chris HORLER 2375f10331 Merge pull request #399 from luzpaz/Issue-395
Rename NotImplemented() to NotImplementedError()
2020-10-09 13:58:10 +01:00
Chris HORLER 73358caf4b Merge pull request #400 from luzpaz/equality
Fix all 'Testing equality to None' issues
2020-10-09 13:56:42 +01:00
luz paz 9285090208 Fix typos
Found via `codespell`
2020-10-08 16:26:11 -04:00
luz paz 227dbb84ab Fix all 'Testing equality to None' issues
Testing whether an object is `None` using the `==` operator is inefficient and potentially incorrect. This PR has substituted all instances (that are not subject to be regenerated by exp2python) with`is None`
2020-10-08 16:19:24 -04:00
luz paz f2ebe246fa Rename NotImplemented() to NotImplementedError()
Fixes #395
2020-10-08 16:12:36 -04:00
Chris HORLER 69db0c0192 remove inline extern declarations 2020-07-22 23:16:31 +01:00
Chris HORLER 5e28f4417a drop PROTO macro (fixup) 2020-07-22 23:16:31 +01:00
Chris HORLER 61eec0dcc5 drop the Generic typedef (fixup) 2020-07-22 23:16:27 +01:00
Chris HORLER 68d0e7bbb4 rework ERROR handling 2020-07-22 23:15:28 +01:00
Chris HORLER 88e82d8faf reenable lemon / full build for integration test purposes 2020-07-21 23:22:48 +01:00
Chris HORLER d6d7aeec95 clean up includes, use <> for C standard library and "" for stepcode headers 2020-07-21 17:18:22 +01:00
Chris HORLER 5edde001e5 add missing declarations required for tests 2020-07-21 17:10:12 +01:00
Chris HORLER d9d6406b0b remove static declaration from some functions to enable tests 2020-07-21 17:10:09 +01:00
Chris HORLER 2cd591be99 move declarations from resolve.c to resolve.h / add missing declaration 2020-07-21 17:05:26 +01:00
Chris HORLER 663414f90d split resolve.c, add a linker seam to facilitate tests 2020-07-21 16:58:45 +01:00
Chris HORLER b58e30c575 move object creation to factory.c to make testing possible 2020-07-21 16:23:36 +01:00
Chris HORLER 4a71f48bc8 move allocator functionality to one module to enable easier testing 2020-07-21 16:17:03 +01:00
Chris HORLER db4f1a68d5 simplify OBJ lookup, compile time initialisation 2020-07-21 16:17:01 +01:00
Chris HORLER e76d92d082 complete tests around DICT_type usage to faciliate refactoring 2020-07-21 16:05:24 +01:00
Chris HORLER f8bd03507d legacy parser USE / REFERENCE bug fix 2020-07-21 16:05:24 +01:00
Chris HORLER 997618fe86 initial test harness for express.c, resolve.c, schema.c, scope.c, type.c (currently no tests) 2020-07-21 16:05:23 +01:00
Chris HORLER e5a55b4ab3 remove dependance upon exp_kw.c / unnecessary globals 2020-07-21 16:05:21 +01:00
Chris HORLER 99e57aed21 grammar debugging aide for gdb 2020-07-21 16:01:10 +01:00
Chris HORLER f3b1065432 additional tests / rename of tests for EXPresolve_op_dot 2020-07-21 16:01:10 +01:00
Chris HORLER 18f81e1898 move VARcreate and ENTITYcreate to factory.c 2020-07-21 16:01:10 +01:00
Chris HORLER a25ee56f6c add test for EXPresolve_op_dot 2020-07-21 16:01:10 +01:00
Chris HORLER 4b58b2dc11 start to move object creation routines to factory.c 2020-07-21 16:01:08 +01:00
Chris HORLER 3c785b4451 move all allocator setup to new memory.c (initially just for tests) 2020-07-21 15:53:21 +01:00
Chris HORLER 7e192a40f3 rename everything with MEM prefix to ALLOC prefix and fix includes 2020-07-21 15:50:31 +01:00
Chris HORLER 3ed4ffd302 rename memory.[ch] 2020-07-21 15:29:35 +01:00
Chris HORLER 61e680ae72 add Fake Function Framework (FFF) for mocks 2020-07-21 15:29:35 +01:00
Chris HORLER 9b68d893e7 start to implement TDD to ensure no change of behaviour 2020-07-21 15:29:32 +01:00
Chris HORLER a4d1e03f0d ensure when SC_BUILD_EXPRESS_ONLY is set that we do not build the schema scanner 2020-07-21 15:25:38 +01:00
Chris HORLER 573c3ec1d5 add parentheses and scopes to remove noisy warnings issued by GCC 2020-07-21 15:25:38 +01:00
Chris HORLER c0b61b40cb intermediate CMake object libraries for libexpress to support tests
generated subdir CMakeLists.txt
begin to remove Perplex
2020-07-21 15:24:25 +01:00
Chris HORLER ead7664070 remove (now) redundant cmake_policy conditional checks
require C11 / C++11
2020-07-21 15:11:50 +01:00
Chris HORLER a9a7e0af4a Merge pull request #392 from cshorler/simplify_std_msvc_fixes
Simplify std msvc fixes
2020-07-19 16:03:26 +01:00
Sean Morrison 8bf6f74bb8 make what should be the obvious statement regarding generated code 2019-11-23 06:07:05 -05:00
Sean Morrison c9031fb76a leave the exception clause out for now, at least until there's an expressed concern/need. 2019-11-23 04:54:38 -05:00
Sean Morrison b5c6bd327a clarify AUTHORS and meant collective 2019-11-23 04:50:21 -05:00
Sean Morrison 4afeea4d39 clean up the copying file to clarify the licensing status. add a detailed INTENT.md file to explain the government and brl-cad origins of the project. 2019-11-23 04:02:13 -05:00
Chris HORLER 5ab50bb68f begin to modernise / simplify CMake code 2019-08-26 18:42:45 +01:00
Chris HORLER dc38153539 duplicate declaration of SchemaInit() - it's already in the schema's generated header 2019-08-26 18:42:45 +01:00
Chris HORLER 254024b954 silence MSVC warning 4251 - should be revisited later (if std:: interface layer needs to be limited) 2019-08-26 18:42:26 +01:00
Chris HORLER 85b76db65a use _WIN32 for Windows and _MSC_VER for compiler checks 2019-08-26 17:38:09 +01:00
Chris HORLER ac9fc03986 drop support for BORLAND compiler 2019-08-07 20:30:32 +01:00
Chris HORLER ce88e635f0 cleanup error.h, migrate error.c to use stdarg.h 2019-08-07 20:30:32 +01:00
Chris HORLER bab3886f54 drop THROW_ macros 2019-08-07 20:30:32 +01:00
Chris HORLER e1162b63c4 drop (unused) CONST macro 2019-08-07 20:30:32 +01:00
Chris HORLER e9c28ff7cb drop static_inline macro 2019-08-07 20:30:32 +01:00
Chris HORLER e934fa246c drop the Generic typedef 2019-08-07 20:30:32 +01:00
Chris HORLER f773771f27 drop PROTO macro 2019-08-07 20:30:32 +01:00
Chris HORLER fd77902539 drop macro streq 2019-08-07 20:30:32 +01:00
Chris HORLER 1732897cbc simplify DLL exports / imports 2019-08-07 20:30:32 +01:00
Chris HORLER 7e46389420 MSVC doesn't correctly implement snprintf or vsnprintf until VS2015 2019-08-07 20:30:32 +01:00
Thomas Paviot b06466ce4b Merge pull request #385 from cclauss/modernize-Python-2-codes
Use print() function in both Python 2 and Python 3
2019-01-09 17:23:40 +01:00
cclauss 284b1893de Use print() function in both Python 2 and Python 3
Legacy __print__ statements are syntax errors in Python 3 but __print()__ function works as expected in both Python 2 and Python 3.
2019-01-04 16:20:29 +01:00
Chris HORLER a0b0a10249 Merge pull request #377 from luzpaz/typos
Misc. typos
2018-07-18 17:20:11 +01:00
luz.paz f93abd2991 Misc. typos
Found via `codespell`
2018-07-13 19:12:09 -04:00
Jeff Epler 64ac71cf96 Merge pull request #372 from luzpaz/misc-typo
Misc. typo
2018-01-04 21:01:17 -06:00
luz.paz e20def2ee1 Misc. typo 2018-01-04 11:44:03 -05:00
Mark 367d0e867d Merge pull request #371 from luzpaz/moar-misc-typos
More Misc. typos
2017-12-26 21:23:10 -05:00
Unknown 41105500c9 More Misc. typos 2017-12-23 08:30:09 -05:00
Jeff Epler 132ad5ea1f Merge pull request #370 from luzpaz/misc-typos
Misc. typos
2017-11-29 20:50:54 -06:00
luzpaz 11942a3c06 Misc. typos 2017-11-27 16:27:56 -05:00
Jeff Epler f076b04524 Merge pull request #367 from luzpaz/comment-typo
data/ap238/ap238-aim-long.exp comment typo
2017-10-25 07:25:07 -05:00
Unknown f3b6498da2 data/ap238/ap238-aim-long.exp comment typo 2017-10-09 07:40:52 -04:00
Jeff Epler 7fb53396ce Merge pull request #366 from luzpaz/more-misc-typos
More typos
2017-10-04 06:51:03 -05:00
luzpaz 575a2f93b3 More typos 2017-10-03 08:47:55 -04:00
Mark 85ea3ed2d4 Merge pull request #365 from luzpaz/misc_typos
Misc. typos
2017-09-17 22:15:10 -04:00
luzpaz 0eb7aabbb3 Misc. typos
A few user-facing and the rest just code comments
2017-09-15 11:48:28 -04:00
Jeff Epler 226dfb4697 Merge pull request #364 from jepler/enable-additional-tests
Enable additional tests
2017-08-28 08:20:56 -05:00
Jeff Epler e5a534d5e5 appveyor: don't skip test on Windows
The test failure has been fixed since 84472921
2017-08-28 07:51:42 -05:00
Jeff Epler 6fe8648657 travis: no longer allow osx failures
.. the known failure was fixed at 0b6cd90d
2017-08-22 20:34:30 -05:00
479 changed files with 26898 additions and 12408 deletions
-65
View File
@@ -1,65 +0,0 @@
version: '{build}'
# for Appveyor CI (windows)
branches:
only:
- master
os: Windows Server 2012 R2
clone_folder: c:\projects\STEPcode
#grab zip instead of git clone
shallow_clone: true
platform: x64
configuration: Debug
# errors or couldn't be found by cmake
# - GENERATOR: "Visual Studio 9 2008"
# ARCH: 32
# - GENERATOR: "Visual Studio 10"
# ARCH: 32
#no point in these without artifact support...
# - GENERATOR: "Visual Studio 11"
#ARCH: 32
#- GENERATOR: "Visual Studio 12"
#ARCH: 32
environment:
matrix:
- GENERATOR: "Visual Studio 12 Win64"
ARCH: 64
# build:
# parallel: true
# project: ALL_BUILD.vcxproj
#appveyor limits compile/test to 30 minutes
# to reduce time, only test schemas with files: ifc2x3, ap214e3, ap209
build_script:
- ps: |
cd c:\projects\STEPcode
mkdir build
cd build
cmake -version
grep --version
cmake .. -DSC_ENABLE_TESTING=ON -G"$env:GENERATOR" -DSC_BUILD_SCHEMAS="ifc2x3;ap214e3;ap209"
echo "filtering build output with grep"
cmake --build . --config Debug | grep -ve "CMake does not need to re-run because" -e "ZERO_CHECK.ZERO_CHECK" -e "^ Creating directory"
#msbuld seems to provide no benefits, and I can't filter its output...
#msbuild SC.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Configuration=Debug /p:Platform=x64
# /toolsversion:14.0 /p:PlatformToolset=v140
test_script:
- cmd: echo Running CTest...
- cmd: cd c:\projects\STEPcode\build
- cmd: echo excluding test_inverse_attr3, which hangs
- cmd: ctest -j1 . -C Debug -E test_inverse_attr3 --output-on-failure
# - cmd: grep -niB20 "Test Failed" Testing/Temporary/LastTest.log
# we could upload a compiled zip somewhere (see Appveyor artifact documentation)
+277
View File
@@ -0,0 +1,277 @@
name: STEPCODE
on:
workflow_dispatch:
pull_request:
jobs:
windows:
name: Windows Latest MSVC
runs-on: windows-latest
strategy:
fail-fast: true
steps:
- name: Setup - CMake
uses: lukka/get-cmake@latest
- name: Setup - Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Checkout
uses: actions/checkout@v2
- name: Add github workspace to path
# https://github.community/t/deprecated-add-path/136621
run: echo "$ENV{GITHUB_WORKSPACE}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Add cl.exe to PATH
uses: ilammy/msvc-dev-cmd@v1
- name: Configure
run: |
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DSC_ENABLE_TESTING=ON
# We do the following in order to help ensure files are "flushed"
# to disk before compilation is attempted
# https://superuser.com/a/1553374/1286142
powershell Write-VolumeCache C
powershell Write-VolumeCache D
- name: Build
run: cd build && ninja -j1 -v
- name: Test
run: |
cd build && ctest -j1 .
linux:
name: Ubuntu Latest GCC
runs-on: ubuntu-20.04
strategy:
fail-fast: true
steps:
- name: Setup - CMake
uses: lukka/get-cmake@latest
- name: Setup - Ninja
uses: seanmiddleditch/gha-setup-ninja@master
# TODO - we will want this when the new parser work comes in,
# as we won't need perplex and the system tools should suffice
# to exercise the generator logic:
#
# - name: Setup - System
# env:
# DEBIAN_FRONTEND: noninteractive
# run: |
# sudo apt-get update
# # Install dev tools
# sudo apt-get install re2c lemon
# sudo apt-get clean
- name: Checkout
uses: actions/checkout@v2
- name: Configure
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cmake -S . -G Ninja -B build -D ENABLE_ALL=ON -D CMAKE_BUILD_TYPE=Release -DSC_ENABLE_TESTING=ON
- name: Build
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cmake --build build --config Release
- name: Test
run: |
cd build && ctest -j1 . -C Release
linux_clang:
name: Ubuntu Latest Clang
runs-on: ubuntu-20.04
strategy:
fail-fast: true
steps:
- name: Setup - CMake
uses: lukka/get-cmake@latest
- name: Setup - Ninja
uses: seanmiddleditch/gha-setup-ninja@master
# TODO - we will want this when the new parser work comes in,
# as we won't need perplex and the system tools should suffice
# to exercise the generator logic:
#
# - name: Setup - System
# env:
# DEBIAN_FRONTEND: noninteractive
# run: |
# sudo apt-get update
# # Install dev tools
# sudo apt-get install re2c lemon
# sudo apt-get clean
- name: Checkout
uses: actions/checkout@v2
- name: Configure
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
CC=clang CXX=clang++ cmake -S . -G Ninja -B build -D ENABLE_ALL=ON -D CMAKE_BUILD_TYPE=Release -DSC_ENABLE_TESTING=ON
- name: Build
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
CC=clang CXX=clang++ cmake --build build --config Release
- name: Test
run: |
cd build && ctest -j1 . -C Release
osx:
name: macOS Latest Clang
runs-on: macos-latest
strategy:
fail-fast: true
steps:
- name: Setup - CMake
uses: lukka/get-cmake@latest
- name: Setup - Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Checkout
uses: actions/checkout@v2
- name: Configure
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
export CC=clang
export CXX=clang++
cmake -S . -G Ninja -B build -D CMAKE_BUILD_TYPE=Release -DSC_ENABLE_TESTING=ON
- name: Build
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cd build && ninja -j1
- name: Test
run: |
cd build && ctest -j1 . -C Release
brlcad_linux:
name: BRL-CAD Linux step-g Test
runs-on: ubuntu-20.04
strategy:
fail-fast: true
steps:
- name: Setup - CMake
uses: lukka/get-cmake@latest
- name: Setup - Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Setup - System
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
# Install dev tools
sudo apt-get install re2c lemon
sudo apt-get clean
- name: Checkout
run: |
git clone --depth 1 https://github.com/BRL-CAD/brlcad.git -b main
cd brlcad/src/other/ext && rm -rf stepcode
git clone --depth 1 https://github.com/stepcode/stepcode.git -b develop
# Ordinarily BRL-CAD keeps track of what files are supposed to be
# present in the repository. In this case we're not interested in
# updating the list to the working stepcode filelist, so use an empty
# list instead
echo "set(stepcode_ignore_files)" > stepcode.dist
cd ../../../../
- name: Configure
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cd brlcad
cmake -S . -G Ninja -B build -DENABLE_ALL=ON -DCMAKE_BUILD_TYPE=Release -DEXT_BUILD_VERBOSE=ON
cd ..
- name: Build
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cd brlcad
cmake --build build --config Release --target step-g
cd ..
- name: Test
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cd brlcad/build
./bin/step-g ../db/nist/NIST_MBE_PMI_3.stp -o nist3.g
cd ../..
brlcad_windows:
name: BRL-CAD Windows step-g Test
runs-on: windows-latest
strategy:
fail-fast: true
steps:
- name: Setup - CMake
uses: lukka/get-cmake@latest
- name: Setup - Ninja
uses: seanmiddleditch/gha-setup-ninja@master
- name: Add github workspace to path
# https://github.community/t/deprecated-add-path/136621
run: echo "$ENV{GITHUB_WORKSPACE}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Add cl.exe to PATH
uses: ilammy/msvc-dev-cmd@v1
- name: Checkout
run: |
git clone --depth 1 https://github.com/BRL-CAD/brlcad.git -b main
cd brlcad/src/other/ext
cmake -E rm -r stepcode
git clone --depth 1 https://github.com/stepcode/stepcode.git -b develop
# Ordinarily BRL-CAD keeps track of what files are supposed to be
# present in the repository. In this case we're not interested in
# updating the list to the working stepcode filelist, so use an empty
# list instead
echo "set(stepcode_ignore_files)" > stepcode.dist
cd ../../../../
- name: Configure
run: |
cd brlcad && cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DSC_ENABLE_TESTING=ON
cd ..
# We do the following in order to help ensure files are "flushed"
# to disk before compilation is attempted
# https://superuser.com/a/1553374/1286142
powershell Write-VolumeCache C
powershell Write-VolumeCache D
- name: Build
run: |
cd brlcad/build
ninja -j1 -v step-g
cd ../..
- name: Test
run: |
cd brlcad/build
./bin/step-g.exe ../db/nist/NIST_MBE_PMI_3.stp -o nist3.g
cd ../..
+18
View File
@@ -1,3 +1,21 @@
# Common build directories used in the source tree
/build
/.build
# Temporary files
*~
\#*\#
.\#*
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
**/__pycache__/
# OS specific files
.DS_Store
.DS_Store?
# Tool specific patterns
*.kdev4
.kdev_include_paths
-19
View File
@@ -1,19 +0,0 @@
sudo: false
language: cpp
compiler:
- clang
script: mkdir build && cd build && cmake .. -DSC_ENABLE_TESTING=ON && make -j3 && ctest -j2 --output-on-failure
branches:
only:
- master
notifications:
irc: "chat.freenode.net#stepcode"
email: scl-dev@groups.google.com
on_success: change
on_failure: always
os:
- linux
- osx
matrix:
allow_failures:
- os: osx
+1
View File
@@ -19,6 +19,7 @@ Paviot, Thomas (tpaviot)
Pictor, Mark (mpictor)
Reed, Nick (nickreed)
Shah, Kesha (kesha, keshashah)
Sparks, Devon (devonsparks)
Thomas, Dawn (homovulgaris, madant)
Wouters, Dave (davyw)
Yapp, Clifford (starseeker)
+118 -47
View File
@@ -40,60 +40,131 @@
project(SC)
# Minimum required version of CMake
cmake_minimum_required(VERSION 3.12)
if (POLICY CMP0077)
cmake_policy(SET CMP0077 OLD)
endif (POLICY CMP0077)
# SC version
set(SC_VERSION_MAJOR 0)
set(SC_VERSION_MINOR 7-dev)
set(SC_VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR})
set(SC_VERSION_MINOR 8)
set(SC_VERSION_PATCH 1)
set(SC_VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR}.${SC_VERSION_PATCH})
# SC ABI version. SC_ABI_SOVERSION should be incremented
# for each release introducing API incompatibilities
set(SC_ABI_SOVERSION 2)
set(SC_ABI_VERSION ${SC_ABI_SOVERSION}.0.0)
# Minimum required version of CMake
cmake_minimum_required(VERSION 2.8.7)
if(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
if ("${CMAKE_VERSION}" VERSION_GREATER 2.99)
CMAKE_POLICY(SET CMP0026 OLD)
endif ("${CMAKE_VERSION}" VERSION_GREATER 2.99)
endif(COMMAND CMAKE_POLICY)
# Set language standards
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# CMake derives much of its functionality from modules, typically
# stored in one directory - let CMake know where to find them.
set(SC_CMAKE_DIR "${SC_SOURCE_DIR}/cmake")
if(NOT SC_IS_SUBBUILD)
set(CMAKE_MODULE_PATH "${SC_CMAKE_DIR};${CMAKE_MODULE_PATH}")
else(NOT SC_IS_SUBBUILD)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${SC_CMAKE_DIR}")
endif(NOT SC_IS_SUBBUILD)
list(APPEND CMAKE_MODULE_PATH "${SC_CMAKE_DIR}")
# testing and compilation options, build output dirs, install dirs, uninstall, package creation, etc
include(${SC_CMAKE_DIR}/SC_Build_opts.cmake)
# OpenBSD has its own naming conventions. Set a platform variable based on
# the OS name so we can test for it succinctly.
if ("${CMAKE_SYSTEM}" MATCHES ".*OpenBSD.*")
set(OPENBSD ON)
endif ("${CMAKE_SYSTEM}" MATCHES ".*OpenBSD.*")
#---------------------------------------------------------------------
# Set up various relative path variables and build output directories
include(Path_Setup)
#---------------------------------------------------------------------
# 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
if(NOT DEFINED CMAKE_SKIP_BUILD_RPATH)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
endif()
# when building, don't use the install RPATH already
# (but later on when installing)
if(NOT DEFINED CMAKE_BUILD_WITH_INSTALL_RPATH)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
endif()
# the RPATH/INSTALL_NAME_DIR to be used when installing
if (NOT APPLE)
if(NOT DEFINED CMAKE_INSTALL_RPATH)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:\$ORIGIN/../lib")
endif()
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
if(NOT DEFINED CMAKE_INSTALL_NAME_DIR)
set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
endif()
# add the automatically determined parts of the RPATH which point to
# directories outside the build tree to the install RPATH
if(NOT DEFINED CMAKE_INSTALL_RPATH_USE_LINK_PATH)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()
#---------------------------------------------------------------------
# Build options
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(BUILD_STATIC_LIBS "Build static libraries" OFF)
option(SC_PYTHON_GENERATOR "Compile exp2python" ON)
option(SC_CPP_GENERATOR "Compile exp2cxx" ON)
option(SC_TRACE_FPRINTF "Enable extra comments in generated code so the code's source in exp2cxx may be located" OFF)
option(SC_ENABLE_COVERAGE "Enable code coverage test" OFF)
if (SC_ENABLE_COVERAGE AND ${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
set(CMAKE_C_FLAGS_DEBUG "-O0 -g -fprofile-arcs -ftest-coverage" CACHE STRING "Extra compile flags required by code coverage" FORCE)
set(CMAKE_CXX_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)
endif (SC_ENABLE_COVERAGE AND ${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
option(SC_BUILD_EXPRESS_ONLY "Only build express parser." OFF)
mark_as_advanced(SC_BUILD_EXPRESS_ONLY)
option(SC_ENABLE_TESTING "Enable unittesting framework" OFF)
if(SC_ENABLE_TESTING)
if(NOT "${SC_BUILD_EXPRESS_ONLY}" AND NOT DEFINED SC_BUILD_SCHEMAS)
set(SC_BUILD_SCHEMAS "ALL") #test all schemas, unless otherwise specified
endif()
include(CTest)
endif(SC_ENABLE_TESTING)
# SC_ADDEXEC and SC_ADDLIB macros, dllimport/export, etc
include(${SC_CMAKE_DIR}/SC_Targets.cmake)
include(SC_Targets)
# Macros related to paths
include(${SC_CMAKE_DIR}/SC_Paths.cmake)
include(SC_Paths)
# locale stuff
include(${SC_CMAKE_DIR}/SC_Locale.cmake)
include(SC_Locale)
# logic related to regenerating the lexer and parser source code
include(${SC_CMAKE_DIR}/SC_Regenerate.cmake)
include(SC_Regenerate)
# create config.h header
include(SC_Config_Headers)
if(NOT DEFINED SC_SDAI_ADDITIONAL_EXES_SRCS)
set(SC_SDAI_ADDITIONAL_EXES_SRCS "" CACHE STRING "Source files for additional executables to be linked with SDAI libs")
endif(NOT DEFINED SC_SDAI_ADDITIONAL_EXES_SRCS)
if(NOT DEFINED SC_BUILD_SCHEMAS)
if(NOT "${SC_BUILD_EXPRESS_ONLY}" AND NOT DEFINED SC_BUILD_SCHEMAS)
list(APPEND CONFIG_END_MESSAGES
"** CMake variable SC_BUILD_SCHEMAS was not set. Defaults to building ALL schemas, which will take a"
" while; see http://stepcode.org/mw/index.php?title=STEPcode_CMake_variables#SC_BUILD_SCHEMAS")
#this makes SC_BUILD_SCHEMAS show up in cmake-gui
set(SC_BUILD_SCHEMAS "ALL" CACHE string "Semicolon-separated list of paths to EXPRESS schemas to be built")
endif(NOT DEFINED SC_BUILD_SCHEMAS)
"** Note: CMake variable SC_BUILD_SCHEMAS was not set - defaults to building ALL schemas")
# this makes SC_BUILD_SCHEMAS show up in cmake-gui
set(SC_BUILD_SCHEMAS "ALL" CACHE STRING "Semicolon-separated list of paths to EXPRESS schemas to be built")
endif()
if(NOT SC_IS_SUBBUILD)
list(APPEND CONFIG_END_MESSAGES
@@ -102,23 +173,14 @@ if(NOT SC_IS_SUBBUILD)
".. Generating step can take a while if you are building several schemas.")
endif(NOT SC_IS_SUBBUILD)
# create config headers sc_cf.h and sc_version_string.h
include(${SC_CMAKE_DIR}/SC_Config_Headers.cmake)
################
if(MSVC)
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__)
else()
endif()
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
add_definitions(-pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long)
if(HAVE_NULLPTR)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif(HAVE_NULLPTR)
endif()
include_directories(
@@ -126,7 +188,6 @@ include_directories(
${SC_BINARY_DIR}/include
)
add_subdirectory(src/base)
add_subdirectory(src/express)
add_subdirectory(src/exppp)
add_subdirectory(src/exp2cxx)
@@ -143,9 +204,19 @@ if(SC_ENABLE_TESTING)
endif(SC_ENABLE_TESTING)
add_subdirectory(doc)
# 'make core' builds everything that isn't generated. for devs.
add_custom_target(core)
add_dependencies(core stepdai check-express stepeditor exp2cxx)
if(NOT SC_IS_SUBBUILD)
#-----------------------------------------------------------------------------
# SC Packaging
# $make package
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "STEPcode")
set(CPACK_SET_DESTDIR "ON")
set(CPACK_PACKAGE_VERSION_MAJOR ${SC_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${SC_VERSION_MINOR})
set(CPACK_PACKAGE_NAME SC)
set(CPACK_PACKAGE_CONTACT "SC Developers <scl-dev@googlegroups.com>")
include(CPack)
endif(NOT SC_IS_SUBBUILD)
# CONFIG_END_MESSAGES - list of messages to be printed after everything else is done.
# THIS MUST BE LAST to ensure that they are visible to the user without scrolling.
+4 -1
View File
@@ -11,9 +11,12 @@ We love contributions!
* Encouraged but not enforced: each commit should stand alone, in the sense that the code should compile and run at that point.
* One major topic per pull request. Commits that fix small things (typos, formatting) are perfectly acceptable in a PR fixing a bug or adding a feature.
* Tests are good. Tests are required unless you're fixing something simple or that was obviously broken.
* Do not change EXPRESS schema definition without reference to an upstream change.
* Make your changes and push them to your GitHub repo
* Once your branch is pushed, submit a pull request.
* We'll look at the PR and either merge or add feedback. If there isn't any activity within several days, send a message to the mailing list - `scl-dev` AT `groups.google.com`.
- enable github option on each PR 'Allow edits from maintainers', refer to github help if necessary
* We'll look at the PR and either merge (possibly after rebase) or add feedback.
- If there isn't any activity within several days send a message to the mailing list - `scl-dev` AT `groups.google.com`.
## Coding Standards
+36 -97
View File
@@ -1,108 +1,47 @@
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).
STEPcode is provided as a collective work under the 3-clause BSD
license. As some portions are not subject to copyright in some
jurisdictions, see INTENT.md for additional details regarding intent
and history. See the AUTHORS file for a list of contributors and
copyright holders.
Code generated by STEPcode containing substantial parts of STEPcode
complex enough to have copyright protection are subject to the terms
of this license.
STEPcode acknowledgement and/or attribution is appreciated regardless
of license or copyright status.
Modifications which were first commited to the repository on github
are licensed under the 3-clause BSD license below. Changes committed
to BRL-CAD either contain license information mentioning BRL-CAD
near the top of the file, or are licensed under the same terms that
NIST used.
********************************************************************
3-clause BSD license:
3-Clause BSD License
********************************************************************
Copyright (c) <date committed>, <copyright holder>
Copyright (c) 2009-2019 STEPcode AUTHORS
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the <organization> nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
modification, are permitted provided that the following conditions are
met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
********************************************************************
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
********************************************************************
ORIGINAL NIST TEXT FOLLOWS
********************************************************************
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 redistribution.
Acknowledgements:
The STEP Class Library (SCL) was developed by the Manufacturing
Systems Integration Division at NIST 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 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 Information Infrastructure
Protocols Consortium and NIST's Systems Integration for Manufacturing
Applications (SIMA) program.
/* ********************************************************************
* D I S C L A I M E R
* (February 6, 1992)
*
* There is no warranty for the NIST PDES Toolkit.
* If the NIST PDES 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
* distributed.
*
* Policies
*
* 1. Anyone may copy and distribute verbatim copies of the NIST PDES Toolkit
* source code as received in any medium.
*
* 2. Anyone may modify your copy or copies of the NIST PDES 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.
*
* NO WARRANTY
* ===========
*
* NIST PROVIDES ABSOLUTELY NO WARRANTY. THE NIST PDES 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 PDES 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.
*/
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+102
View File
@@ -0,0 +1,102 @@
## Licensing Intent
The intent is that this software and documentation ("Project") should
be treated as if it is licensed under the license(s) associated with
the Project ("License") in the `COPYING` file. However, because some
contributors work for the United States (U.S.) Federal Government, it
is not that simple.
The portions of this Project written by United States (U.S.) federal
government employees within the scope of their federal employment are
ineligible for copyright protection in the U.S.; this is generally
understood to mean that these portions of the Project are placed in
the public domain.
In countries where copyright protection is available (which does not
include the U.S.), contributions made by U.S. Federal government
employees are released under the License. Merged contributions from
private contributors are released under the License.
## Background History
STEPcode was originally developed as the STEP Class Libraries (SCL) by
the U.S. National Institute of Standards and Technology (NIST). Prior
to 2009, the U.S. Army Research Laboratory and members of the BRL-CAD
open source community researched freely available open source options
for ISO 10303 STEP support. Development had ceased, no open source
community existed, the code was out of date in many regards, and
additional work was needed to become production-ready, but SCL was
found to be a usable reference implementation.
Consulting with NIST and others circa 2009, the BRL-CAD community
began efforts to take over SCL development, modernization, and code
enhancements. The BRL-CAD community purchased licenses for the ISO
10303 standard and began working to bring SCL up-to-date with the
latest specification. By 2011, significant progress had been made,
the project had garnered attention from others, and STEPcode was
establishd as an independent project.
## Original NIST License Text
This software was [originally] 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 redistribution.
Acknowledgements:
The STEP Class Library (SCL) was developed by the Manufacturing
Systems Integration Division at NIST 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 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 [circa 1992] were sponsored by the National Information Infrastructure
Protocols Consortium and NIST's Systems Integration for Manufacturing
Applications (SIMA) program.
~~~~
/* ********************************************************************
* D I S C L A I M E R
* (February 6, 1992)
*
* There is no warranty for the NIST PDES Toolkit.
* If the NIST PDES 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
* distributed.
*
* Policies
*
* 1. Anyone may copy and distribute verbatim copies of the NIST PDES Toolkit
* source code as received in any medium.
*
* 2. Anyone may modify your copy or copies of the NIST PDES 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.
*
* NO WARRANTY
* ===========
*
* NIST PROVIDES ABSOLUTELY NO WARRANTY. THE NIST PDES 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 PDES 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.
*/
~~~~
+8 -5
View File
@@ -1,5 +1,8 @@
STEPcode -- http://github.com/stepcode/stepcode -- http://stepcode.org
************************************************************************
STEPcode
http://github.com/stepcode/stepcode
************************************************************************
Release 0.8 (December, 2014)
New since v0.7:
@@ -176,7 +179,7 @@ There were also some issues with the configure script and some
makefiles which are addressed, as well as a new macro that is at
least required for gcc.
Remaing problem: The p21 file scanner of SCL currently
Remaining problem: The p21 file scanner of SCL currently
does not allow for comments within the parameter list of
data records. Only comments outside of data records are
accepted.
@@ -252,7 +255,7 @@ the TD for label.
- Fixed the casting operator for the class representing EXPRESS
enumeration types. It was returning the last element of the enum type
as the the default when the enum was unset. This choice predated enums
as the default when the enum was unset. This choice predated enums
having an unset enum value. It now returns <enum_name>_unset as the
default when the enum is unset.
@@ -794,7 +797,7 @@ When this case of multiple inheritance is encountered attributes are
duplicated. This case of multiple inheritance may possibly be
avoided by modifying the EXPRESS schema by breaking some links in the
inheritance hierarchy. This will not have an adverse affect on the
implemementation. The user may choose to use the current or previous
implementation. The user may choose to use the current or previous
method of handling multiple inheritance. The current method is the
default behavior. The previous method is obtained by supplying the
-s (or -S) option with the exp2cxx code generator or the mkProbe
@@ -987,7 +990,7 @@ the attribute value field in the entity editor.
If there wasn't a value in the attribute previously, then the field will
contain just the type specifier, e.g., Str1() if Str1 is the type selected.
If a value exists in the field, it is modified to accomodate the new
If a value exists in the field, it is modified to accommodate the new
specifier. This means the following:
o If the value in the field starts with a single-quote ('), it is
assumed to be a string literal, and is completely wrapped in the new
+2 -5
View File
@@ -1,10 +1,7 @@
Travis-CI | AppVeyor CI
:-------------:|:---------------:
Linux, OSX (LLVM) | Windows (MSVC)
[![Build Status](https://travis-ci.org/stepcode/stepcode.svg?branch=master)](https://travis-ci.org/stepcode/stepcode) | [![Build status](https://ci.appveyor.com/api/projects/status/3fbr9t9gfa812oqu?svg=true)](https://ci.appveyor.com/project/mpictor/stepcode)
![Build Status](https://github.com/stepcode/stepcode/actions/workflows/build.yml/badge.svg?branch=develop)
***********************************************************************
STEPcode v0.8 -- stepcode.org, github.com/stepcode/stepcode
STEPcode v0.8 -- github.com/stepcode/stepcode
* What is STEPcode? SC reads ISO10303-11 EXPRESS schemas and generates
C++ source code that can read and write Part 21 files conforming
-1
View File
@@ -1 +0,0 @@
0.8
+125 -147
View File
@@ -47,158 +47,136 @@
find_program(LEMON_EXECUTABLE lemon DOC "path to the lemon executable")
mark_as_advanced(LEMON_EXECUTABLE)
if (LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
# look for the template in share
if (DATA_DIR AND EXISTS "${DATA_DIR}/lemon/lempar.c")
set (LEMON_TEMPLATE "${DATA_DIR}/lemon/lempar.c")
elseif (EXISTS "share/lemon/lempar.c")
set (LEMON_TEMPLATE "share/lemon/lempar.c")
elseif (EXISTS "/usr/share/lemon/lempar.c")
set (LEMON_TEMPLATE "/usr/share/lemon/lempar.c")
endif (DATA_DIR AND EXISTS "${DATA_DIR}/lemon/lempar.c")
endif (LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
if (LEMON_EXECUTABLE)
if(NOT LEMON_TEMPLATE)
# look for the template, if we've not already been told where it is
if (DATA_DIR AND EXISTS "${DATA_DIR}/lemon/lempar.c")
find_file(LEMON_TEMPLATE lempar.c
PATHS "${DATA_DIR}/lemon/lempar.c"
NO_DEFAULT_PATH)
endif ()
if (LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
# look for the template in bin dir
get_filename_component(lemon_path ${LEMON_EXECUTABLE} PATH)
if (lemon_path)
if (EXISTS ${lemon_path}/lempar.c)
set (LEMON_TEMPLATE "${lemon_path}/lempar.c")
endif (EXISTS ${lemon_path}/lempar.c)
if (EXISTS /usr/share/lemon/lempar.c)
set (LEMON_TEMPLATE "/usr/share/lemon/lempar.c")
endif (EXISTS /usr/share/lemon/lempar.c)
endif (lemon_path)
endif(LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
# If the above did not succeed, check standard locations
get_filename_component(lemon_dir ${LEMON_EXECUTABLE} DIRECTORY)
find_file(LEMON_TEMPLATE lempar.c
PATHS "${lemon_dir}" "/usr/share/lemon"
NO_DEFAULT_PATH)
mark_as_advanced(LEMON_TEMPLATE)
endif()
if (LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
# fallback
set (LEMON_TEMPLATE "lempar.c")
if (NOT EXISTS ${LEMON_TEMPLATE})
message(WARNING "Lemon's lempar.c template file could not be found automatically, set LEMON_TEMPLATE")
endif (NOT EXISTS ${LEMON_TEMPLATE})
endif (LEMON_EXECUTABLE AND NOT LEMON_TEMPLATE)
# We need a template to be able to use lemon correctly
if(NOT LEMON_TEMPLATE)
message(FATAL_ERROR "Failed to find lemon template file (lempar.c) - need to set LEMON_TEMPLATE")
endif()
mark_as_advanced(LEMON_TEMPLATE)
# Define the function
# LEMON_TARGET(<Name> <LemonInput> <LemonSource> <LemonHeader>
# [<ArgString>])
# which will create a custom rule to generate a parser. <LemonInput> is
# the path to a lemon file. <LemonSource> is the desired name for the
# generated source file. <LemonHeader> is the desired name for the
# generated header which contains the token list. Anything in the optional
# <ArgString> parameter is appended to the lemon command line.
#
# ====================================================================
# Example:
#
# find_package(LEMON)
# LEMON_TARGET(MyParser parser.y parser.c parser.h)
# add_executable(Foo main.cpp ${LEMON_MyParser_OUTPUTS})
# ====================================================================
include(CMakeParseArguments)
if(NOT COMMAND LEMON_TARGET)
function(LEMON_TARGET Name LemonInput LemonOutput)
set(LT_ARGS DEFINES_FILE COMPILE_FLAGS)
cmake_parse_arguments(LEMON_TARGET_ARG "" "${LT_ARGS}" "" ${ARGN})
if(NOT "${LEMON_TARGET_ARG_COMPILE_FLAGS}" STREQUAL "")
set(LEMON_EXECUTABLE_opts "${LEMON_TARGET_ARG_COMPILE_FLAGS}")
separate_arguments(LEMON_EXECUTABLE_opts)
else()
set(LEMON_EXECUTABLE_opts "")
endif()
# check for LemonOutput
get_filename_component(_basename ${LemonOutput} NAME_WE)
get_filename_component(_out_src_file ${LemonOutput} NAME)
get_filename_component(_out_dir ${LemonOutput} PATH)
if(NOT "${_out_dir}" STREQUAL "")
message(WARNING "Full path specified for LemonOutput - should be filename only")
endif()
# set report file
set(_out_rpt_file "${_basename}.out")
# check for DEFINES_FILE
if ("${LEMON_TARGET_ARG_DEFINES_FILE}" STREQUAL "")
set(_out_hdr_file "${_basename}.h")
else()
get_filename_component(_out_dir ${LEMON_TARGET_ARG_DEFINES_FILE} PATH)
get_filename_component(_out_hdr_file ${LEMON_TARGET_ARG_DEFINES_FILE} NAME)
if(NOT "${_out_dir}" STREQUAL "")
message(WARNING "Full path specified for DEFINES_FILE - should be filename only")
endif()
endif()
# input file
get_filename_component(_in_y_path ${LemonInput} ABSOLUTE)
get_filename_component(_in_y_file ${LemonInput} NAME)
# Stage the source file in the binary directory for lemon. We need to make
# sure it's fully copied, so use a sentinel guard
add_custom_command(
OUTPUT ${_in_y_file}
COMMAND ${CMAKE_COMMAND} -E copy ${_in_y_path} ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_in_y_file}.sentinel
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/${_in_y_file}.sentinel
DEPENDS ${_in_y_file}
)
add_custom_target(${Name}_input_cpy DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_in_y_file}.sentinel)
# execute lemon
add_custom_command(
OUTPUT ${_out_src_file} ${_basename}.h
COMMAND ${LEMON_EXECUTABLE} -T${LEMON_TEMPLATE} ${LEMON_EXECUTABLE_opts} ${_in_y_file}
DEPENDS ${Name}_input_cpy
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "[LEMON][${Name}] Building parser with ${LEMON_EXECUTABLE}"
)
# rename the header
add_custom_command(
OUTPUT ${_out_hdr_file}
COMMAND ${CMAKE_COMMAND} ARGS -E rename ${_basename}.h ${_out_hdr_file}
DEPENDS ${_out_src_file} ${_basename}.h
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
# set the return values
# TODO: for generated sources even headers should be target dependencies
set(LEMON_${Name}_DEFINED TRUE PARENT_SCOPE)
set(LEMON_${Name}_OUTPUT_HEADER "${CMAKE_CURRENT_BINARY_DIR}/${_out_hdr_file}" PARENT_SCOPE)
set(LEMON_${Name}_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
set(LEMON_${Name}_OUTPUTS "${_out_src_file}" PARENT_SCOPE)
# TODO - remove once perplex goes away...
add_custom_target(${Name} DEPENDS ${_out_hdr_file})
# make sure we clean up generated output and copied input
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_out_src_file}")
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/${_in_y_file}")
endfunction(LEMON_TARGET)
endif(NOT COMMAND LEMON_TARGET)
endif(LEMON_EXECUTABLE)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LEMON DEFAULT_MSG LEMON_EXECUTABLE LEMON_TEMPLATE)
# Define the macro
# LEMON_TARGET(<Name> <LemonInput> <LemonSource> <LemonHeader>
# [<ArgString>])
# which will create a custom rule to generate a parser. <LemonInput> is
# the path to a lemon file. <LemonSource> is the desired name for the
# generated source file. <LemonHeader> is the desired name for the
# generated header which contains the token list. Anything in the optional
# <ArgString> parameter is appended to the lemon command line.
#
# ====================================================================
# Example:
#
# find_package(LEMON)
# LEMON_TARGET(MyParser parser.y parser.c parser.h)
# add_executable(Foo main.cpp ${LEMON_MyParser_OUTPUTS})
# ====================================================================
include(CMakeParseArguments)
if(NOT COMMAND LEMON_TARGET)
macro(LEMON_TARGET Name Input)
get_filename_component(IN_FILE_WE ${Input} NAME_WE)
set(LVAR_PREFIX ${Name}_${IN_FILE_WE})
if(${ARGC} GREATER 3)
CMAKE_PARSE_ARGUMENTS(${LVAR_PREFIX} "" "OUT_SRC_FILE;OUT_HDR_FILE;WORKING_DIR;EXTRA_ARGS" "" ${ARGN})
endif(${ARGC} GREATER 3)
# Need a working directory
if("${${LVAR_PREFIX}_WORKING_DIR}" STREQUAL "")
set(${LVAR_PREFIX}_WORKING_DIR "${CMAKE_CURRENT_BINARY_DIR}/${LVAR_PREFIX}")
endif("${${LVAR_PREFIX}_WORKING_DIR}" STREQUAL "")
file(MAKE_DIRECTORY ${${LVAR_PREFIX}_WORKING_DIR})
# Output source file
if ("${${LVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "")
set(${LVAR_PREFIX}_OUT_SRC_FILE ${${LVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.c)
else ("${${LVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "")
get_filename_component(specified_out_dir ${${LVAR_PREFIX}_OUT_SRC_FILE} PATH)
if(NOT "${specified_out_dir}" STREQUAL "")
message(FATAL_ERROR "\nFull path specified for OUT_SRC_FILE - should be filename only.\n")
endif(NOT "${specified_out_dir}" STREQUAL "")
set(${LVAR_PREFIX}_OUT_SRC_FILE ${${LVAR_PREFIX}_WORKING_DIR}/${${LVAR_PREFIX}_OUT_SRC_FILE})
endif ("${${LVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "")
# Output header file
if ("${${LVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "")
set(${LVAR_PREFIX}_OUT_HDR_FILE ${${LVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.h)
else ("${${LVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "")
get_filename_component(specified_out_dir ${${LVAR_PREFIX}_OUT_HDR_FILE} PATH)
if(NOT "${specified_out_dir}" STREQUAL "")
message(FATAL_ERROR "\nFull path specified for OUT_HDR_FILE - should be filename only.\n")
endif(NOT "${specified_out_dir}" STREQUAL "")
set(${LVAR_PREFIX}_OUT_HDR_FILE ${${LVAR_PREFIX}_WORKING_DIR}/${${LVAR_PREFIX}_OUT_HDR_FILE})
endif ("${${LVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "")
# input file
get_filename_component(in_full ${Input} ABSOLUTE)
if("${in_full}" STREQUAL "${Input}")
set(lemon_in_file ${Input})
else("${in_full}" STREQUAL "${Input}")
set(lemon_in_file "${CMAKE_CURRENT_SOURCE_DIR}/${Input}")
endif("${in_full}" STREQUAL "${Input}")
# names of lemon output files will be based on the name of the input file
set(LEMON_GEN_SOURCE ${${LVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.c)
set(LEMON_GEN_HEADER ${${LVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.h)
set(LEMON_GEN_OUT ${${LVAR_PREFIX}_WORKING_DIR}/${IN_FILE_WE}.out)
# copy input to bin directory and run lemon
get_filename_component(INPUT_NAME ${Input} NAME)
add_custom_command(
OUTPUT ${LEMON_GEN_OUT} ${LEMON_GEN_SOURCE} ${LEMON_GEN_HEADER}
COMMAND ${CMAKE_COMMAND} -E copy ${lemon_in_file} ${${LVAR_PREFIX}_WORKING_DIR}/${INPUT_NAME}
COMMAND ${LEMON_EXECUTABLE} -T${LEMON_TEMPLATE} ${${LVAR_PREFIX}_WORKING_DIR}/${INPUT_NAME} ${${LVAR_PREFIX}__EXTRA_ARGS}
DEPENDS ${Input} ${LEMON_TEMPLATE} ${LEMON_EXECUTABLE_TARGET}
WORKING_DIRECTORY ${${LVAR_PREFIX}_WORKING_DIR}
COMMENT "[LEMON][${Name}] Building parser with ${LEMON_EXECUTABLE}"
)
# rename generated outputs
if(NOT "${${LVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "${LEMON_GEN_SOURCE}")
add_custom_command(
OUTPUT ${${LVAR_PREFIX}_OUT_SRC_FILE}
COMMAND ${CMAKE_COMMAND} -E copy ${LEMON_GEN_SOURCE} ${${LVAR_PREFIX}_OUT_SRC_FILE}
DEPENDS ${LemonInput} ${LEMON_EXECUTABLE_TARGET} ${LEMON_GEN_SOURCE}
)
set(LEMON_${Name}_OUTPUTS ${${LVAR_PREFIX}_OUT_SRC_FILE} ${LEMON_${Name}_OUTPUTS})
endif(NOT "${${LVAR_PREFIX}_OUT_SRC_FILE}" STREQUAL "${LEMON_GEN_SOURCE}")
if(NOT "${${LVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "${LEMON_GEN_HEADER}")
add_custom_command(
OUTPUT ${${LVAR_PREFIX}_OUT_HDR_FILE}
COMMAND ${CMAKE_COMMAND} -E copy ${LEMON_GEN_HEADER} ${${LVAR_PREFIX}_OUT_HDR_FILE}
DEPENDS ${LemonInput} ${LEMON_EXECUTABLE_TARGET} ${LEMON_GEN_HEADER}
)
set(LEMON_${Name}_OUTPUTS ${${LVAR_PREFIX}_OUT_HDR_FILE} ${LEMON_${Name}_OUTPUTS})
endif(NOT "${${LVAR_PREFIX}_OUT_HDR_FILE}" STREQUAL "${LEMON_GEN_HEADER}")
set(LEMON_${Name}_OUTPUTS ${LEMON_${Name}_OUTPUTS} ${LEMON_GEN_OUT})
# make sure we clean up generated output and copied input
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${LEMON_${Name}_OUTPUTS}")
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${${LVAR_PREFIX}_WORKING_DIR}/${INPUT_NAME}")
# macro ran successfully
set(LEMON_${Name}_DEFINED TRUE)
set(LEMON_${Name}_SRC ${${LVAR_PREFIX}_OUT_SRC_FILE})
set(LEMON_${Name}_HDR ${${LVAR_PREFIX}_OUT_HDR_FILE})
set(LEMON_${Name}_INCLUDE_DIR ${${LVAR_PREFIX}_WORKING_DIR})
endmacro(LEMON_TARGET)
endif(NOT COMMAND LEMON_TARGET)
find_package_handle_standard_args(LEMON REQUIRED_VARS LEMON_EXECUTABLE LEMON_TEMPLATE)
#============================================================
# FindLEMON.cmake ends here
+10 -2
View File
@@ -227,6 +227,14 @@ if(NOT COMMAND PERPLEX_TARGET)
set(PERPLEX_${Name}_SRC ${${PVAR_PREFIX}_OUT_SRC_FILE})
set(PERPLEX_${Name}_HDR ${${PVAR_PREFIX}_OUT_HDR_FILE})
set(PERPLEX_${Name}_INCLUDE_DIR ${${PVAR_PREFIX}_WORKING_DIR})
add_custom_command(
OUTPUT ${${PVAR_PREFIX}_WORKING_DIR}/${Name}.sentinel
COMMAND ${CMAKE_COMMAND} -E touch ${${PVAR_PREFIX}_WORKING_DIR}/${Name}.sentinel
DEPENDS ${${PVAR_PREFIX}_OUT_SRC_FILE} ${${PVAR_PREFIX}_OUT_HDR_FILE}
)
add_custom_target(${Name} DEPENDS ${${PVAR_PREFIX}_WORKING_DIR}/${Name}.sentinel)
endmacro(PERPLEX_TARGET)
endif(NOT COMMAND PERPLEX_TARGET)
@@ -240,12 +248,12 @@ if(NOT COMMAND ADD_PERPLEX_LEMON_DEPENDENCY)
message(SEND_ERROR "PERPLEX target `${PERPLEXTarget}' does not exists.")
endif()
if(NOT LEMON_${LemonTarget}_HDR)
if(NOT TARGET ${LemonTarget})
message(SEND_ERROR "Lemon target `${LemonTarget}' does not exists.")
endif()
set_source_files_properties(${PERPLEX_${PERPLEXTarget}_SRC}
PROPERTIES OBJECT_DEPENDS ${LEMON_${LemonTarget}_HDR})
PROPERTIES OBJECT_DEPENDS ${LEMON_${LemonTarget}_OUTPUT_HEADER})
endmacro(ADD_PERPLEX_LEMON_DEPENDENCY)
endif(NOT COMMAND ADD_PERPLEX_LEMON_DEPENDENCY)
+145 -116
View File
@@ -6,134 +6,163 @@
find_program(RE2C_EXECUTABLE re2c DOC "path to the re2c executable")
mark_as_advanced(RE2C_EXECUTABLE)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(RE2C DEFAULT_MSG RE2C_EXECUTABLE)
if(RE2C_EXECUTABLE)
# Provide a macro to generate custom build rules:
execute_process(COMMAND ${RE2C_EXECUTABLE} -v
OUTPUT_VARIABLE RE2C_version_output
ERROR_VARIABLE RE2C_version_error
RESULT_VARIABLE RE2C_version_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
# RE2C_TARGET(Name RE2CInput RE2COutput [COMPILE_FLAGS <string>])
# which creates a custom command to generate the <RE2COutput> file from
# the <RE2CInput> file. If COMPILE_FLAGS option is specified, the next
# parameter is added to the re2c command line. Name is an alias used to
# get details of this custom command.
if(NOT ${RE2C_version_result} EQUAL 0)
message(SEND_ERROR
"Command \"${RE2C_EXECUTABLE} -v\" failed with output:\n${RE2C_version_output}\n${RE2C_version_error}")
else()
string(REGEX REPLACE "^re2c ([0-9]+[^ ]*)( .*)?$" "\\1" RE2C_VERSION "${RE2C_version_output}")
endif()
# This module also defines a macro:
# ADD_RE2C_LEMON_DEPENDENCY(RE2CTarget LemonTarget)
# which adds the required dependency between a scanner and a parser
# where <RE2CTarget> and <LemonTarget> are the first parameters of
# respectively RE2C_TARGET and LEMON_TARGET macros.
#
# ====================================================================
# Example:
#
# find_package(LEMON)
# find_package(RE2C)
#
# LEMON_TARGET(MyParser parser.y "${CMAKE_CURRENT_BINARY_DIR}/parser.cpp")
# RE2C_TARGET(MyScanner scanner.re "${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp")
# ADD_RE2C_LEMON_DEPENDENCY(MyScanner MyParser)
#
# include_directories("${CMAKE_CURRENT_BINARY_DIR}")
# add_executable(Foo
# Foo.cc
# ${LEMON_MyParser_OUTPUTS}
# ${RE2C_MyScanner_OUTPUTS}
# )
# ====================================================================
#
#=============================================================================
# Copyright (c) 2010-2016 United States Government as represented by
# the U.S. Army Research Laboratory.
# Copyright 2009 Kitware, Inc.
# Copyright 2006 Tristan Carel
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * The names of the authors may not be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
# Provide a macro to generate custom build rules:
#============================================================
# RE2C_TARGET (public macro)
#============================================================
#
# TODO - rework this macro to make use of CMakeParseArguments, see
# http://www.cmake.org/pipermail/cmake/2012-July/051309.html
if(NOT COMMAND RE2C_TARGET)
macro(RE2C_TARGET Name Input Output)
set(RE2C_TARGET_usage "RE2C_TARGET(<Name> <Input> <Output> [COMPILE_FLAGS <string>]")
if(${ARGC} GREATER 3)
if(${ARGC} EQUAL 5)
if("${ARGV3}" STREQUAL "COMPILE_FLAGS")
set(RE2C_EXECUTABLE_opts "${ARGV4}")
SEPARATE_ARGUMENTS(RE2C_EXECUTABLE_opts)
else()
message(SEND_ERROR ${RE2C_TARGET_usage})
endif()
# RE2C_TARGET(Name RE2CInput RE2COutput [COMPILE_FLAGS <string>])
# which creates a custom command to generate the <RE2COutput> file from
# the <RE2CInput> file. If COMPILE_FLAGS option is specified, the next
# parameter is added to the re2c command line. Name is an alias used to
# get details of this custom command.
# This module also defines a macro:
# ADD_RE2C_LEMON_DEPENDENCY(RE2CTarget LemonTarget)
# which adds the required dependency between a scanner and a parser
# where <RE2CTarget> and <LemonTarget> are the first parameters of
# respectively RE2C_TARGET and LEMON_TARGET macros.
#
# ====================================================================
# Example:
#
# find_package(LEMON)
# find_package(RE2C)
#
# LEMON_TARGET(MyParser parser.y "${CMAKE_CURRENT_BINARY_DIR}/parser.cpp")
# RE2C_TARGET(MyScanner scanner.re "${CMAKE_CURRENT_BINARY_DIR}/scanner.cpp")
# ADD_RE2C_LEMON_DEPENDENCY(MyScanner MyParser)
#
# include_directories("${CMAKE_CURRENT_BINARY_DIR}")
# add_executable(Foo
# Foo.cc
# ${LEMON_MyParser_OUTPUTS}
# ${RE2C_MyScanner_OUTPUTS}
# )
# ====================================================================
#
#=============================================================================
# Copyright (c) 2010-2016 United States Government as represented by
# the U.S. Army Research Laboratory.
# Copyright 2009 Kitware, Inc.
# Copyright 2006 Tristan Carel
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * The names of the authors may not be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
#============================================================
# RE2C_TARGET (public macro)
#============================================================
#
if(NOT COMMAND RE2C_TARGET)
function(RE2C_TARGET Name RE2CInput RE2COutput)
set(_re2c_args COMPILE_FLAGS DEFINES_FILE)
cmake_parse_arguments(RE2C_TARGET_ARG "" "${_re2c_args}" "" ${ARGN})
if(NOT "${RE2C_TARGET_ARG_UNPARSED_ARGUMENTS}" STREQUAL "")
message(SEND_ERROR "RE2C_TARGET(<Name> <RE2CInput> <RE2COutput>
[COMPILE_FLAGS <string>]
[DEFINES_FILE <string>])")
else()
message(SEND_ERROR ${RE2C_TARGET_usage})
if(NOT "${RE2C_TARGET_ARG_COMPILE_FLAGS}" STREQUAL "")
set(RE2C_EXECUTABLE_opts "${RE2C_TARGET_ARG_COMPILE_FLAGS}")
separate_arguments(RE2C_EXECUTABLE_opts)
else()
set(RE2C_EXECUTABLE_opts "")
endif()
if(NOT "${RE2C_TARGET_ARG_DEFINES_FILE}" STREQUAL "")
list(APPEND RE2C_EXECUTABLE_opts -t ${RE2C_TARGET_ARG_DEFINES_FILE})
endif()
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${RE2COutput}
COMMAND ${RE2C_EXECUTABLE}
ARGS ${RE2C_EXECUTABLE_opts} -o ${RE2COutput} ${CMAKE_CURRENT_SOURCE_DIR}/${RE2CInput}
DEPENDS ${RE2CInput}
COMMENT "[RE2C][${Name}] Building scanner with ${RE2C_EXECUTABLE}"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
# TODO: check, for generated sources headers should be included in outputs
set(RE2C_${Name}_DEFINED TRUE PARENT_SCOPE)
set(RE2C_${Name}_OUTPUTS ${RE2COutput} PARENT_SCOPE)
if("${RE2C_TARGET_ARG_DEFINES_FILE}" STREQUAL "")
set(RE2C_${Name}_OUTPUT_HEADER "" PARENT_SCOPE)
else()
set(RE2C_${Name}_OUTPUT_HEADER "${RE2C_TARGET_ARG_DEFINES_FILE}" PARENT_SCOPE)
endif()
set(RE2C_${Name}_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}" PARENT_SCOPE)
endif()
endif()
add_custom_command(OUTPUT ${Output}
COMMAND ${RE2C_EXECUTABLE}
ARGS ${RE2C_EXECUTABLE_opts} -o${Output} ${Input}
DEPENDS ${Input} ${RE2C_EXECUTABLE_TARGET}
COMMENT "[RE2C][${Name}] Building scanner with ${RE2C_EXECUTABLE}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
endfunction(RE2C_TARGET)
endif(NOT COMMAND RE2C_TARGET)
#============================================================
set(RE2C_${Name}_DEFINED TRUE)
set(RE2C_${Name}_OUTPUTS ${Output})
set(RE2C_${Name}_INPUT ${Input})
set(RE2C_${Name}_COMPILE_FLAGS ${RE2C_EXECUTABLE_opts})
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${Output}")
endmacro(RE2C_TARGET)
endif(NOT COMMAND RE2C_TARGET)
#============================================================
#============================================================
# ADD_RE2C_LEMON_DEPENDENCY (public macro)
#============================================================
#
if(NOT COMMAND ADD_RE2C_LEMON_DEPENDENCY)
function(ADD_RE2C_LEMON_DEPENDENCY RE2CTarget LemonTarget)
#============================================================
# ADD_RE2C_LEMON_DEPENDENCY (public macro)
#============================================================
#
if(NOT COMMAND ADD_RE2C_LEMON_DEPENDENCY)
macro(ADD_RE2C_LEMON_DEPENDENCY RE2CTarget LemonTarget)
if(NOT RE2C_${RE2CTarget}_OUTPUTS)
message(SEND_ERROR "RE2C target `${RE2CTarget}' does not exists.")
endif()
if(NOT RE2C_${RE2CTarget}_OUTPUTS)
message(SEND_ERROR "RE2C target `${RE2CTarget}' does not exists.")
endif()
if(NOT LEMON_${LemonTarget}_OUTPUT_HEADER)
message(SEND_ERROR "Lemon target `${LemonTarget}' does not exists.")
endif()
if(NOT LEMON_${LemonTarget}_HDR)
message(SEND_ERROR "Lemon target `${LemonTarget}' does not exists.")
endif()
set_source_files_properties(${RE2C_${RE2CTarget}_OUTPUTS}
PROPERTIES OBJECT_DEPENDS ${LEMON_${LemonTarget}_OUTPUT_HEADER})
endfunction(ADD_RE2C_LEMON_DEPENDENCY)
endif(NOT COMMAND ADD_RE2C_LEMON_DEPENDENCY)
#============================================================
set_source_files_properties(${RE2C_${RE2CTarget}_OUTPUTS}
PROPERTIES OBJECT_DEPENDS ${LEMON_${LemonTarget}_HDR})
endmacro(ADD_RE2C_LEMON_DEPENDENCY)
endif(NOT COMMAND ADD_RE2C_LEMON_DEPENDENCY)
#============================================================
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(RE2C REQUIRED_VARS RE2C_EXECUTABLE
VERSION_VAR RE2C_VERSION)
# RE2C_Util.cmake ends here
-67
View File
@@ -1,67 +0,0 @@
# Utility routines for managing generated files with CMake
macro(MD5 filename md5sum)
file(READ "${filename}" RAW_MD5_FILE)
string(REGEX REPLACE "\r" "" STRIPPED_MD5_FILE "${RAW_MD5_FILE}")
string(MD5 ${md5sum} "${STRIPPED_MD5_FILE}")
endmacro(MD5)
macro(FILEVAR filename var)
string(REGEX REPLACE "[^a-zA-Z0-9]" "_" ${var} ${filename})
endmacro(FILEVAR)
macro(VERIFY_FILES filelist warn resultvar)
set(${resultvar} 1)
foreach(fileitem ${filelist})
# Deal with absolute and relative paths a bit differently
get_filename_component(ITEM_ABS_PATH "${fileitem}" ABSOLUTE)
if("${fileitem}" STREQUAL "${ITEM_ABS_PATH}")
set(filefullname "${fileitem}")
else("${fileitem}" STREQUAL "${ITEM_ABS_PATH}")
set(filefullname "${CURRENT_SOURCE_DIR}/${fileitem}")
endif("${fileitem}" STREQUAL "${ITEM_ABS_PATH}")
get_filename_component(filename "${fileitem}" NAME)
# Got filename components sorted - proceed
if(NOT EXISTS ${filefullname})
message(FATAL_ERROR "Attempted to verify non-existant file ${filefullname}")
endif(NOT EXISTS ${filefullname})
FILEVAR(${filename} filevar)
if(NOT baseline_${filevar}_md5)
message(FATAL_ERROR "No baseline MD5 available for ${filename} - baseline_${filevar}_md5 is not defined")
endif(NOT baseline_${filevar}_md5)
MD5(${filefullname} ${filevar}_md5)
if(NOT "${${filevar}_md5}" STREQUAL "${baseline_${filevar}_md5}")
if("${warn}" STREQUAL "1")
message("\n${filename} differs from baseline: baseline md5 hash is ${baseline_${filevar}_md5} and current hash is ${${filevar}_md5}\n")
endif("${warn}" STREQUAL "1")
set(${resultvar} 0)
endif(NOT "${${filevar}_md5}" STREQUAL "${baseline_${filevar}_md5}")
endforeach(fileitem ${filelist})
endmacro(VERIFY_FILES filelist resultvar)
macro(WRITE_MD5_SUMS filelist outfile)
foreach(fileitem ${filelist})
# Deal with absolute and relative paths a bit differently
get_filename_component(ITEM_ABS_PATH "${fileitem}" ABSOLUTE)
if("${fileitem}" STREQUAL "${ITEM_ABS_PATH}")
set(filefullname "${fileitem}")
else("${fileitem}" STREQUAL "${ITEM_ABS_PATH}")
set(filefullname "${CURRENT_SOURCE_DIR}/${fileitem}")
endif("${fileitem}" STREQUAL "${ITEM_ABS_PATH}")
get_filename_component(filename "${fileitem}" NAME)
# Got filename components sorted - proceed
if(NOT EXISTS ${filefullname})
message(FATAL_ERROR "Attempted to get MD5 sum of non-existant file ${filefullname}")
endif(NOT EXISTS ${filefullname})
FILEVAR(${filename} filevar)
MD5(${filefullname} ${filevar}_md5)
file(APPEND ${outfile} "set(baseline_${filevar}_md5 ${${filevar}_md5})\n")
endforeach(fileitem ${filelist})
endmacro(WRITE_MD5_SUMS)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+164
View File
@@ -0,0 +1,164 @@
# Copyright (c) 2010-2020 United States Government as represented by
# the U.S. Army Research Laboratory.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
#
# 3. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#---------------------------------------------------------------------
# Define relative install locations. Don't set these if they have already
# been set by some other means (like a higher level CMakeLists.txt file
# including this one).
# The location in which to install BRL-CAD executables.
if(NOT BIN_DIR)
set(BIN_DIR bin)
endif(NOT BIN_DIR)
# Define a relative path that will "reset" a path back to
# the point before BIN_DIR was appended. This is primarily
# useful when working with generator expressions
unset(RBIN_DIR CACHE)
set(LBIN_DIR "${BIN_DIR}")
while (NOT "${LBIN_DIR}" STREQUAL "")
get_filename_component(LBDIR "${LBIN_DIR}" DIRECTORY)
set(LBIN_DIR "${LBDIR}")
if ("${RBIN_DIR}" STREQUAL "")
set(RBIN_DIR "..")
else ("${RBIN_DIR}" STREQUAL "")
set(RBIN_DIR "../${RBIN_DIR}")
endif ("${RBIN_DIR}" STREQUAL "")
endwhile (NOT "${LBIN_DIR}" STREQUAL "")
# The location in which to install BRL-CAD libraries.
if(NOT LIB_DIR)
set(LIB_DIR lib)
endif(NOT LIB_DIR)
if(NOT LIBEXEC_DIR)
set(LIBEXEC_DIR libexec)
endif(NOT LIBEXEC_DIR)
# The location in which to install BRL-CAD header files.
if(NOT INCLUDE_DIR)
set(INCLUDE_DIR include)
endif(NOT INCLUDE_DIR)
# The location in which to install BRL-CAD data files
if(NOT DATA_DIR)
set(DATA_DIR share)
endif(NOT DATA_DIR)
# The location in which to install BRL-CAD documentation files
if(NOT DOC_DIR)
set(DOC_DIR ${DATA_DIR}/doc)
endif(NOT DOC_DIR)
# The location in which to install BRL-CAD Manual pages
if(NOT MAN_DIR)
set(MAN_DIR ${DATA_DIR}/man)
endif(NOT MAN_DIR)
# Make sure no absolute paths have been supplied to these variables
set(INSTALL_DIRS BIN INCLUDE LIB LIBEXEC DATA MAN DOC)
foreach(instdir ${INSTALL_DIRS})
get_filename_component(instdir_full ${${instdir}_DIR} ABSOLUTE)
if("${${instdir}_DIR}" STREQUAL "${instdir_full}")
message(FATAL_ERROR "Error - absolute path supplied for ${instdir}_DIR. This path must be relative - e.g. \"bin\" instead of \"/usr/bin\"")
set(HAVE_INSTALL_DIR_FULL_PATH 1)
endif("${${instdir}_DIR}" STREQUAL "${instdir_full}")
endforeach(instdir ${INSTALL_DIRS})
#---------------------------------------------------------------------
# Output directories - this is where built library and executable
# files will be placed after building but prior to install. The
# necessary variables change between single and multi configuration
# build systems, so it is necessary to handle both cases on a
# conditional basis.
if(NOT CMAKE_CONFIGURATION_TYPES)
# If we're not doing multi-configuration, just set the three main
# variables to the correct values.
if(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${${PROJECT_NAME}_BINARY_DIR}/${LIB_DIR} CACHE INTERNAL "Single output directory for building all libraries.")
endif(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
if(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${${PROJECT_NAME}_BINARY_DIR}/${LIB_DIR} CACHE INTERNAL "Single output directory for building all archives.")
endif(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${${PROJECT_NAME}_BINARY_DIR}/${BIN_DIR} CACHE INTERNAL "Single output directory for building all executables.")
endif(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
else(NOT CMAKE_CONFIGURATION_TYPES)
# Multi-configuration is more difficult. Not only do we need to
# properly set the output directories, but we also need to
# identify the "toplevel" directory for each configuration so
# we can place files, documentation, etc. in the correct
# relative positions. Because files may be placed by CMake
# without a build target to put them in their proper relative build
# directory position using these paths, we must fully qualify them
# without using CMAKE_CFG_INTDIR.
#
# We define directories that may not be quite "standard"
# for a particular build tool - for example, native VS2010 projects use
# another directory to denote CPU type being compiled for - but CMake only
# supports multi-configuration setups having multiple configurations,
# not multiple compilers.
#
# One additional wrinkle we must watch for here is the case where
# a multi-configuration setup uses "." for its internal directory -
# if that's the case, we need to just set the various config output
# directories to the same value.
set(CFG_ROOT ${${PROJECT_NAME}_BINARY_DIR})
foreach(CFG_TYPE ${CMAKE_CONFIGURATION_TYPES})
if(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
set(CFG_ROOT ${${PROJECT_NAME}_BINARY_DIR}/${CFG_TYPE})
endif(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
string(TOUPPER "${CFG_TYPE}" CFG_TYPE_UPPER)
if(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER})
set("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}" ${CFG_ROOT}/${LIB_DIR} CACHE INTERNAL "Single output directory for building ${CFG_TYPE} libraries.")
endif(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER})
if(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER})
set("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}" ${CFG_ROOT}/${LIB_DIR} CACHE INTERNAL "Single output directory for building ${CFG_TYPE} archives.")
endif(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER})
if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER})
set("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER}" ${CFG_ROOT}/${BIN_DIR} CACHE INTERNAL "Single output directory for building ${CFG_TYPE} executables.")
endif(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CFG_TYPE_UPPER})
if(NOT DEFINED CMAKE_BINARY_DIR_${CFG_TYPE_UPPER})
set("CMAKE_BINARY_DIR_${CFG_TYPE_UPPER}" ${CFG_ROOT} CACHE INTERNAL "Toplevel binary dir for ${CFG_TYPE} building.")
endif(NOT DEFINED CMAKE_BINARY_DIR_${CFG_TYPE_UPPER})
if(NOT DEFINED ${PROJECT_NAME}_BINARY_DIR_${CFG_TYPE_UPPER})
set("${PROJECT_NAME}_BINARY_DIR_${CFG_TYPE_UPPER}" ${CFG_ROOT} CACHE INTERNAL "Toplevel binary dir for ${CFG_TYPE} building.")
endif(NOT DEFINED ${PROJECT_NAME}_BINARY_DIR_${CFG_TYPE_UPPER})
endforeach()
endif(NOT CMAKE_CONFIGURATION_TYPES)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
-174
View File
@@ -1,174 +0,0 @@
# BIN and LIB directories
if(NOT DEFINED BIN_DIR)
set(BIN_DIR bin)
endif(NOT DEFINED BIN_DIR)
if(NOT DEFINED LIB_DIR)
set(LIB_DIR lib)
endif(NOT DEFINED LIB_DIR)
# testing and compilation options, build output dirs, install dirs, etc
# included by root CMakeLists
if(NOT DEFINED INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR include)
endif(NOT DEFINED INCLUDE_INSTALL_DIR)
if(NOT DEFINED LIB_INSTALL_DIR)
set(LIB_INSTALL_DIR lib)
endif(NOT DEFINED LIB_INSTALL_DIR)
if(NOT DEFINED BIN_INSTALL_DIR)
set(BIN_INSTALL_DIR bin)
endif(NOT DEFINED BIN_INSTALL_DIR)
if(NOT DEFINED SC_BUILD_TYPE)
set(SC_BUILD_TYPE "Debug" CACHE STRING "Build type") # By default set debug build
endif(NOT DEFINED SC_BUILD_TYPE)
if(NOT SC_IS_SUBBUILD)
set(CMAKE_BUILD_TYPE ${SC_BUILD_TYPE} CACHE INTERNAL "Build type, immutable" FORCE)
else(NOT SC_IS_SUBBUILD)
set(CMAKE_BUILD_TYPE ${SC_BUILD_TYPE})
endif(NOT SC_IS_SUBBUILD)
# 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)
# build shared libs by default
OPTION_WITH_DEFAULT(SC_BUILD_SHARED_LIBS "Build shared libs" ON)
# don't build static libs by default
OPTION_WITH_DEFAULT(SC_BUILD_STATIC_LIBS "Build static libs" OFF)
OPTION_WITH_DEFAULT(SC_PYTHON_GENERATOR "Compile exp2python" ON)
OPTION_WITH_DEFAULT(SC_CPP_GENERATOR "Compile exp2cxx" ON)
OPTION_WITH_DEFAULT(SC_MEMMGR_ENABLE_CHECKS "Enable sc_memmgr's memory leak detection" OFF)
OPTION_WITH_DEFAULT(SC_TRACE_FPRINTF "Enable extra comments in generated code so the code's source in exp2cxx may be located" OFF)
# Should we use C++11?
OPTION_WITH_DEFAULT(SC_ENABLE_CXX11 "Build with C++ 11 features" ON)
# Get version from git
OPTION_WITH_DEFAULT(SC_GIT_VERSION "Build using version from git" ON)
option(SC_BUILD_EXPRESS_ONLY "Only build express parser." OFF)
mark_as_advanced(SC_BUILD_EXPRESS_ONLY)
#---------------------------------------------------------------------
# Coverage option
OPTION_WITH_DEFAULT(SC_ENABLE_COVERAGE "Enable code coverage test" OFF)
if(SC_ENABLE_COVERAGE)
set(SC_ENABLE_TESTING ON CACHE BOOL "Testing enabled by coverage option" FORCE)
# build static libs, better coverage report
set(SC_BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs" FORCE)
set(SC_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(SC_BUILD_TYPE "Debug" CACHE STRING "Build type required by testing framework" FORCE)
set(SC_PYTHON_GENERATOR OFF) #won't build with static libs
endif(SC_ENABLE_COVERAGE)
#---------------------------------------------------------------------
# Testing option
OPTION_WITH_DEFAULT(SC_ENABLE_TESTING "Enable unittesting framework" OFF)
if(SC_ENABLE_TESTING)
if(NOT DEFINED SC_BUILD_SCHEMAS)
set(SC_BUILD_SCHEMAS "ALL") #test all schemas, unless otherwise specified
endif()
include(CTest)
ENABLE_TESTING()
endif(SC_ENABLE_TESTING)
#---------------------------------------------------------------------
# Executable install option
OPTION_WITH_DEFAULT(SC_SKIP_EXEC_INSTALL "Skip installing executables" OFF)
if(SC_SKIP_EXEC_INSTALL)
set(SC_EXEC_NOINSTALL "NO_INSTALL")
endif(SC_SKIP_EXEC_INSTALL)
#---------------------------------------------------------------------
# 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)
# when building, don't use the install RPATH already
# (but later on when installing)
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")
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")
# 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)
# When this is a subbuild, assume that the parent project controls all of the following
#======================================================================================
if(NOT SC_IS_SUBBUILD)
# Output directories. In a separate file so it can be used by the schema scanner CMake as well.
include(${SC_CMAKE_DIR}/SC_Outdirs.cmake)
#-----------------------------------------------------------------------------
# Configure install locations. Only do this if CMAKE_INSTALL_PREFIX hasn't
# been set already, to try and allow parent builds (if any) some control.
#
# Need a good Debug location for Windows.
if(NOT WIN32)
if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
set(SC_INSTALL_PREFIX "${SC_SOURCE_DIR}/../sc-install")
else()
set(SC_INSTALL_PREFIX "/usr/local")
endif()
endif(NOT WIN32)
set(SC_INSTALL_PREFIX ${SC_INSTALL_PREFIX} CACHE
PATH "Install prefix prepended to target to create install location")
set(CMAKE_INSTALL_PREFIX ${SC_INSTALL_PREFIX} CACHE INTERNAL "Prefix prepended to install directories if target destination is not absolute, immutable" FORCE)
#-----------------------------------------------------------------------------
# SC Packaging
# $make package
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "STEPcode")
set(CPACK_SET_DESTDIR "ON")
set(CPACK_PACKAGE_VERSION_MAJOR ${SC_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${SC_VERSION_MINOR})
set(CPACK_PACKAGE_NAME SC)
set(CPACK_PACKAGE_CONTACT "SC Developers <scl-dev@googlegroups.com>")
include(CPack)
#-----------------------------------------------------------------------------
# Uninstall target
# 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 SC_IS_SUBBUILD)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+31 -10
View File
@@ -27,19 +27,16 @@ endmacro(P21_TESTS sfile)
# create p21read_sdai_*, lazy_sdai_*, any exes listed in SC_SDAI_ADDITIONAL_EXES_SRCS
macro(SCHEMA_EXES)
RELATIVE_PATH_TO_TOPLEVEL(${CMAKE_CURRENT_SOURCE_DIR} RELATIVE_PATH_COMPONENT)
SC_ADDEXEC(p21read_${PROJECT_NAME} "${RELATIVE_PATH_COMPONENT}/src/test/p21read/p21read.cc" "${PROJECT_NAME};stepdai;stepcore;stepeditor;steputils;base" "TESTABLE")
#add_dependencies(p21read_${PROJECT_NAME} version_string)
SC_ADDEXEC(p21read_${PROJECT_NAME} SOURCES "${RELATIVE_PATH_COMPONENT}/src/test/p21read/p21read.cc;${RELATIVE_PATH_COMPONENT}/src/test/p21read/sc_benchmark.cc" LINK_LIBRARIES ${PROJECT_NAME} stepdai stepcore stepeditor steputils TESTABLE)
if(NOT WIN32)
SC_ADDEXEC(lazy_${PROJECT_NAME} "${RELATIVE_PATH_COMPONENT}/src/cllazyfile/lazy_test.cc" "${PROJECT_NAME};steplazyfile;stepdai;stepcore;stepeditor;steputils;base" "TESTABLE")
#add_dependencies(lazy_${PROJECT_NAME} version_string)
SC_ADDEXEC(lazy_${PROJECT_NAME} SOURCES "${RELATIVE_PATH_COMPONENT}/src/cllazyfile/lazy_test.cc;${RELATIVE_PATH_COMPONENT}/src/cllazyfile/sc_benchmark.cc" LINK_LIBRARIES ${PROJECT_NAME} steplazyfile stepdai stepcore stepeditor steputils TESTABLE)
endif(NOT WIN32)
#add user-defined executables
foreach(src ${SC_SDAI_ADDITIONAL_EXES_SRCS})
get_filename_component(name ${src} NAME_WE)
get_filename_component(path ${src} ABSOLUTE)
SC_ADDEXEC(${name}_${PROJECT_NAME} "${src}" "${PROJECT_NAME};stepdai;stepcore;stepeditor;steputils;base" "TESTABLE")
add_dependencies(${name}_${PROJECT_NAME} version_string)
SC_ADDEXEC(${name}_${PROJECT_NAME} SOURCES ${src} LINK_LIBRARIES ${PROJECT_NAME} stepdai stepcore stepeditor steputils TESTABLE)
#set_target_properties(${name}_${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${${PROJECT_NAME}_COMPILE_FLAGS} -I${path}")
endforeach(src ${SC_SDAI_ADDITIONAL_EXES_SRCS})
ENDMACRO(SCHEMA_EXES)
@@ -92,12 +89,36 @@ macro(SCHEMA_TARGETS expFile schemaName sourceFiles)
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR} ${SC_SOURCE_DIR}/src/cldai ${SC_SOURCE_DIR}/src/cleditor
${SC_SOURCE_DIR}/src/clutils ${SC_SOURCE_DIR}/src/clstepcore ${SC_SOURCE_DIR}/src/base
${SC_SOURCE_DIR}/src/base/judy/src
${SC_SOURCE_DIR}/src/clutils ${SC_SOURCE_DIR}/src/clstepcore ${SC_SOURCE_DIR}/src/cllazyfile
${SC_SOURCE_DIR}/src/cllazyfile/judy/src
)
# if testing is enabled, "TESTABLE" sets property EXCLUDE_FROM_ALL and prevents installation
SC_ADDLIB(${PROJECT_NAME} "${sourceFiles}" "stepdai;stepcore;stepeditor;steputils;base" "TESTABLE")
add_dependencies(${PROJECT_NAME} generate_cpp_${PROJECT_NAME})
if(BUILD_SHARED_LIBS)
SC_ADDLIB(${PROJECT_NAME} SHARED SOURCES ${sourceFiles} LINK_LIBRARIES stepdai stepcore stepeditor steputils TESTABLE)
add_dependencies(${PROJECT_NAME} generate_cpp_${PROJECT_NAME})
if(WIN32)
target_compile_definitions("${PROJECT_NAME}" PRIVATE SC_SCHEMA_DLL_EXPORTS)
if(MSVC)
target_compile_options("${PROJECT_NAME}" PRIVATE "/bigobj")
endif()
endif()
# TODO - ideally we would avoid generating code that triggers this warning, but figuring out
# how to do so is a non-trivial exercise. In the meantime, suppress the (very verbose) warnings
# we get due to this issue so it doesn't mask other problems.
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
target_compile_options("${PROJECT_NAME}" PRIVATE "-Wno-ignored-qualifiers")
endif()
endif()
if($CACHE{SC_BUILD_STATIC_LIBS})
SC_ADDLIB(${PROJECT_NAME}-static STATIC SOURCES ${sourceFiles} LINK_LIBRARIES stepdai-static stepcore-static stepeditor-static steputils-static TESTABLE)
add_dependencies(${PROJECT_NAME}-static generate_cpp_${PROJECT_NAME})
target_compile_definitions("${PROJECT_NAME}-static" PRIVATE SC_STATIC)
if(MSVC)
target_compile_options("${PROJECT_NAME}-static" PRIVATE "/bigobj")
endif()
endif()
SCHEMA_EXES()
SCHEMA_TESTS()
+13 -56
View File
@@ -1,29 +1,11 @@
# create sc_cf.h and sc_version_string.h
# Take the sc config file template as the starting point for
# sc_cf.h.in - scripts may need to append to the template, so
# it is read into memory initially.
set(CONFIG_H_FILE ${SC_BINARY_DIR}/include/sc_cf.h.in)
set_source_files_properties(${CONFIG_H_FILE} PROPERTIES GENERATED TRUE)
set(CMAKE_CURRENT_PROJECT SC)
define_property(GLOBAL PROPERTY SC_CONFIG_H_CONTENTS BRIEF_DOCS "config.h.in contents" FULL_DOCS "config.h.in contents for SC 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 ${SC_SOURCE_DIR}/include/sc_cf_cmake.h.in CONFIG_H_FILE_CONTENTS)
CONFIG_H_APPEND(SC "${CONFIG_H_FILE_CONTENTS}")
# create config.h
include(CheckLibraryExists)
include(CheckIncludeFile)
include(CheckFunctionExists)
include(CheckSymbolExists)
include(CheckTypeSize)
include(CMakePushCheckState)
include(CheckCSourceCompiles)
include(CheckCXXSourceRuns)
CHECK_INCLUDE_FILE(ndir.h HAVE_NDIR_H)
@@ -37,10 +19,13 @@ CHECK_INCLUDE_FILE(stdbool.h HAVE_STDBOOL_H)
CHECK_INCLUDE_FILE(process.h HAVE_PROCESS_H)
CHECK_INCLUDE_FILE(io.h HAVE_IO_H)
CHECK_FUNCTION_EXISTS(abs HAVE_ABS)
CHECK_FUNCTION_EXISTS(memcpy HAVE_MEMCPY)
CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE)
CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
# ensure macro functions are captured
CHECK_SYMBOL_EXISTS(abs "stdlib.h" HAVE_ABS)
CHECK_SYMBOL_EXISTS(memcpy "string.h" HAVE_MEMCPY)
CHECK_SYMBOL_EXISTS(memmove "string.h" HAVE_MEMMOVE)
CHECK_SYMBOL_EXISTS(getopt "getopt.h" HAVE_GETOPT)
CHECK_SYMBOL_EXISTS(snprintf "stdio.h" HAVE_SNPRINTF)
CHECK_SYMBOL_EXISTS(vsnprintf "stdio.h" HAVE_VSNPRINTF)
CHECK_TYPE_SIZE("ssize_t" SSIZE_T)
@@ -92,37 +77,9 @@ int main() {return !(f() == f());}
cmake_pop_check_state()
endif(SC_ENABLE_CXX11)
# Now that all the tests are done, configure the sc_cf.h file:
get_property(CONFIG_H_FILE_CONTENTS GLOBAL PROPERTY SC_CONFIG_H_CONTENTS)
file(WRITE ${CONFIG_H_FILE} "${CONFIG_H_FILE_CONTENTS}")
configure_file(${CONFIG_H_FILE} ${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_cf.h)
# ------------------------
# create sc_version_string.h, http://stackoverflow.com/questions/3780667
# Using 'ver_string' instead of 'sc_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.
if(SC_GIT_VERSION)
configure_file(${SC_CMAKE_DIR}/sc_version_string.cmake ${SC_BINARY_DIR}/sc_version_string.cmake @ONLY)
add_custom_target(version_string ALL DEPENDS ver_string)
# creates sc_version_string.h using cmake script
add_custom_command(OUTPUT ver_string
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${SC_SOURCE_DIR} -DBINARY_DIR=${SC_BINARY_DIR} -P ${SC_BINARY_DIR}/sc_version_string.cmake
)
# sc_version_string.h is a generated file
else(SC_GIT_VERSION)
set(VER_HDR "
#ifndef SC_VERSION_STRING
#define SC_VERSION_STRING
static char sc_version[512] = {\"${SC_VERSION}\"};
#endif"
)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h "${VER_HDR}")
endif(SC_GIT_VERSION)
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h
PROPERTIES GENERATED TRUE
HEADER_FILE_ONLY TRUE )
# Now that all the tests are done, configure the config.h file:
configure_file(${CMAKE_SOURCE_DIR}/include/config.h.in ${SC_BINARY_DIR}/${INCLUDE_DIR}/config.h.gen)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SC_BINARY_DIR}/${INCLUDE_DIR}/config.h.gen ${SC_BINARY_DIR}/${INCLUDE_DIR}/config.h)
# Local Variables:
# tab-width: 8
+18 -25
View File
@@ -1,4 +1,4 @@
# The Express parser uses the tools Perplex, RE2C and Lemon to generate code
# The Express parser uses the tools RE2C and Lemon to generate code
# from higher level inputs. Depending on available tools and options, the
# SC build can either re-generate code as part of the build, or use cached
# files that are ready for compilation.
@@ -10,45 +10,38 @@
# this option is set to ON and the necessary tools are not found, the
# configure step will fail. If it is set to OFF, SC will not even try to use
# the generators and will instead use the cached sources.
if(NOT DEFINED SC_GENERATE_LEXER_PARSER)
set(SC_GENERATE_LEXER_PARSER "AUTO" CACHE STRING "Use Perplex, RE2C and Lemon to generate C source code.")
set(_verbosity "QUIET")
else(NOT DEFINED SC_GENERATE_LEXER_PARSER)
string(TOUPPER "${SC_GENERATE_LEXER_PARSER}" SC_GENERATE_LEXER_PARSER)
endif(NOT DEFINED SC_GENERATE_LEXER_PARSER)
set_property(CACHE SC_GENERATE_LEXER_PARSER PROPERTY STRINGS AUTO ON OFF)
if (NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "AUTO" AND NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "ON" AND NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
set(_valid_gen_states AUTO ON OFF)
set(_verbosity "QUIET")
set(SC_GENERATE_LEXER_PARSER "AUTO" CACHE
STRING "Use Perplex, RE2C and Lemon to generate C source code.")
set_property(CACHE SC_GENERATE_LEXER_PARSER PROPERTY STRINGS ${_valid_gen_states})
string(TOUPPER "${SC_GENERATE_LEXER_PARSER}" SC_GENERATE_LEXER_PARSER)
if(NOT "${SC_GENERATE_LEXER_PARSER}" IN_LIST _valid_gen_states)
message(WARNING "Unknown value ${SC_GENERATE_LEXER_PARSER} supplied for SC_GENERATE_LEXER_PARSER - defaulting to AUTO")
message(WARNING "Valid options are AUTO, ON and OFF")
set(SC_GENERATE_LEXER_PARSER "AUTO" CACHE STRING "Use Perplex, RE2C and Lemon to generate C source code.")
endif (NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "AUTO" AND NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "ON" AND NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
endif()
# If the generators have not been turned off, we need to check for them
if(NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
# NOTE: lemon doesn't have a stable versioning system (it's always 1)
find_package(LEMON ${_verbosity})
find_package(RE2C ${_verbosity})
find_package(PERPLEX ${_verbosity})
if(LEMON_EXECUTABLE AND LEMON_TEMPLATE AND PERPLEX_EXECUTABLE AND PERPLEX_TEMPLATE AND RE2C_EXECUTABLE)
# Templates may be anywhere - make sure we have a stable path if a relative
# path was specified at CMake time
get_filename_component(lemon_template_fpath "${LEMON_TEMPLATE}" ABSOLUTE)
if(NOT "${lemon_template_fpath}" STREQUAL "${LEMON_TEMPLATE}")
get_filename_component(LEMON_TEMPLATE "${CMAKE_BINARY_DIR}/${LEMON_TEMPLATE}" ABSOLUTE)
endif(NOT "${lemon_template_fpath}" STREQUAL "${LEMON_TEMPLATE}")
get_filename_component(perplex_template_fpath "${PERPLEX_TEMPLATE}" ABSOLUTE)
if(NOT "${perplex_template_fpath}" STREQUAL "${PERPLEX_TEMPLATE}")
get_filename_component(PERPLEX_TEMPLATE "${CMAKE_BINARY_DIR}/${PERPLEX_TEMPLATE}" ABSOLUTE)
endif(NOT "${perplex_template_fpath}" STREQUAL "${PERPLEX_TEMPLATE}")
if(LEMON_FOUND AND RE2C_FOUND)
set(SC_GENERATE_LP_SOURCES 1)
message(".. Found perplex, re2c, and lemon - can regenerate lexer/parser if necessary")
else(LEMON_EXECUTABLE AND LEMON_TEMPLATE AND PERPLEX_EXECUTABLE AND PERPLEX_TEMPLATE AND RE2C_EXECUTABLE)
message(".. Found re2c, and lemon - can regenerate lexer/parser if necessary")
else()
if("${SC_GENERATE_LEXER_PARSER}" STREQUAL "ON")
message(FATAL_ERROR "\nSC_GENERATE_LEXER_PARSER set to ON, but one or more components of the Perplex/RE2C/Lemon toolchain were not found.\n")
message(FATAL_ERROR "\nSC_GENERATE_LEXER_PARSER set to ON, but couldn't find lemon/re2c")
else("${SC_GENERATE_LEXER_PARSER}" STREQUAL "ON")
set(SC_GENERATE_LP_SOURCES 0)
endif("${SC_GENERATE_LEXER_PARSER}" STREQUAL "ON")
endif(LEMON_EXECUTABLE AND LEMON_TEMPLATE AND PERPLEX_EXECUTABLE AND PERPLEX_TEMPLATE AND RE2C_EXECUTABLE)
endif()
else(NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
set(SC_GENERATE_LP_SOURCES 0)
endif(NOT "${SC_GENERATE_LEXER_PARSER}" STREQUAL "OFF")
+70 -134
View File
@@ -1,150 +1,86 @@
macro(SC_ADDEXEC execname)
set(_addexec_opts NO_INSTALL TESTABLE)
set(_addexec_multikw SOURCES LINK_LIBRARIES)
string(TOUPPER "SC_ADDEXEC_${execname}_ARG" _arg_prefix)
cmake_parse_arguments(${_arg_prefix} "${_addexec_opts}" "" "${_addexec_multikw}" ${ARGN})
# set compile definitions for dll exports on windows
macro(DEFINE_DLL_EXPORTS libname)
if(MSVC OR BORLAND)
if(${libname} MATCHES "sdai_.*")
set(export "SC_SCHEMA_DLL_EXPORTS")
else()
string(REGEX REPLACE "lib" "" shortname "${libname}")
string(REGEX REPLACE "step" "" LOWERCORE "${shortname}")
string(TOUPPER ${LOWERCORE} UPPER_CORE)
set(export "SC_${UPPER_CORE}_DLL_EXPORTS")
endif()
set_property(TARGET ${libname} APPEND PROPERTY COMPILE_DEFINITIONS "${export}")
endif(MSVC OR BORLAND)
endmacro(DEFINE_DLL_EXPORTS libname)
if(NOT DEFINED "${_arg_prefix}_SOURCES")
message(SEND_ERROR "SC_ADDEXEC usage error!")
endif()
# set compile definitions for dll imports on windows
macro(DEFINE_DLL_IMPORTS tgt libs)
if(MSVC OR BORLAND)
set(imports "")
foreach(lib ${libs})
string(REGEX REPLACE "lib" "" shortname "${lib}")
string(REGEX REPLACE "step" "" LOWERCORE "${shortname}")
string(TOUPPER ${LOWERCORE} UPPER_CORE)
list(APPEND imports "SC_${UPPER_CORE}_DLL_IMPORTS")
endforeach(lib ${libs})
set_property(TARGET ${tgt} APPEND PROPERTY COMPILE_DEFINITIONS "${imports}")
endif(MSVC OR BORLAND)
endmacro(DEFINE_DLL_IMPORTS tgt libs)
add_executable(${execname} ${${_arg_prefix}_SOURCES})
#SC_ADDEXEC(execname "source files" "linked libs" ["TESTABLE"] ["NO_INSTALL"])
macro(SC_ADDEXEC execname srcslist libslist)
if(DEFINED "${_arg_prefix}_LINK_LIBRARIES")
foreach(_lib ${${_arg_prefix}_LINK_LIBRARIES})
if($CACHE{SC_STATIC_UTILS})
if(NOT $<TARGET_PROPERTY:${_lib},TYPE> STREQUAL "STATIC_LIBRARY")
message(SEND_ERROR "SC_ADDEXEC usage error - expected STATIC LINK_LIBRARIES targets (${_lib})")
endif()
endif()
target_link_libraries(${execname} ${_lib})
endforeach()
endif()
string(TOUPPER "${execname}" EXECNAME_UPPER)
if(${ARGC} GREATER 3)
CMAKE_PARSE_ARGUMENTS(${EXECNAME_UPPER} "NO_INSTALL;TESTABLE" "" "" ${ARGN})
endif(${ARGC} GREATER 3)
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
if(NOT ${EXECNAME_UPPER}_NO_INSTALL AND NOT ${EXECNAME_UPPER}_TESTABLE)
if(NOT ${_arg_prefix}_NO_INSTALL AND NOT ${_arg_prefix}_TESTABLE)
install(TARGETS ${execname}
RUNTIME DESTINATION ${BIN_DIR}
LIBRARY DESTINATION ${LIB_DIR}
ARCHIVE DESTINATION ${LIB_DIR}
)
endif(NOT ${EXECNAME_UPPER}_NO_INSTALL AND NOT ${EXECNAME_UPPER}_TESTABLE)
if(NOT SC_ENABLE_TESTING AND ${EXECNAME_UPPER}_TESTABLE)
set_target_properties( ${execname} PROPERTIES EXCLUDE_FROM_ALL ON )
endif(NOT SC_ENABLE_TESTING AND ${EXECNAME_UPPER}_TESTABLE)
ARCHIVE DESTINATION ${LIB_DIR}
)
endif()
# Enable extra compiler flags if local executables and/or global options dictate
set(LOCAL_COMPILE_FLAGS "")
foreach(extraarg ${ARGN})
if(${extraarg} MATCHES "STRICT" AND SC-ENABLE_STRICT)
set(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
endif(${extraarg} MATCHES "STRICT" AND SC-ENABLE_STRICT)
endforeach(extraarg ${ARGN})
if(LOCAL_COMPILE_FLAGS)
set_target_properties(${execname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
endif(LOCAL_COMPILE_FLAGS)
if(NOT SC_ENABLE_TESTING AND ${_arg_prefix}_TESTABLE)
set_target_properties(${execname} PROPERTIES EXCLUDE_FROM_ALL ON)
endif()
endmacro()
endmacro(SC_ADDEXEC execname srcslist libslist)
macro(SC_ADDLIB _addlib_target)
set(_addlib_opts SHARED STATIC NO_INSTALL TESTABLE)
set(_addlib_multikw SOURCES LINK_LIBRARIES)
string(TOUPPER "SC_ADDLIB_${libname}_ARG" _arg_prefix)
cmake_parse_arguments(${_arg_prefix} "${_addlib_opts}" "" "${_addlib_multikw}" ${ARGN})
#SC_ADDLIB(libname "source files" "linked libs" ["TESTABLE"] ["NO_INSTALL"] ["SO_SRCS ..."] ["STATIC_SRCS ..."])
macro(SC_ADDLIB libname srcslist libslist)
if(NOT DEFINED ${_arg_prefix}_SOURCES)
message(SEND_ERROR "SC_ADDLIB usage error!")
endif()
string(TOUPPER "${libname}" LIBNAME_UPPER)
if(${ARGC} GREATER 3)
CMAKE_PARSE_ARGUMENTS(${LIBNAME_UPPER} "NO_INSTALL;TESTABLE" "" "SO_SRCS;STATIC_SRCS" ${ARGN})
endif(${ARGC} GREATER 3)
string(REGEX REPLACE "-framework;" "-framework " libslist "${libslist1}")
if(SC_BUILD_SHARED_LIBS)
add_library(${libname} SHARED ${srcslist} ${${LIBNAME_UPPER}_SO_SRCS})
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 ${SC_ABI_VERSION} SOVERSION ${SC_ABI_SOVERSION})
if(NOT ${LIBNAME_UPPER}_NO_INSTALL AND NOT ${LIBNAME_UPPER}_TESTABLE)
install(TARGETS ${libname}
RUNTIME DESTINATION ${BIN_DIR}
LIBRARY DESTINATION ${LIB_DIR}
ARCHIVE DESTINATION ${LIB_DIR}
)
endif(NOT ${LIBNAME_UPPER}_NO_INSTALL AND NOT ${LIBNAME_UPPER}_TESTABLE)
if(NOT SC_ENABLE_TESTING AND ${LIBNAME_UPPER}_TESTABLE)
set_target_properties( ${libname} PROPERTIES EXCLUDE_FROM_ALL ON )
endif(NOT SC_ENABLE_TESTING AND ${LIBNAME_UPPER}_TESTABLE)
if(${_arg_prefix}_SHARED)
add_library(${_addlib_target} SHARED ${${_arg_prefix}_SOURCES})
if(OPENBSD)
set_target_properties(${_addlib_target} PROPERTIES VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR})
else(OPENBSD)
set_target_properties(${_addlib_target} PROPERTIES VERSION ${SC_VERSION} SOVERSION ${SC_VERSION_MAJOR})
endif(OPENBSD)
if(APPLE)
set_target_properties(${libname} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
set_target_properties(${_addlib_target} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(APPLE)
endif(SC_BUILD_SHARED_LIBS)
if(SC_BUILD_STATIC_LIBS)
if(NOT SC_BUILD_SHARED_LIBS)
set(staticlibname "${libname}")
else()
set(staticlibname "${libname}-static")
endif(NOT SC_BUILD_SHARED_LIBS)
add_library(${staticlibname} STATIC ${srcslist} ${${LIBNAME_UPPER}_STATIC_SRCS})
DEFINE_DLL_EXPORTS(${staticlibname})
if(NOT ${libs} MATCHES "NONE")
target_link_libraries(${staticlibname} "${libslist}")
DEFINE_DLL_IMPORTS(${staticlibname} ${libslist})
endif(NOT ${libs} MATCHES "NONE")
if(NOT WIN32)
set_target_properties(${staticlibname} 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(${staticlibname} PROPERTIES PREFIX "lib")
endif(WIN32)
if(NOT ${LIBNAME_UPPER}_NO_INSTALL AND NOT ${LIBNAME_UPPER}_TESTABLE)
install(TARGETS ${libname}-static
RUNTIME DESTINATION ${BIN_DIR}
LIBRARY DESTINATION ${LIB_DIR}
ARCHIVE DESTINATION ${LIB_DIR}
)
endif(NOT ${LIBNAME_UPPER}_NO_INSTALL AND NOT ${LIBNAME_UPPER}_TESTABLE)
if(NOT SC_ENABLE_TESTING AND ${LIBNAME_UPPER}_TESTABLE)
set_target_properties( ${libname}-static PROPERTIES EXCLUDE_FROM_ALL ON )
endif(NOT SC_ENABLE_TESTING AND ${LIBNAME_UPPER}_TESTABLE)
if(APPLE)
set_target_properties(${staticlibname} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(APPLE)
endif(SC_BUILD_STATIC_LIBS)
# Enable extra compiler flags if local libraries and/or global options dictate
set(LOCAL_COMPILE_FLAGS "")
foreach(extraarg ${ARGN})
if(${extraarg} MATCHES "STRICT" AND SC-ENABLE_STRICT)
set(LOCAL_COMPILE_FLAGS "${LOCAL_COMPILE_FLAGS} ${STRICT_FLAGS}")
endif(${extraarg} MATCHES "STRICT" AND SC-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)
set_target_properties(${staticlibname} PROPERTIES COMPILE_FLAGS ${LOCAL_COMPILE_FLAGS})
endif(BUILD_STATIC_LIBS)
endif(LOCAL_COMPILE_FLAGS)
endmacro(SC_ADDLIB libname srcslist libslist)
elseif(${_arg_prefix}_STATIC)
add_library(${_addlib_target} STATIC ${${_arg_prefix}_SOURCES})
target_compile_definitions(${_addlib_target} PRIVATE SC_STATIC)
else()
message(SEND_ERROR "SC_ADDLIB usage error!")
endif()
if(DEFINED ${_arg_prefix}_LINK_LIBRARIES)
foreach(_lib ${${_arg_prefix}_LINK_LIBRARIES})
if(${_arg_prefix}_STATIC AND TARGET ${_lib})
get_property(_libtype TARGET ${_lib} PROPERTY TYPE)
if(NOT ${_libtype} STREQUAL "STATIC_LIBRARY")
message(SEND_ERROR "SC_ADDLIB usage error - expected (static) LINK_LIBRARIES targets (${_lib})")
endif()
endif()
target_link_libraries(${_addlib_target} ${_lib})
endforeach()
endif()
if(NOT ${_arg_prefix}_NO_INSTALL AND NOT ${_arg_prefix}_TESTABLE)
install(TARGETS ${_addlib_target}
RUNTIME DESTINATION ${BIN_DIR}
LIBRARY DESTINATION ${LIB_DIR}
ARCHIVE DESTINATION ${LIB_DIR}
)
endif()
endmacro()
# Local Variables:
# tab-width: 8
-35
View File
@@ -1,35 +0,0 @@
# Inherit the parent CMake setting
set(CURRENT_SOURCE_DIR @CMAKE_CURRENT_SOURCE_DIR@)
set(CURRENT_BINARY_DIR @CMAKE_CURRENT_BINARY_DIR@)
# Define a variety of convenience routines
include(@PROJECT_CMAKE_DIR@/Generated_Source_Utils.cmake)
# The following steps are executed to sync generated sources:
#
# 1. Create a new verification_info.cmake file and populate
# it with the MD5 sums for current files.
#
# 2. Overwrite the original cached verification_info.cmake
# and generated files with the new ones. If LOCKED_SOURCE_DIR
# is ON, this step will not be carried out - instead, an
# informational message with manual updating instructions
# will be printed.
set(new_info_file "${CURRENT_BINARY_DIR}/verification_info.cmake")
file(WRITE ${new_info_file} "# Autogenerated verification information\n")
# Handle input files
set(input_files "@MD5_FILELIST@")
WRITE_MD5_SUMS("${input_files}" "${new_info_file}")
message("New verification file created: ${new_info_file}")
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
-30
View File
@@ -1,30 +0,0 @@
# Inherit the parent CMake setting
set(DEBUGGING_GENERATED_SOURCES @DEBUGGING_GENERATED_SOURCES@)
set(CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
# Include the file the provides the baseline against which
# current files will be compared
include("@BASELINE_INFORMATION_FILE@")
# Define a variety of convenience routines
include("@PROJECT_CMAKE_DIR@/Generated_Source_Utils.cmake")
# Individually verify all of the files in question.
set(filelist "@MD5_FILELIST@")
VERIFY_FILES("${filelist}" 1 srcs_pass)
if(NOT srcs_pass)
if(NOT DEBUGGING_GENERATED_SOURCES)
message(FATAL_ERROR "Sources have been modified and md5 sums have not been updated. This generally indicates either\n a) an input file has been modified but generated files have not been updated, or\n b) genenerated files have been edited directly.\nTo clear the error:\n a) Copy the new generated sources from the build directory to the generated/ sources directory, use the <target>_md5gen build target to create a new verifictation_info.cmake file, and copy verfication_info.cmake to generated/ as well.\n b) install Perplex/Re2C/LEMON and make the changes to the input file rather than the generated file.\nNote:\n If this is a debugging situation where multiple sequential tests must be conducted, temporarily set the variable DEBUGGING_GENERATED_SOURCES to ON during the CMake configure to disable this check.\nThis measure is necessary to ensure that compilations using either Perplex/Re2C/LEMON generation or the cached outputs of those tools produce consistent results.")
else(NOT DEBUGGING_GENERATED_SOURCES)
message(WARNING "Note: Sources have been modified and md5 sums have not been updated - build failure condition temporarily overridden by DEBUGGING_GENERATED_SOURCES setting.")
endif(NOT DEBUGGING_GENERATED_SOURCES)
endif(NOT srcs_pass)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
-96
View File
@@ -1,96 +0,0 @@
# creates sc_version_string.h, which defines sc_version()
# sc_version() returns a pretty commit description and a build timestamp.
# only update the file if the git commit has changed, because whenever the file is updated files including the header must rebuild
# parallel rebuilds can result in race conditions and failures, particularly when running ctest in parallel
# http://stackoverflow.com/questions/3780667
# http://www.cmake.org/pipermail/cmake/2009-February/027014.html
set(SC_IS_SUBBUILD "@SC_IS_SUBBUILD@")
set(SC_ENABLE_TESTING "@SC_ENABLE_TESTING@")
set(SC_VERSION_HEADER "${BINARY_DIR}/include/sc_version_string.h")
#---------- find commit id ------------------
#use git for a pretty commit id
#uses 'git describe --tags', so tags are required in the repo
#create a tag with 'git tag <name>' and 'git push --tags'
#if git can't be found, uses contents of SC_VERSION.txt
set(VERS_FILE ${SOURCE_DIR}/SC_VERSION.txt)
if(EXISTS ${SOURCE_DIR}/.git)
find_package(Git QUIET)
if(GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags WORKING_DIRECTORY ${SOURCE_DIR}
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 SC_IS_SUBBUILD)
message(WARNING "Git failed (probably no tags in repo). Build will contain revision info from ${VERS_FILE}.")
endif(NOT SC_IS_SUBBUILD)
endif()
else(GIT_FOUND)
file(READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255)
if(NOT SC_IS_SUBBUILD)
message(WARNING "Git not found. Build will contain revision info from ${VERS_FILE}.")
endif(NOT SC_IS_SUBBUILD)
endif(GIT_FOUND)
else()
file(READ ${VERS_FILE} GIT_COMMIT_ID LIMIT 255)
if(NOT SC_IS_SUBBUILD)
message(WARNING "Git failed ('.git' not found). Build will contain revision info from ${VERS_FILE}.")
endif(NOT SC_IS_SUBBUILD)
endif()
string(REPLACE "\n" "" GIT_COMMIT_ID ${GIT_COMMIT_ID})
#-------------- date and time ---------------
#once cmake_minimum_required is >= 2.8.11, we can use TIMESTAMP:
#string(TIMESTAMP date_time_string)
if(SC_ENABLE_TESTING)
set (date_time_string "NA - disabled for testing")
elseif(UNIX)
execute_process(COMMAND date "+%d %b %Y %H:%M" OUTPUT_VARIABLE date_time_string OUTPUT_STRIP_TRAILING_WHITESPACE)
elseif(WIN32)
execute_process(COMMAND cmd /c date /t OUTPUT_VARIABLE currentDate OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE currentTime OUTPUT_STRIP_TRAILING_WHITESPACE)
set (date_time_string "${currentDate} ${currentTime}")
else()
set(date_time_string "\" __DATE__ \" \" __TIME__ \" ")
if(NOT SC_IS_SUBBUILD)
message(STATUS "Unknown platform - using date from preprocessor")
endif(NOT SC_IS_SUBBUILD)
endif()
set(header_string "/* sc_version_string.h - written by cmake. Changes will be lost! */\n"
"#ifndef SC_VERSION_STRING\n"
"#define SC_VERSION_STRING\n\n"
"/*\n** The git commit id looks like \"test-1-g5e1fb47\", 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, and 5e1fb47 is the first 7 chars of the git sha1 commit id.\n"
"** timestamp is created from date/time commands on known platforms, and uses\n"
"** preprocessor macros elsewhere.\n*/\n\n"
"static char sc_version[512] = {\n"
" \"git commit id: ${GIT_COMMIT_ID}, build timestamp ${date_time_string}\"\n"
"}\;\n\n"
"#endif\n"
)
#don't update the file unless somethig changed
string(RANDOM tmpsuffix)
file(WRITE ${SC_VERSION_HEADER}.${tmpsuffix} ${header_string})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SC_VERSION_HEADER}.${tmpsuffix} ${SC_VERSION_HEADER})
execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${SC_VERSION_HEADER}.${tmpsuffix})
if(NOT SC_IS_SUBBUILD)
message("-- sc_version_string.h is up-to-date.")
endif(NOT SC_IS_SUBBUILD)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+9 -11
View File
@@ -1,5 +1,5 @@
project(SC_SUBPROJECT_SCHEMA_SCANNER)
cmake_minimum_required(VERSION 2.8.7)
cmake_minimum_required(VERSION 3.12)
if(NOT ("${CALLED_FROM}" STREQUAL "STEPCODE_CMAKELISTS" AND DEFINED SC_ROOT AND DEFINED SC_BUILDDIR))
message(" ${CALLED_FROM} ${SC_ROOT} ${SC_BUILDDIR}")
@@ -16,12 +16,12 @@ set(SC_BINARY_DIR ${SC_BUILDDIR})
include(${CMAKE_CURRENT_SOURCE_DIR}/../SC_Outdirs.cmake)
set(schema_scanner_src
${SC_ROOT}/src/base/sc_mkdir.c
${SC_ROOT}/src/exp2cxx/genCxxFilenames.c
${SC_ROOT}/src/exp2cxx/class_strings.c
${SC_ROOT}/src/express/generated/expparse.c
${SC_ROOT}/src/express/generated/expscan.c
${SC_ROOT}/src/express/alg.c
${SC_ROOT}/src/express/alloc.c
${SC_ROOT}/src/express/caseitem.c
${SC_ROOT}/src/express/dict.c
${SC_ROOT}/src/express/entity.c
@@ -29,6 +29,7 @@ set(schema_scanner_src
${SC_ROOT}/src/express/exp_kw.c
${SC_ROOT}/src/express/expr.c
${SC_ROOT}/src/express/express.c
${SC_ROOT}/src/express/factory.c
${SC_ROOT}/src/express/hash.c
${SC_ROOT}/src/express/lexact.c
${SC_ROOT}/src/express/linklist.c
@@ -36,6 +37,7 @@ set(schema_scanner_src
${SC_ROOT}/src/express/object.c
${SC_ROOT}/src/express/info.c
${SC_ROOT}/src/express/resolve.c
${SC_ROOT}/src/express/resolve2.c
${SC_ROOT}/src/express/schema.c
${SC_ROOT}/src/express/scope.c
${SC_ROOT}/src/express/stmt.c
@@ -49,24 +51,20 @@ include_directories(
${SC_ROOT}/include/
${SC_ROOT}/src/express/
${SC_ROOT}/src/express/generated
${SC_ROOT}/src/base
${SC_ROOT}/src/exp2cxx
${SC_BUILDDIR}/include
)
add_executable(schema_scanner ${schema_scanner_src})
if(MSVC)
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__)
target_compile_definitions(schema_scanner PUBLIC _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS)
else()
add_definitions(-pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long)
target_compile_options(schema_scanner PUBLIC -pedantic -W -Wall -Wundef -Wfloat-equal -Wshadow -Winline -Wno-long-long)
endif()
add_definitions(-DSCHEMA_SCANNER)
add_executable(schema_scanner ${schema_scanner_src})
target_compile_definitions(schema_scanner PUBLIC SC_STATIC SCHEMA_SCANNER)
# Local Variables:
# tab-width: 8
+43 -14
View File
@@ -14,20 +14,25 @@
*/
extern "C" {
# include "expparse.h"
# include "expscan.h"
# include "express/scope.h"
# include "genCxxFilenames.h"
# include "sc_mkdir.h"
#define _XOPEN_SOURCE /* for S_IFDIR */
# include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
# if defined( _WIN32 ) || defined ( __WIN32__ )
# include <direct.h>
# define getcwd _getcwd
# else
# include <unistd.h>
# endif
#include "expparse.h"
#include "expscan.h"
#include "express/scope.h"
#include "genCxxFilenames.h"
#include <string.h>
#ifdef _WIN32
# include <direct.h>
# define getcwd _getcwd
#else
# include <unistd.h>
#endif
}
#include <string>
@@ -125,6 +130,30 @@ string makeShortName( const char * longName ) {
return filename;
}
/* cross-platform mkdir */
int sc_mkdir( const char * path ) {
#ifdef _WIN32
return mkdir( path );
#else
return mkdir( path, 0777 );
#endif /* _WIN32 */
}
/* return -1 if error, 0 if created, 1 if dir existed already */
static int mkDirIfNone( const char * path ) {
struct stat s;
if( stat( path, &s ) != 0 ) {
if( errno == ENOENT ) {
return sc_mkdir( path );
}
} else if( s.st_mode & S_IFDIR ) {
return 1;
}
/* either stat returned an error other than ENOENT, or 'path' exists but isn't a dir */
return -1;
}
/** write a CMakeLists.txt file for the schema; print its directory to stdout for CMake's add_subdirectory() command */
void writeLists( const char * schemaName, stringstream & eh, stringstream & ei, int ecount,
stringstream & th, stringstream & ti, int tcount ) {
@@ -220,7 +249,7 @@ void writeLists( const char * schemaName, stringstream & eh, stringstream & ei,
cmLists.close();
char pwd[BUFSIZ] = {0};
char pwd[BUFSIZ+1] = {0};
if( getcwd( pwd, BUFSIZ ) ) {
cout << pwd << "/" << shortName << endl;
} else {
@@ -244,7 +273,7 @@ void printSchemaFilenames( Schema sch ){
int ecount = 0, tcount = 0;
DictionaryEntry de;
Generic x;
void *x;
filenames_t fn;
DICTdo_init( sch->symbol_table, &de );
while( 0 != ( x = DICTdo( &de ) ) ) {
+5 -9
View File
@@ -11,13 +11,8 @@
# in a unity build, many small .cc files are #included to create a few large translation units
# this makes compilation faster, but sometimes runs into compiler limitations
if(NOT DEFINED SC_UNITY_BUILD)
if(BORLAND)
message( STATUS "Will not do unity build for this compiler. (SC_UNITY_BUILD=FALSE)")
set(SC_UNITY_BUILD FALSE)
else()
message( STATUS "Assuming compiler is capable of unity build. (SC_UNITY_BUILD=TRUE)")
set(SC_UNITY_BUILD TRUE)
endif(BORLAND)
message( STATUS "Assuming compiler is capable of unity build. (SC_UNITY_BUILD=TRUE)")
set(SC_UNITY_BUILD TRUE)
message( STATUS "Override by setting SC_UNITY_BUILD; TRUE will result in faster build times but *huge* translation units and higher memory use in compilation.")
else(NOT DEFINED SC_UNITY_BUILD)
message( STATUS "Respecting user-defined SC_UNITY_BUILD value of ${SC_UNITY_BUILD}.")
@@ -76,9 +71,9 @@ message( STATUS "Schema scanner built. Running it...")
# not sure if it makes sense to install this or not...
if(WIN32)
install(PROGRAMS ${SCANNER_OUT_DIR}/schema_scanner.exe DESTINATION ${BIN_INSTALL_DIR})
install(PROGRAMS ${SCANNER_OUT_DIR}/schema_scanner.exe DESTINATION ${BIN_DIR})
else(WIN32)
install(PROGRAMS ${SCANNER_OUT_DIR}/schema_scanner DESTINATION ${BIN_INSTALL_DIR})
install(PROGRAMS ${SCANNER_OUT_DIR}/schema_scanner DESTINATION ${BIN_DIR})
endif(WIN32)
# macro SCHEMA_CMLIST
@@ -106,5 +101,6 @@ macro(SCHEMA_CMLIST SCHEMA_FILE)
endforeach(_dir ${_ss_out})
# configure_file forces cmake to run again if the schema has been modified
#if multiple schemas in one file, _schema is the last one printed.
# 2e6ee669 removed _schema, does this still work?
configure_file(${SCHEMA_FILE} ${SCANNER_BUILD_DIR}/${_schema})
endmacro(SCHEMA_CMLIST SCHEMA_FILE)
-83
View File
@@ -1,83 +0,0 @@
# Inherit the parent CMake setting
set(CURRENT_SOURCE_DIR @CMAKE_CURRENT_SOURCE_DIR@)
set(CURRENT_BINARY_DIR @CMAKE_CURRENT_BINARY_DIR@)
set(CACHED_FILES_DIR @CACHED_FILES_DIR@)
set(LEMON_EXECUTABLE @LEMON_EXECUTABLE@)
set(RE2C_EXECUTABLE @RE2C_EXECUTABLE@)
set(PERPLEX_EXECUTABLE @PERPLEX_EXECUTABLE@)
set(LOCKED_SOURCE_DIR @LOCKED_SOURCE_DIR@)
set(DEBUGGING_GENERATED_SOURCES @DEBUGGING_GENERATED_SOURCES@)
if(NOT DEBUGGING_GENERATED_SOURCES)
# Define a variety of convenience routines
include(@PROJECT_CMAKE_DIR@/Generated_Source_Utils.cmake)
# The following steps are executed to sync generated sources:
#
# 1. Create a new verification_info.cmake file and populate
# it with the current versions of perplex, re2c and lemon.
# Also add the MD5 sums for current template files.
#
# 2. For all files that need to be updated in the cache,
# calculate new MD5 sums and add them to the new
# verification_info.cmake - this is usually the input
# files and the generated outputs.
#
# 3. Overwrite the original cached verification_info.cmake
# and generated files with the new ones. If LOCKED_SOURCE_DIR
# is ON, this step will not be carried out - instead, an
# informational message with manual updating instructions
# will be printed.
set(new_info_file "${CURRENT_BINARY_DIR}/verification_info.cmake.new")
file(WRITE ${new_info_file} "# Autogenerated verification information\n")
# Handle generator version numbers
GET_GENERATOR_EXEC_VERSIONS()
file(APPEND ${new_info_file} "set(baseline_lemon_version \"${lemon_version}\")\n")
file(APPEND ${new_info_file} "set(baseline_re2c_version \"${re2c_version}\")\n")
file(APPEND ${new_info_file} "set(baseline_perplex_version \"${perplex_version}\")\n")
# Handle template files
set(template_files "@TEMPLATE_FILELIST@")
WRITE_MD5_SUMS("${template_files}" "${new_info_file}")
# Handle input files
set(input_files "@INPUT_FILELIST@")
WRITE_MD5_SUMS("${input_files}" "${new_info_file}")
# Handle generated files
set(output_files "@BUILD_OUTPUT_FILELIST@")
WRITE_MD5_SUMS("${output_files}" "${new_info_file}")
# Copy files into their final locations
if(NOT LOCKED_SOURCE_DIR)
configure_file(${new_info_file} "${CACHED_FILES_DIR}/verification_info.cmake" COPYONLY)
foreach(outf ${output_files})
get_filename_component(filecorename ${outf} NAME)
message("copying ${outf} to ${CACHED_FILES_DIR}/${filecorename}")
configure_file(${outf} "${CACHED_FILES_DIR}/${filecorename}" COPYONLY)
endforeach(outf ${output_files})
else(NOT LOCKED_SOURCE_DIR)
message("Source directory writing is locked - LOCKED_SOURCE_DIR is set.")
message("To update the generated files, manually copy the following to ${CACHED_FILES_DIR}:")
message(" ${new_info_file} (rename to verification_info.cmake)")
foreach(outf ${output_files})
message(" ${outf}")
endforeach(outf ${output_files})
endif(NOT LOCKED_SOURCE_DIR)
else(NOT DEBUGGING_GENERATED_SOURCES)
message("\nNote: DEBUGGING_GENERATED_SOURCES is enabled - generated outputs will contain configuration-specific debugging information, so syncing cached output files is not possible. To restore normal behavior, disable DEBUGGING_GENERATED_SOURCES.\n")
endif(NOT DEBUGGING_GENERATED_SOURCES)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
+2 -2
View File
@@ -10,7 +10,7 @@
# .exp file inside, which it uses. otherwise, ${path} is assumed to
# be an express file.
if(NOT "${SC_BUILD_SCHEMAS}" STREQUAL "")
if(NOT "${SC_BUILD_EXPRESS_ONLY}" AND NOT "${SC_BUILD_SCHEMAS}" STREQUAL "")
include(${SC_CMAKE_DIR}/schema_scanner/schemaScanner.cmake)
foreach(src ${SC_SDAI_ADDITIONAL_EXES_SRCS})
get_filename_component(name ${src} NAME_WE)
@@ -25,7 +25,7 @@ if(NOT "${SC_BUILD_SCHEMAS}" STREQUAL "")
LOCATE_SCHEMA(${FILE} abspath)
SCHEMA_CMLIST(${abspath})
endforeach()
endif(NOT "${SC_BUILD_SCHEMAS}" STREQUAL "")
endif()
# Local Variables:
# tab-width: 8
+2 -2
View File
@@ -3891,11 +3891,11 @@ ENTITY grooving_turning_operation
WR3: (verify_optional_action_property (SELF, 'allowance')) AND
(verify_length_measure_action_property (SELF, 'allowance'));
-- allowance propery required for roughing
-- allowance property required for roughing
WR4: NOT (SELF.description = 'roughing') OR
(verify_required_action_property (SELF, 'allowance'));
-- allowance propery forbidden for cutting in
-- allowance property forbidden for cutting in
WR5: NOT (SELF.description = 'cutting in') OR
(0 = SIZEOF (get_action_property (SELF, 'allowance')));
END_ENTITY; -- 10303-238: integrated_cnc_schema
+1 -1
View File
@@ -36,7 +36,7 @@
<!-- This is a single string setting. When writing this out to the doxyfile,
it will be quoted and treated as a whole. -->
<string name="OUTPUT_LANGUAGE">English</string>
<!-- A list setting contains multiple elements, seperated by whitespace. Each
<!-- A list setting contains multiple elements, separated by whitespace. Each
individual item will be quoted and treated as a whole for Doxygen. By
default a list replaces the existing setting. If the append attribute is
set to true, then the items will be added to the existing set. -->
+1 -1
View File
@@ -5,7 +5,7 @@
.\" $Id: exp2cxx.1,v 2.1.0.2 1998/02/27 23:54:30 sauderd Exp $
.TH FEDEX_PLUS 1 "19 November 1997"
.SH NAME
exp2cxx - EXPRESS compiler and translater
exp2cxx - EXPRESS compiler and translator
.SH SYNOPSIS
exp2cxx [ options ] [ express-file ]
.nf
+6 -11
View File
@@ -6,7 +6,7 @@
# for the use of this file.
#
project(AP203Minimum)
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.12)
# Set STEPCODE_ROOT_DIR to point to the root of the STEPcode source tree.
if(NOT DEFINED STEPCODE_ROOT_DIR)
@@ -14,14 +14,14 @@ if(NOT DEFINED STEPCODE_ROOT_DIR)
endif(NOT DEFINED STEPCODE_ROOT_DIR)
# STEPCODE_ROOT_DIR is relative or absolute path?
if(EXISTS "${CMAKE_BINARY_DIR}/${STEPCODE_ROOT_DIR}/SC_VERSION.txt")
if(EXISTS "${CMAKE_BINARY_DIR}/${STEPCODE_ROOT_DIR}/src/express/express.c")
set(STEPCODE_ROOT_DIR "${CMAKE_BINARY_DIR}/${STEPCODE_ROOT_DIR}")
message("** STEPCODE_ROOT_DIR is a relative path; converted to absolute path: ${STEPCODE_ROOT_DIR}.")
else()
if(NOT EXISTS "${STEPCODE_ROOT_DIR}/SC_VERSION.txt")
if(NOT EXISTS "${STEPCODE_ROOT_DIR}/src/express/express.c")
message(FATAL_ERROR "**** Cannot locate STEPCODE_ROOT_DIR - try an absolute path.")
endif(NOT EXISTS "${STEPCODE_ROOT_DIR}/SC_VERSION.txt")
endif(EXISTS "${CMAKE_BINARY_DIR}/${STEPCODE_ROOT_DIR}/SC_VERSION.txt")
endif(NOT EXISTS "${STEPCODE_ROOT_DIR}/src/express/express.c")
endif(EXISTS "${CMAKE_BINARY_DIR}/${STEPCODE_ROOT_DIR}/src/express/express.c")
# Use STEPcode as library, but build from this build process.
@@ -51,18 +51,13 @@ endif(NOT EXISTS ${SCHEMA_FILE})
get_filename_component(SCHEMA_SN ${SCHEMA_FILE} NAME)
string(REGEX REPLACE "\(.*\).[Ee][Xx][Pp]" "sdai_\\1" SCHEMA_LINK_NAME ${SCHEMA_SN})
set(STEPCODE_LIBRARIES base stepcore stepeditor stepdai steputils ${SCHEMA_LINK_NAME})
set(STEPCODE_LIBRARIES stepcore stepeditor stepdai steputils ${SCHEMA_LINK_NAME})
# Add STEPCode project to CMake build.
add_subdirectory(${STEPCODE_ROOT_DIR} "${CMAKE_CURRENT_BINARY_DIR}/sc" EXCLUDE_FROM_ALL)
# Set up STEPcode include directories.
set(STEPCODE_INCLUDE_DIR
${STEPCODE_ROOT_DIR}/src/base
${STEPCODE_ROOT_DIR}/src/clstepcore
${STEPCODE_ROOT_DIR}/src/cldai
${STEPCODE_ROOT_DIR}/src/clutils
${STEPCODE_ROOT_DIR}/src/cleditor
${STEPCODE_BUILD_DIR}/include
${STEPCODE_ROOT_DIR}/include
${CMAKE_BINARY_DIR}
@@ -6,7 +6,7 @@
# for the use of this file.
#
project(AP203Minimum)
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.12)
INCLUDE( ExternalProject )
@@ -19,7 +19,6 @@ INCLUDE( External_STEPCode )
IF(NOT WIN32)
set( STEPCODE_LIBRARIES
${STEPCODE_INSTALL_DIR}/lib/libbase.a
${STEPCODE_INSTALL_DIR}/lib/libstepcore.a
${STEPCODE_INSTALL_DIR}/lib/libstepeditor.a
${STEPCODE_INSTALL_DIR}/lib/libstepdai.a
@@ -28,7 +27,6 @@ IF(NOT WIN32)
)
ELSE()
set( STEPCODE_LIBRARIES
${STEPCODE_INSTALL_DIR}/lib/libbase.lib
${STEPCODE_INSTALL_DIR}/lib/libstepcore.lib
${STEPCODE_INSTALL_DIR}/lib/libstepeditor.lib
${STEPCODE_INSTALL_DIR}/lib/libstepdai.lib
@@ -44,7 +42,6 @@ MESSAGE( STATUS "STEPCODE_INSTALL_DIR: " ${STEPCODE_INSTALL_DIR} )
set( STEPCODE_INCLUDE_DIR
${STEPCODE_INSTALL_DIR}/include/stepcode
${STEPCODE_INSTALL_DIR}/include/stepcode/base
${STEPCODE_INSTALL_DIR}/include/stepcode/clstepcore
${STEPCODE_INSTALL_DIR}/include/stepcode/cldai
${STEPCODE_INSTALL_DIR}/include/stepcode/clutils
@@ -77,4 +74,4 @@ target_link_libraries( ${PROJECT_NAME}
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
# ex: shiftwidth=2 tabstop=8
@@ -22,8 +22,3 @@ ENDIF()
SET( STEPCODE_BINARY_DIR ${BINARY_DIR} )
# SC CMake does not honor -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
# Consequently, force Debug so it installs in ../sc-install directory
# instead of /usr/local/lib.
#
# SC's own programs fail to build with -DSC_BUILD_SHARED_LIBS=OFF
+8 -8
View File
@@ -49,15 +49,15 @@
// $./AP203Minimum
// AP203Minimum outfile.stp
#include <STEPfile.h>
#include <sdai.h>
#include <STEPattribute.h>
#include <ExpDict.h>
#include <Registry.h>
#include <errordesc.h>
#include <cleditor/STEPfile.h>
#include <clstepcore/sdai.h>
#include <clstepcore/STEPattribute.h>
#include <clstepcore/ExpDict.h>
#include <clstepcore/Registry.h>
#include <clutils/errordesc.h>
#include <STEPcomplex.h>
#include <SdaiHeaderSchema.h>
#include <clstepcore/STEPcomplex.h>
#include <cleditor/SdaiHeaderSchema.h>
#include "schema.h"
@@ -2,8 +2,9 @@
#define SCL_CF_H
/**** Define statements for CMake ****/
#cmakedefine SC_VERSION "@SC_VERSION@"
#cmakedefine HAVE_NDIR_H 1
#cmakedefine HAVE_STDARG_H 1
#cmakedefine HAVE_STDINT_H 1
#cmakedefine HAVE_SYS_STAT_H 1
#cmakedefine HAVE_SYS_PARAM_H 1
#cmakedefine HAVE_SYSENT_H 1
@@ -14,12 +15,12 @@
#cmakedefine HAVE_IO_H 1
#cmakedefine SC_TRACE_FPRINTF 1
#cmakedefine SC_MEMMGR_ENABLE_CHECKS 1
#cmakedefine HAVE_ABS 1
#cmakedefine HAVE_MEMCPY 1
#cmakedefine HAVE_MEMMOVE 1
#cmakedefine HAVE_GETOPT 1
#cmakedefine HAVE_VSNPRINTF 1
#cmakedefine HAVE_SSIZE_T 1
+11 -7
View File
@@ -22,22 +22,26 @@ set(express_HDRS
express/variable.h
)
install(FILES ${express_HDRS}
DESTINATION ${INCLUDE_INSTALL_DIR}/stepcode/express)
DESTINATION ${INCLUDE_DIR}/stepcode/express)
set(exppp_HDRS
exppp/exppp.h
)
install(FILES ${exppp_HDRS}
DESTINATION ${INCLUDE_INSTALL_DIR}/stepcode/exppp)
DESTINATION ${INCLUDE_DIR}/stepcode/exppp)
install(FILES ordered_attrs.h
sc_export.h
sc_stdbool.h
DESTINATION ${INCLUDE_INSTALL_DIR}/stepcode)
DESTINATION ${INCLUDE_DIR}/stepcode)
install(FILES ${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_cf.h
${SC_BINARY_DIR}/${INCLUDE_INSTALL_DIR}/sc_version_string.h
DESTINATION ${INCLUDE_INSTALL_DIR}/stepcode)
install(FILES ${SC_BINARY_DIR}/${INCLUDE_DIR}/config.h
DESTINATION ${INCLUDE_DIR}/stepcode)
add_subdirectory(cldai)
add_subdirectory(cleditor)
add_subdirectory(cllazyfile)
add_subdirectory(clstepcore)
add_subdirectory(clutils)
# Local Variables:
# tab-width: 8
+24
View File
@@ -0,0 +1,24 @@
set(DAI_HDRS
sdaiApplication_instance_set.h
sdaiBinary.h
sdaiDaObject.h
sdaiEntity_extent.h
sdaiEntity_extent_set.h
sdaiEnum.h
sdaiModel_contents.h
sdaiModel_contents_list.h
sdaiObject.h
sdaiSession_instance.h
sdaiString.h
)
install(FILES ${DAI_HDRS}
DESTINATION ${INCLUDE_DIR}/stepcode/cldai)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
@@ -15,7 +15,15 @@
class SC_DAI_EXPORT SDAI_Binary {
private:
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
std::string content;
#ifdef _MSC_VER
#pragma warning( pop )
#endif
public:
//constructor(s) & destructor
@@ -1,9 +1,9 @@
#ifndef SDAIDAOBJECT_H
#define SDAIDAOBJECT_H 1
#include <sdaiObject.h>
#include <sdaiString.h>
#include <sdaiEnum.h>
#include "cldai/sdaiObject.h"
#include "cldai/sdaiString.h"
#include "cldai/sdaiEnum.h"
#include <sc_export.h>
@@ -65,7 +65,7 @@ typedef SDAI_PID_ptr SDAI_PID_var;
// The Direct Access Protocol supports direct access to persistent data
// through typed attributes organized in data objects that are defined
// in a Data Definition Language (DDL). An object using this protocol
// whould represent its persistent data as one or more interconnected
// would represent its persistent data as one or more interconnected
// data objects, For uniformity, the persistent data of an object is
// described as a single data object; however, that data object might be
// the root of a graph of data objects interconnected by stored data
@@ -56,7 +56,7 @@ class SC_DAI_EXPORT SDAI_Entity_extent : public SDAI_Session_instance {
return &_instances;
}
SDAI_DAObject__set_var instances_() const {
return ( const SDAI_DAObject__set_var )&_instances;
return ( SDAI_DAObject__set_var )&_instances;
}
// need to implement Model_contents__list
@@ -138,6 +138,7 @@ class SC_DAI_EXPORT SDAI_BOOLEAN :
operator ::Boolean() const;
SDAI_BOOLEAN & operator=( const SDAI_LOGICAL & t );
SDAI_BOOLEAN & operator=( const SDAI_BOOLEAN & t );
SDAI_BOOLEAN & operator=( const ::Boolean t );
SDAI_LOGICAL operator==( const SDAI_LOGICAL & t ) const;
@@ -40,7 +40,7 @@ class SC_DAI_EXPORT SDAI_Model_contents_instances : public SDAI_DAObject {
return &_instances;
}
SDAI_DAObject__set_var contents_() const {
return ( const SDAI_DAObject__set_var ) &_instances;
return ( SDAI_DAObject__set_var ) &_instances;
}
};
@@ -3,7 +3,7 @@
#define SESSION_INSTANCE_H 1
#include <sc_export.h>
//#include <sdai.h>
//#include "clstepcore/sdai.h"
class SC_DAI_EXPORT SDAI_Session_instance : public SDAI_sdaiObject {
@@ -12,12 +12,21 @@
*/
#include <sc_export.h>
#include <string>
#include <limits>
class SC_DAI_EXPORT SDAI_String {
private:
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
std::string content;
#ifdef _MSC_VER
#pragma warning( pop )
#endif
public:
//constructor(s) & destructor
@@ -28,6 +37,7 @@ class SC_DAI_EXPORT SDAI_String {
// operators
SDAI_String & operator= ( const char * s );
SDAI_String & operator= ( const SDAI_String & s );
bool operator== ( const char * s ) const;
void clear( void );
+20
View File
@@ -0,0 +1,20 @@
set(EDITOR_HDRS
STEPfile.h
cmdmgr.h
editordefines.h
SdaiHeaderSchema.h
SdaiHeaderSchemaClasses.h
SdaiSchemaInit.h
seeinfodefault.h
)
install(FILES ${EDITOR_HDRS}
DESTINATION ${INCLUDE_DIR}/stepcode/cleditor)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
@@ -15,14 +15,14 @@
#include <sc_export.h>
#include <string>
#include <instmgr.h>
#include <Registry.h>
#include "clstepcore/instmgr.h"
#include "clstepcore/Registry.h"
#include <fstream>
#include <dirobj.h>
#include <errordesc.h>
#include "clutils/dirobj.h"
#include "clutils/errordesc.h"
#include <time.h>
#include <read_func.h>
#include "clstepcore/read_func.h"
//error reporting level
#define READ_COMPLETE 10
@@ -58,11 +58,18 @@ class SC_EDITOR_EXPORT STEPfile {
//file information
DirObj * _currentDir;
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
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())
#ifdef _MSC_VER
#pragma warning( pop )
#endif
bool _iFileStage1Done; ///< set immediately before ReadData1() returns
int _oFileInstsWritten; ///< number of instances that have been written
@@ -92,8 +99,15 @@ class SC_EDITOR_EXPORT STEPfile {
//file type information
FileTypeCode _fileType;
char ENTITY_NAME_DELIM;
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
std::string FILE_DELIM;
std::string END_FILE_DELIM;
#ifdef _MSC_VER
#pragma warning( pop )
#endif
//public member functions
public:
@@ -5,11 +5,11 @@
// regenerate it.
#include <sc_export.h>
#include <sdai.h>
#include <Registry.h>
#include <STEPaggregate.h>
#include <SdaiHeaderSchemaClasses.h>
#include <SdaiSchemaInit.h>
#include "clstepcore/sdai.h"
#include "clstepcore/Registry.h"
#include "clstepcore/STEPaggregate.h"
#include "cleditor/SdaiHeaderSchemaClasses.h"
#include "cleditor/SdaiSchemaInit.h"
///////// ENTITY section_language
@@ -9,16 +9,16 @@
#endif
#include <sc_export.h>
#include <sdai.h>
#include <Registry.h>
#include <STEPaggregate.h>
#include <STEPundefined.h>
#include <ExpDict.h>
#include <STEPattribute.h>
#include <complexSupport.h>
#include "clstepcore/sdai.h"
#include "clstepcore/Registry.h"
#include "clstepcore/STEPaggregate.h"
#include "clstepcore/STEPundefined.h"
#include "clstepcore/ExpDict.h"
#include "clstepcore/STEPattribute.h"
#include "clstepcore/complexSupport.h"
#include <SdaiHeaderSchemaClasses.h>
#include <SdaiHeaderSchema.h>
#include "cleditor/SdaiHeaderSchemaClasses.h"
#include "cleditor/SdaiHeaderSchema.h"
SC_EDITOR_EXPORT void HeaderSchemaInit( Registry & );
SC_EDITOR_EXPORT void HeaderInitSchemasAndEnts( Registry & );
@@ -13,16 +13,16 @@
*/
#include <sc_export.h>
#include <gennode.h>
#include <gennodelist.h>
#include <gennodearray.h>
#include "clutils/gennode.h"
#include "clutils/gennodelist.h"
#include "clutils/gennodearray.h"
#include <editordefines.h>
#include <mgrnode.h>
#include <mgrnodelist.h>
#include <dispnode.h>
#include <dispnodelist.h>
#include <SingleLinkList.h>
#include "cleditor/editordefines.h"
#include "clstepcore/mgrnode.h"
#include "clstepcore/mgrnodelist.h"
#include "clstepcore/dispnode.h"
#include "clstepcore/dispnodelist.h"
#include "clstepcore/SingleLinkList.h"
//#define NUM_CMDMGR_CMDS 9
// this is the number of columns that contain cmds (as opposed
@@ -145,6 +145,7 @@ class SC_EDITOR_EXPORT CmdMgr {
public:
CmdMgr();
~CmdMgr();
// STATE LIST OPERATIONS
MgrNode * GetHead( stateEnum listType );
@@ -20,10 +20,10 @@
class MgrNode;
class DisplayNode;
class DisplayNodelist;
#include <sdai.h>
#include "clstepcore/sdai.h"
//class SDAI_Application_instance;
#include <editordefines.h>
#include "cleditor/editordefines.h"
class SC_EDITOR_EXPORT seeInfo : public DisplayNode {
public:
+27
View File
@@ -0,0 +1,27 @@
set(LAZY_HDRS
headerSectionReader.h
lazyFileReader.h
lazyP21DataSectionReader.h
p21HeaderSectionReader.h
lazyDataSectionReader.h
lazyInstMgr.h
lazyTypes.h
sectionReader.h
instMgrHelper.h
judy.h
judyL2Array.h
judyLArray.h
judyS2Array.h
judySArray.h
)
install(FILES ${LAZY_HDRS}
DESTINATION ${INCLUDE_DIR}/stepcode/cllazyfile)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
@@ -5,10 +5,9 @@
#include <fstream>
#include "judyL2Array.h"
#include "lazyFileReader.h"
#include "sectionReader.h"
#include "lazyTypes.h"
#include "sc_memmgr.h"
#include "cllazyfile/lazyFileReader.h"
#include "cllazyfile/sectionReader.h"
#include "cllazyfile/lazyTypes.h"
#include "sc_export.h"
@@ -31,6 +30,7 @@ class SC_LAZYFILE_EXPORT headerSectionReader: public sectionReader {
//FIXME delete each instance?! maybe add to clear, since it iterates over everything already
//enum clearHow { rawData, deletePointers }
_headerInstances->clear();
delete _headerInstances;
}
};
@@ -3,9 +3,9 @@
#include <sc_export.h>
#include <mgrnode.h>
#include <lazyInstMgr.h>
#include <instmgr.h>
#include "clstepcore/mgrnode.h"
#include "cllazyfile/lazyInstMgr.h"
#include "clstepcore/instmgr.h"
/**
* \file instMgrHelper.h helper classes for the lazyInstMgr. Allows use of SDAI_Application_instance class
@@ -32,18 +32,7 @@
// judy_prv: retrieve the cell pointer for the prev string in the array.
// judy_del: delete the key and cell for the current stack entry.
/* Import/Export flags for base. */
#ifndef SC_BASE_EXPORT
# if defined(SC_BASE_DLL_EXPORTS) && defined(SC_BASE_DLL_IMPORTS)
# error "Only SC_BASE_DLL_EXPORTS or SC_BASE_DLL_IMPORTS can be defined, not both."
# elif defined(SC_BASE_DLL_EXPORTS)
# define SC_BASE_EXPORT __declspec(dllexport)
# elif defined(SC_BASE_DLL_IMPORTS)
# define SC_BASE_EXPORT __declspec(dllimport)
# else
# define SC_BASE_EXPORT
# endif
#endif
#include "sc_export.h"
#if defined(__LP64__) || \
defined(__x86_64__) || \
@@ -3,9 +3,8 @@
#include <map>
#include <iostream>
#include "sectionReader.h"
#include "lazyTypes.h"
#include "sc_memmgr.h"
#include "cllazyfile/sectionReader.h"
#include "cllazyfile/lazyTypes.h"
#include "sc_export.h"
@@ -16,7 +15,14 @@
class SC_LAZYFILE_EXPORT lazyDataSectionReader: public sectionReader {
protected:
bool _error, _completelyLoaded;
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
std::string _sectionIdentifier;
#ifdef _MSC_VER
#pragma warning( pop )
#endif
/// only makes sense to call the ctor from derived class ctors
lazyDataSectionReader( lazyFileReader * parent, std::ifstream & file, std::streampos start, sectionID sid );
@@ -8,16 +8,14 @@
#include "sc_export.h"
// PART 21
#include "lazyP21DataSectionReader.h"
#include "p21HeaderSectionReader.h"
#include "headerSectionReader.h"
#include "cllazyfile/lazyP21DataSectionReader.h"
#include "cllazyfile/p21HeaderSectionReader.h"
#include "cllazyfile/headerSectionReader.h"
/* // PART 28
* #include "lazyP28DataSectionReader.h"
* #include "p28HeaderSectionReader.h"
*/
#include "sc_memmgr.h"
class lazyInstMgr;
class Registry;
class headerSectionReader;
@@ -26,10 +24,17 @@ class headerSectionReader;
///for use only from within lazyInstMgr
class SC_LAZYFILE_EXPORT lazyFileReader {
protected:
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
std::string _fileName;
lazyInstMgr * _parent;
headerSectionReader * _header;
std::ifstream _file;
#ifdef _MSC_VER
#pragma warning( pop )
#endif
fileTypeEnum _fileType;
fileID _fileID;
@@ -5,12 +5,11 @@
#include <string>
#include <assert.h>
#include "lazyDataSectionReader.h"
#include "lazyFileReader.h"
#include "lazyTypes.h"
#include "cllazyfile/lazyDataSectionReader.h"
#include "cllazyfile/lazyFileReader.h"
#include "cllazyfile/lazyTypes.h"
#include "Registry.h"
#include "sc_memmgr.h"
#include "clstepcore/Registry.h"
#include "sc_export.h"
#include "judyLArray.h"
@@ -26,6 +25,10 @@ class SC_LAZYFILE_EXPORT lazyInstMgr {
/** multimap from instance number to instances that it refers to
* \sa instanceRefs_pair
*/
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
instanceRefs_t _fwdInstanceRefs;
/** multimap from instance number to instances that refer to it - the majority of these will not be inverse references!
* \sa instanceRefs_pair
@@ -67,6 +70,10 @@ class SC_LAZYFILE_EXPORT lazyInstMgr {
instMgrAdapter * _ima;
#ifdef _MSC_VER
#pragma warning( pop )
#endif
public:
lazyInstMgr();
~lazyInstMgr();
@@ -1,9 +1,8 @@
#ifndef LAZYP21DATASECTIONREADER_H
#define LAZYP21DATASECTIONREADER_H
#include "lazyDataSectionReader.h"
#include "lazyFileReader.h"
#include "sc_memmgr.h"
#include "cllazyfile/lazyDataSectionReader.h"
#include "cllazyfile/lazyFileReader.h"
#include "sc_export.h"
class SC_LAZYFILE_EXPORT lazyP21DataSectionReader: public lazyDataSectionReader {
@@ -1,10 +1,20 @@
#ifndef LAZYTYPES_H
#define LAZYTYPES_H
#include "config.h"
#include <iostream>
#include <vector>
#include <set>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
#if defined(_MSC_VER) && _MSC_VER < 1600
typedef unsigned __int64 uint64_t;
typedef unsigned __int16 uint16_t;
#endif
#endif
#include "judyLArray.h"
#include "judySArray.h"
@@ -1,8 +1,7 @@
#ifndef P21HEADERSECTIONREADER_H
#define P21HEADERSECTIONREADER_H
#include "headerSectionReader.h"
#include "sc_memmgr.h"
#include "cllazyfile/headerSectionReader.h"
#include "sc_export.h"
class SC_LAZYFILE_EXPORT p21HeaderSectionReader: public headerSectionReader {
@@ -3,11 +3,10 @@
#include <fstream>
#include <set>
#include "lazyTypes.h"
#include "sc_memmgr.h"
#include "cllazyfile/lazyTypes.h"
#include "sc_export.h"
#include "errordesc.h"
#include "STEPcomplex.h"
#include "clutils/errordesc.h"
#include "clstepcore/STEPcomplex.h"
class SDAI_Application_instance;
class lazyFileReader;
@@ -18,10 +17,17 @@ class SC_LAZYFILE_EXPORT sectionReader {
protected:
//protected data members
lazyFileReader * _lazyFile;
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
std::ifstream & _file;
std::streampos _sectionStart, ///< the start of this section as reported by tellg()
_sectionEnd; ///< the end of this section as reported by tellg()
#ifdef _MSC_VER
#pragma warning( pop )
#endif
unsigned long _totalInstances;
ErrorDescriptor * _error;
@@ -31,6 +37,7 @@ class SC_LAZYFILE_EXPORT sectionReader {
// protected member functions
sectionReader( lazyFileReader * parent, std::ifstream & file, std::streampos start, sectionID sid );
~sectionReader();
/** Find a string, ignoring occurrences in comments or Part 21 strings (i.e. 'string with \S\' control directive' )
* \param str string to find
+71
View File
@@ -0,0 +1,71 @@
set(CORE_HDRS
aggrTypeDescriptor.h
attrDescriptor.h
attrDescriptorList.h
baseType.h
complexSupport.h
create_Aggr.h
derivedAttribute.h
dictSchema.h
dictdefs.h
dictionaryInstance.h
dispnode.h
dispnodelist.h
entityDescriptor.h
entityDescriptorList.h
enumTypeDescriptor.h
ExpDict.h
explicitItemId.h
globalRule.h
implicitItemId.h
instmgr.h
interfaceSpec.h
interfacedItem.h
inverseAttribute.h
inverseAttributeList.h
mgrnode.h
mgrnodearray.h
mgrnodelist.h
needFunc.h
read_func.h
realTypeDescriptor.h
Registry.h
schRename.h
sdai.h
sdaiApplication_instance.h
sdaiSelect.h
selectTypeDescriptor.h
SingleLinkList.h
STEPaggregate.h
STEPaggrBinary.h
STEPaggrEntity.h
STEPaggrEnum.h
STEPaggrGeneric.h
STEPaggrInt.h
STEPaggrReal.h
STEPaggrSelect.h
STEPaggrString.h
STEPattribute.h
STEPattributeList.h
STEPcomplex.h
STEPinvAttrList.h
STEPundefined.h
stringTypeDescriptor.h
SubSuperIterators.h
typeDescriptor.h
typeDescriptorList.h
typeOrRuleVar.h
uniquenessRule.h
whereRule.h
)
install(FILES ${CORE_HDRS}
DESTINATION ${INCLUDE_DIR}/stepcode/clstepcore)
# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8
@@ -15,20 +15,20 @@
*/
#include <sc_export.h>
#include <sdai.h>
#include "clstepcore/sdai.h"
#include <vector>
#include <string>
#include <assert.h>
#include <SingleLinkList.h>
#include "clstepcore/SingleLinkList.h"
#include <baseType.h>
#include <dictdefs.h>
#include <Str.h>
#include "clstepcore/baseType.h"
#include "clstepcore/dictdefs.h"
#include "clutils/Str.h"
// each of these contains linked list, list node, iterator
#include "attrDescriptorList.h"
#include "clstepcore/attrDescriptorList.h"
#include "inverseAttributeList.h"
#include "typeDescriptorList.h"
#include "entityDescriptorList.h"
@@ -37,12 +37,12 @@
#include "typeDescriptor.h"
#include "entityDescriptor.h"
#include "enumTypeDescriptor.h"
#include "attrDescriptor.h"
#include "derivedAttribute.h"
#include "clstepcore/attrDescriptor.h"
#include "clstepcore/derivedAttribute.h"
#include "inverseAttribute.h"
#include "create_Aggr.h"
#include "dictionaryInstance.h"
#include "clstepcore/create_Aggr.h"
#include "clstepcore/dictionaryInstance.h"
#include "uniquenessRule.h"
#include "whereRule.h"
@@ -53,10 +53,10 @@
#include "interfaceSpec.h"
#include "typeOrRuleVar.h"
#include "globalRule.h"
#include "dictSchema.h"
#include "clstepcore/dictSchema.h"
#include "schRename.h"
#include "aggrTypeDescriptor.h"
#include "clstepcore/aggrTypeDescriptor.h"
#include "selectTypeDescriptor.h"
#include "stringTypeDescriptor.h"
#include "realTypeDescriptor.h"
@@ -13,11 +13,11 @@
*/
#include <sc_export.h>
#include <sdai.h>
#include <errordesc.h>
#include <sc_hash.h>
#include <Str.h>
#include <complexSupport.h>
#include "clstepcore/sdai.h"
#include "clutils/errordesc.h"
#include "clutils/sc_hash.h"
#include "clutils/Str.h"
#include "clstepcore/complexSupport.h"
// defined and created in Registry.cc
@@ -1,7 +1,7 @@
#ifndef STEPAGGRBINARY_H
#define STEPAGGRBINARY_H
#include "STEPaggregate.h"
#include "clstepcore/STEPaggregate.h"
#include <sc_export.h>
/** \file STEPaggrBinary.h
@@ -5,7 +5,7 @@
* classes EntityAggregate, EntityNode
*/
#include "STEPaggregate.h"
#include "clstepcore/STEPaggregate.h"
#include <sc_export.h>
class SC_CORE_EXPORT EntityAggregate : public STEPaggregate {
@@ -57,7 +57,7 @@ public:
virtual SingleLinkNode * NewNode();
// Calling these funtions is an error.
// Calling these functions is an error.
Severity StrToVal( const char * s, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
@@ -1,7 +1,7 @@
#ifndef STEPAGGRENUM_H
#define STEPAGGRENUM_H
#include "STEPaggregate.h"
#include "clstepcore/STEPaggregate.h"
#include "sc_export.h"
/** \file StepaggrEnum.h
* classes EnumAggregate, LOGICALS, BOOLEANS, EnumNode
@@ -9,7 +9,7 @@
/**
* \class EnumAggregate
* This is a minimal representions for a collection of SDAI_Enum
* This is a minimal representation for a collection of SDAI_Enum
*/
class SC_CORE_EXPORT EnumAggregate : public STEPaggregate {
public:
@@ -55,7 +55,7 @@ SC_CORE_EXPORT BOOLEANS * create_BOOLEANS();
/**
* * \class EnumNode
** This is a minimal representions for node in lists of SDAI_Enum
** This is a minimal representation for node in lists of SDAI_Enum
*/
class SC_CORE_EXPORT EnumNode : public STEPnode {
public:
@@ -1,7 +1,7 @@
#ifndef STEPAGGRGENERIC_H
#define STEPAGGRGENERIC_H
#include "STEPaggregate.h"
#include "clstepcore/STEPaggregate.h"
#include <sc_export.h>
/** \file STEPaggrGeneric.h
@@ -1,7 +1,7 @@
#ifndef STEPAGGRINT_H
#define STEPAGGRINT_H
#include "STEPaggregate.h"
#include "clstepcore/STEPaggregate.h"
#include <sc_export.h>
class SC_CORE_EXPORT IntAggregate : public STEPaggregate {
@@ -1,7 +1,7 @@
#ifndef STEPAGGRREAL_H
#define STEPAGGRREAL_H
#include "STEPaggregate.h"
#include "clstepcore/STEPaggregate.h"
#include <sc_export.h>
class SC_CORE_EXPORT RealAggregate : public STEPaggregate {
@@ -1,7 +1,7 @@
#ifndef STEPAGGRSELECT_H
#define STEPAGGRSELECT_H
#include "STEPaggregate.h"
#include "clstepcore/STEPaggregate.h"
#include <sc_export.h>
/** \file STEPaggrSelect.h
@@ -11,7 +11,7 @@
/**
* * \class SelectAggregate
** This is a minimal represention for a collection of SDAI_Select
** This is a minimal representation for a collection of SDAI_Select
*/
class SC_CORE_EXPORT SelectAggregate : public STEPaggregate {
public:
@@ -35,7 +35,7 @@ typedef SelectAggregate_ptr SelectAggregate_var;
/**
* * \class SelectNode
** This is a minimal representions for node in lists of SDAI_Select
** This is a minimal representation for node in lists of SDAI_Select
*/
class SC_CORE_EXPORT SelectNode : public STEPnode {
public:
@@ -68,7 +68,7 @@ public:
virtual SingleLinkNode * NewNode();
// Calling these funtions is an error.
// Calling these functions is an error.
Severity StrToVal( const char * s, ErrorDescriptor * err ) {
cerr << "Internal error: " << __FILE__ << __LINE__
<< "\n" << _POC_ "\n";
@@ -1,7 +1,7 @@
#ifndef STEPAGGRSTRING_H
#define STEPAGGRSTRING_H
#include "STEPaggregate.h"
#include "clstepcore/STEPaggregate.h"
#include <sc_export.h>
/** \file STEPaggrString.h
@@ -17,11 +17,11 @@ class STEPaggregate;
class TypeDescriptor;
#include <sc_export.h>
#include <errordesc.h>
#include <SingleLinkList.h>
#include <baseType.h>
#include <sdai.h>
#include <STEPundefined.h>
#include "clutils/errordesc.h"
#include "clstepcore/SingleLinkList.h"
#include "clstepcore/baseType.h"
#include "clstepcore/sdai.h"
#include "clstepcore/STEPundefined.h"
#include <string>
#define AGGR_NULL &NilSTEPaggregate
@@ -110,14 +110,14 @@ public:
};
typedef STEPnode * STEPnodeH;
#include "STEPaggrGeneric.h"
#include "STEPaggrEntity.h"
#include "STEPaggrSelect.h"
#include "STEPaggrString.h"
#include "STEPaggrBinary.h"
#include "STEPaggrEnum.h"
#include "STEPaggrReal.h"
#include "STEPaggrInt.h"
#include "clstepcore/STEPaggrGeneric.h"
#include "clstepcore/STEPaggrEntity.h"
#include "clstepcore/STEPaggrSelect.h"
#include "clstepcore/STEPaggrString.h"
#include "clstepcore/STEPaggrBinary.h"
#include "clstepcore/STEPaggrEnum.h"
#include "clstepcore/STEPaggrReal.h"
#include "clstepcore/STEPaggrInt.h"
/******************************************************************
** FIXME The following classes are currently stubs
@@ -15,10 +15,10 @@
#include <sc_export.h>
#include <stdio.h>
#include <errordesc.h>
#include <baseType.h>
#include "clutils/errordesc.h"
#include "clstepcore/baseType.h"
#include <sdai.h>
#include "clstepcore/sdai.h"
/** \def REAL_NUM_PRECISION
* this is used to set a const int Real_Num_Precision
@@ -75,21 +75,15 @@ extern SC_CORE_EXPORT void PushPastAggr1Dim( istream & in, std::string & s, Erro
class SC_CORE_EXPORT STEPattribute {
friend ostream & operator<< ( ostream &, STEPattribute & );
friend class SDAI_Application_instance;
protected:
bool _derive;
bool _mustDeletePtr; ///if a member uses new to create an object in ptr
ErrorDescriptor _error;
STEPattribute * _redefAttr;
const AttrDescriptor * aDesc;
int refCount;
public:
/** \union ptr
** You know which of these to use based on the return value of
** NonRefType() - see below. BASE_TYPE is defined in baseType.h
** This variable points to an appropriate member variable in the entity
** class in the generated schema class library (the entity class is
** inherited from SDAI_Application_instance)
*/
** You know which of these to use based on the return value of
** NonRefType() - see below. BASE_TYPE is defined in baseType.h
** This variable points to an appropriate member variable in the entity
** class in the generated schema class library (the entity class is
** inherited from SDAI_Application_instance)
*/
union attrUnion {
SDAI_String * S; // STRING_TYPE
SDAI_Integer * i; // INTEGER_TYPE (Integer is a long int)
@@ -103,6 +97,18 @@ class SC_CORE_EXPORT STEPattribute {
void * p;
} ptr;
protected:
bool _derive;
bool _mustDeletePtr; ///if a member uses new to create an object in ptr
ErrorDescriptor _error;
STEPattribute * _redefAttr;
public:
const AttrDescriptor * aDesc;
protected:
int refCount;
char SkipBadAttr( istream & in, char * StopChars );
void AddErrorInfo();
void STEPwriteError( ostream& out, unsigned int line, const char* desc );
@@ -137,6 +143,7 @@ class SC_CORE_EXPORT STEPattribute {
/// return the attr value as a string
string asStr( const char * currSch = 0 ) const;
const char * asStr( std::string &, const char * = 0 ) const;
/// put the attr value in ostream
void STEPwrite( ostream & out = cout, const char * currSch = 0 );
@@ -167,11 +174,6 @@ class SC_CORE_EXPORT STEPattribute {
SCLundefined * Undefined();
///@}
/// allows direct access to the union containing attr data (dangerous!)
attrUnion * Raw() {
return & ptr;
}
/**
* These functions allow setting the attribute value.
* Attr type is verified using an assertion.
@@ -206,7 +208,7 @@ class SC_CORE_EXPORT STEPattribute {
}
const char * Name() const;
const char * TypeName() const;
std::string TypeName() const;
BASE_TYPE Type() const;
BASE_TYPE NonRefType() const;
BASE_TYPE BaseType() const;
@@ -16,7 +16,7 @@
class STEPattribute;
#include <sc_export.h>
#include <SingleLinkList.h>
#include "clstepcore/SingleLinkList.h"
class STEPattributeList;
@@ -2,11 +2,11 @@
#define STEPCOMPLEX_H
#include <sc_export.h>
#include <errordesc.h>
#include <sdai.h>
#include <baseType.h>
#include <ExpDict.h>
#include <Registry.h>
#include "clutils/errordesc.h"
#include "clstepcore/sdai.h"
#include "clstepcore/baseType.h"
#include "clstepcore/ExpDict.h"
#include "clstepcore/Registry.h"
#include <list>
@@ -42,7 +42,14 @@ class SC_CORE_EXPORT STEPcomplex : public SDAI_Application_instance {
STEPcomplex * head;
Registry * _registry;
int visited; ///< used when reading (or as you wish?)
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
STEPcomplex_attr_data_list _attr_data_list; ///< attrs are created with a pointer to data; this stores them for deletion
#ifdef _MSC_VER
#pragma warning( pop )
#endif
public:
STEPcomplex( Registry * registry, int fileid );
STEPcomplex( Registry * registry, const std::string ** names, int fileid,
@@ -15,7 +15,7 @@
class Inverse_attribute;
#include <sc_export.h>
#include <SingleLinkList.h>
#include "clstepcore/SingleLinkList.h"
class STEPinvAttrList;
class EntityAggregate;
@@ -13,13 +13,20 @@
*/
#include <sc_export.h>
#include <errordesc.h>
#include "clutils/errordesc.h"
#include <string>
#include <read_func.h>
#include "clstepcore/read_func.h"
class SC_CORE_EXPORT SCLundefined {
protected:
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
std::string val;
#ifdef _MSC_VER
#pragma warning( pop )
#endif
public:
// INPUT
@@ -1,8 +1,8 @@
#ifndef SUB_SUPER_ITERATORS
#define SUB_SUPER_ITERATORS
#include "ExpDict.h"
#include "ExpDict.h"
#include "clstepcore/ExpDict.h"
#include "clstepcore/ExpDict.h"
#include <queue>
#include <assert.h>
@@ -2,7 +2,7 @@
#define AGGRTYPEDESCRIPTOR_H
#include "typeDescriptor.h"
#include "create_Aggr.h"
#include "clstepcore/create_Aggr.h"
#include "assert.h"
@@ -35,7 +35,14 @@ protected:
AggrBoundTypeEnum _bound1_type, _bound2_type;
boundCallbackFn _bound1_callback, _bound2_callback;
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable: 4251 )
#endif
std::string _bound1_str, _bound2_str;
#ifdef _MSC_VER
#pragma warning( pop )
#endif
public:
@@ -50,7 +57,7 @@ public:
AggrTypeDescriptor( const char * nm, PrimitiveType ft,
Schema * origSchema, const char * d,
AggregateCreator f = 0 )
: TypeDescriptor( nm, ft, origSchema, d ), _bound1( 0 ), _bound2( 0 ), _uniqueElements( 0 ), _aggrDomainType( NULL ), CreateNewAggr( f ) { }
: TypeDescriptor( nm, ft, origSchema, d ), _bound1( 0 ), _bound2( 0 ), _uniqueElements( 0 ), _aggrDomainType( NULL ), CreateNewAggr( f ), _bound1_type( bound_unset ), _bound2_type( bound_unset ), _bound1_callback( NULL ), _bound2_callback( NULL ) { }
virtual ~AggrTypeDescriptor();
@@ -3,7 +3,7 @@
#include "typeDescriptor.h"
#include "sdaiEnum.h"
#include "cldai/sdaiEnum.h"
#include "sc_export.h"
@@ -18,7 +18,7 @@
#include <iostream>
#include <fstream>
using namespace std;
#include "Str.h"
#include "clutils/Str.h"
#define LISTEND 999
/** \def LISTEND
@@ -132,7 +132,7 @@ class SC_CORE_EXPORT EntNode {
private:
MarkType mark;
char name[BUFSIZ];
char name[BUFSIZ+1];
bool multSupers; ///< do I correspond to an entity with >1 supertype?
EntNode * lastSmaller( EntNode * ); ///< used by ::sort()
};
@@ -173,26 +173,27 @@ class SC_CORE_EXPORT EntList {
// but all we need.
EntList * firstNot( JoinType );
EntList * nextNot( JoinType j ) {
return next->firstNot( j );
return ( next ) ? next->firstNot( j ) : NULL;
}
EntList * firstWanted( MatchType );
EntList * nextWanted( MatchType mat ) {
return next->firstWanted( mat );
return ( next ) ? next->firstWanted( mat ) : NULL;
}
EntList * lastNot( JoinType );
EntList * prevNot( JoinType j ) {
return prev->lastNot( j );
return ( prev ) ? prev->lastNot( j ) : NULL;
}
EntList * lastWanted( MatchType );
EntList * prevWanted( MatchType mat ) {
return prev->lastWanted( mat );
return ( prev ) ? prev->lastWanted( mat ) : NULL;
}
JoinType join;
int multiple() {
return ( join != SIMPLE );
}
EntList * next, *prev;
EntList * next = NULL;
EntList * prev = NULL;
protected:
MatchType viable;
@@ -237,7 +238,7 @@ class SC_CORE_EXPORT SimpleList : public EntList {
}
private:
char name[BUFSIZ]; ///< Name of entity we correspond to.
char name[BUFSIZ+1]; ///< Name of entity we correspond to.
MarkType I_marked; ///< Did I mark, and with what type of mark.
};
@@ -3,7 +3,7 @@
//typedef's for aggregate creators
#include "sdai.h"
#include "clstepcore/sdai.h"
#include "sc_export.h"
@@ -1,7 +1,7 @@
#ifndef DERIVEDATTRIBUTE_H
#define DERIVEDATTRIBUTE_H
#include "attrDescriptor.h"
#include "clstepcore/attrDescriptor.h"
#include "sc_export.h"

Some files were not shown because too many files have changed in this diff Show More