ncmscm.cmake 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. ################################################################################
  2. # Copyright (C) 2011 HPCC Systems.
  3. #
  4. # All rights reserved. This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU Affero General Public License as
  6. # published by the Free Software Foundation, either version 3 of the
  7. # License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU Affero General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU Affero General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. ################################################################################
  17. #####################################################
  18. # Description:
  19. # ------------
  20. # Cmake include file ncm scm file generation
  21. #####################################################
  22. set ( ESPSCM_SOURCE_DIR ${HPCC_SOURCE_DIR}/esp/scm )
  23. set ( ESPSCM_GENERATED_DIR ${CMAKE_BINARY_DIR}/generated )
  24. GET_TARGET_PROPERTY(HIDL_EXE hidl LOCATION)
  25. GET_TARGET_PROPERTY(ESDL_EXE esdl LOCATION)
  26. set ( ECMCSM_SRCS
  27. ws_riskwise.ncm
  28. ws_riskwise_wsidentity.ncm
  29. wsm_riskwise1.ncm
  30. wsm_riskwise2.ncm
  31. wsm_riskwise3.ncm
  32. )
  33. foreach ( loop_var ${ESPSCM_SRCS} )
  34. string( REGEX REPLACE "[.]ncm" "" result ${loop_var} )
  35. add_custom_command ( DEPENDS hidl ${ESPSCM_SOURCE_DIR}/${loop_var}
  36. OUTPUT ${ESPSCM_GENERATED_DIR}/${result}.esp ${ESPSCM_GENERATED_DIR}/${result}.hpp ${ESPSCM_GENERATED_DIR}/${result}.int ${ESPSCM_GENERATED_DIR}/${result}.ipp ${ESPSCM_GENERATED_DIR}/${result}_esp.cpp ${ESPSCM_GENERATED_DIR}/${result}_esp.ipp ${ESPSCM_GENERATED_DIR}/${result}_esp_ng.cpp ${ESPSCM_GENERATED_DIR}/${result}_esp_ng.ipp
  37. COMMAND ${HIDL_EXE} ${ESPSCM_SOURCE_DIR}/${result}.ncm ${ESPSCM_GENERATED_DIR}
  38. )
  39. add_custom_command ( DEPENDS esdl ${ESPSCM_SOURCE_DIR}/${loop_var}
  40. OUTPUT ${ESPSCM_GENERATED_DIR}/${result}.xml
  41. COMMAND ${ESDL_EXE} ${ESPSCM_SOURCE_DIR}/${result}.ecm ${ESPSCM_GENERATED_DIR}
  42. )
  43. set_source_files_properties(${ESPSCM_GENERATED_DIR}/${result}.esp PROPERTIES ESPSCM_GENERATED_DIR TRUE)
  44. set_source_files_properties(${ESPSCM_GENERATED_DIR}/${result}.hpp PROPERTIES ESPSCM_GENERATED_DIR TRUE)
  45. set_source_files_properties(${ESPSCM_GENERATED_DIR}/${result}.int PROPERTIES ESPSCM_GENERATED_DIR TRUE)
  46. set_source_files_properties(${ESPSCM_GENERATED_DIR}/${result}.ipp PROPERTIES ESPSCM_GENERATED_DIR TRUE)
  47. set_source_files_properties(${ESPSCM_GENERATED_DIR}/${result}_esp.cpp PROPERTIES ESPSCM_GENERATED_DIR TRUE)
  48. set_source_files_properties(${ESPSCM_GENERATED_DIR}/${result}_esp.ipp PROPERTIES ESPSCM_GENERATED_DIR TRUE)
  49. set_source_files_properties(${ESPSCM_GENERATED_DIR}/${result}_esp_ng.cpp PROPERTIES ESPSCM_GENERATED_DIR TRUE)
  50. set_source_files_properties(${ESPSCM_GENERATED_DIR}/${result}_esp_ng.ipp PROPERTIES ESPSCM_GENERATED_DIR TRUE)
  51. set_source_files_properties(${ESPSCM_GENERATED_DIR}/${result}.xml PROPERTIES ESPSCM_GENERATED_DIR TRUE)
  52. endforeach ( loop_var ${ESPECM_SRCS} )
  53. include_directories ( ${ESPSCM_GENERATED_DIR} )