Merging latest from dev, trying to get import lib generated

This commit is contained in:
Michael Tryby
2018-07-03 17:38:40 -04:00
73 changed files with 3622 additions and 16583 deletions

27
run/CMakeLists.txt Normal file
View File

@@ -0,0 +1,27 @@
# EPANET COMMAND LINE EXECUTABLE
cmake_minimum_required (VERSION 3.0.2)
# Sets for output directory for executables and libraries.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# Sets the position independent code property for all targets.
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Set up file groups for exe target
set(EPANET_CLI_SOURCES main.c)
include_directories(include)
source_group("CLI" FILES ${EPANET_CLI_SOURCES})
# Creates the EPANET command line executable
add_executable(runepanet ${EPANET_CLI_SOURCES})
if(NOT WIN32)
target_link_libraries(runepanet LINK_PUBLIC epanet m)
else(NOT WIN32)
target_link_libraries(runepanet LINK_PUBLIC epanet)
endif(NOT WIN32)

View File

@@ -5,9 +5,9 @@
#define MAXMSG 255 /* Max. # characters in message text */
#define MAXWARNCODE 99
/* text copied here, no more need of include "text.h" */
#define FMT01 "\nEPANET Version %d.%d.%d\n"
#define FMT01 "\nEPANET Version %d.%d.%d"
#define FMT03 "\n Correct syntax is:\n %s <input file> <output file>\n"
#define FMT09 "\nEPANET completed.\n"
#define FMT09 "\n\nEPANET completed."
#define FMT10 "\nEPANET completed. There are warnings."
#define FMT11 "\nEPANET completed. There are errors."
@@ -87,7 +87,8 @@ int main(int argc, char *argv[])
/* Call the main control function */
if (strlen(f2)> 0) {
/* use stdout for progress messages */
errcode = ENepanet(f1,f2,f3,writeConsole);
//errcode = ENepanet(f1,f2,f3,writeConsole);
errcode = ENepanet(f1, f2, f3, NULL);
}
else {
/* use stdout for reporting, no progress messages */
@@ -101,21 +102,21 @@ int main(int argc, char *argv[])
return(0);
}
else {
if (errcode > MAXWARNCODE) printf("\n Fatal Error: ");
ENgeterror(errcode, errmsg, MAXMSG);
writeConsole(errmsg);
if (errcode > MAXWARNCODE) {
/* error */
// error //
writeConsole(FMT11);
return(errcode);
}
else {
/* warning */
// warning //
writeConsole(FMT10);
return(0);
}
}
} /* End of main */