Hello,
Does anybody know to create a configuration script in order to run CMake with cobol files ?
I would like to create a CMakeLists.txt files with our project. And I can't manage to call the cob command for the compiler with CMake.
I thank you for your suggestions.
Best regards,
Alain Reymond
Hello Alain:
This is the first I've heard of CMake. It seems interesting -- open source, freeware, for the purpose of creating platform-independent make or build strategies. Nowadays the trend seems to be to use Apache Ant for such purposes, though perhaps Ant is more suited to Java, whereas CMake is more suited to C/C . A search of Micro Focus historical support incidents shows that no other MF customer has yet asked about it.
By what I've just read of the CMake documentation, it will be complicated to adopt for use with Server Express and the "cob" command, because the CMake commands "add_executable" and "add_library" assume target executables and libraries will be created using the system linker "ld", whereas for Server Express, executables must be created using "cob -x" (which does actually invoke "ld" behind the scenes), and libraries should be built using "cob -Z" (which also invokes "ld"). There seems no way to force "add_executable" and "add_library" to invoke "cob -x" and "cob -Z"; this ostensibly rules out the use of these CMake commands.
The most likely alternative seems to be CMake "add_custom_command", whereby you could successfully specify "cob -x" or "cob -Z" (or "cob -u" for .gnt files), and where for the command arguments, you could use the CMake "generator expressions" with the syntax "$<...>".
Have you yet tried "add_custom_command"? If so, and it hasn't worked, please send a simplified but representative example of the syntax you're trying, and I'll study it and make suggestions.
Best,
Dan
Hello,
Does anybody know to create a configuration script in order to run CMake with cobol files ?
I would like to create a CMakeLists.txt files with our project. And I can't manage to call the cob command for the compiler with CMake.
I thank you for your suggestions.
Best regards,
Alain Reymond
P. S. Alain, I've answered this question in the context of Server Express (i.e. MF COBOL for Linux/Unix) and its accompanying "cob" command.
But were you more interested in Net Express (i.e. MF COBOL for Windows) and its "cbllink" command?
Hello,
Does anybody know to create a configuration script in order to run CMake with cobol files ?
I would like to create a CMakeLists.txt files with our project. And I can't manage to call the cob command for the compiler with CMake.
I thank you for your suggestions.
Best regards,
Alain Reymond
Hello Dan,
We use Server Express, so it is in this context.
I'll have a look at your suggestions. CMake has been configured to work with many compilers. There is a configuration for Fortran, even Ada. But I these compilers use gcc behind the scene.
I suppose that a configuration for cobol can be done. I have not yet tried the "add_custom_command". I'll try, when I find a few hours!!!
Thank you for your answer.
Best regards,
Alain