-## -------------------------------------------------------------------------
-FUNCTION(
- CompileInstances
- out_lib_name
- def_file
- number_of_files
- )
-
-### -- Configure inputs to be cmake-path compatible
-SET(_src_dir ${CMAKE_CURRENT_SOURCE_DIR})
-SET(_bin_dir ${CMAKE_CURRENT_BINARY_DIR})
-SET(_def_file "${_src_dir}/${def_file}")
-
-## -- Infere source code filenames
-MATH(EXPR _last_range "${number_of_files}-1")
-SET(_out_code "${_bin_dir}/${out_lib_name}.h")
-FOREACH(_n RANGE 0 ${_last_range})
- LIST(APPEND _out_code ${_bin_dir}/${out_lib_name}_${_n}.cxx)
-ENDFOREACH(_n)
-
-## -- Command to write source code
-ADD_CUSTOM_COMMAND(
- OUTPUT ${_out_code}
- DEPENDS ${cpPlugins_bash_CreateInstances_APP} ${_def_file}
- COMMAND ${cpPlugins_bash_CreateInstances_APP} ${_def_file} ${out_lib_name} ${_bin_dir} ${number_of_files}
- )
-
-## -- Create library
-CreateLib(${out_lib_name} SHARED "${_out_code}")
-
-ENDFUNCTION()
-