Implmenting Toolkit API versioning

This commit is contained in:
Michael Tryby
2018-11-29 11:57:51 -05:00
parent 9ff0056b7c
commit be2ca0a9f6
9 changed files with 2191 additions and 2055 deletions

View File

@@ -2,12 +2,12 @@
cmake_minimum_required (VERSION 3.0.2)
# Sets for output directory for executables and libraries.
# 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.
# Sets the position independent code property for all targets.
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@@ -22,7 +22,7 @@ add_definitions(-DWITH_GENX)
# Creates the EPANET command line executable
add_executable(runepanet ${EPANET_CLI_SOURCES})
if(NOT WIN32)
target_link_libraries(runepanet LINK_PUBLIC epanet m)
target_link_libraries(runepanet LINK_PUBLIC epanet2 m)
else(NOT WIN32)
target_link_libraries(runepanet LINK_PUBLIC epanet)
target_link_libraries(runepanet LINK_PUBLIC epanet2)
endif(NOT WIN32)

View File

@@ -1,9 +1,25 @@
/*
******************************************************************************
Project: OWA EPANET
Version: 2.2
Module: main.c
Description: implementation of the CLI for EPANET
Authors: see AUTHORS
Copyright: see AUTHORS
License: see LICENSE
Last Updated: 11/27/2018
******************************************************************************
*/
#include <stdio.h>
#include <string.h>
#include "epanet2.h"
#include "epanet2_1.h"
#define MAXMSG 255 /* Max. # characters in message text */
#define MAXWARNCODE 99
#define MAXWARNCODE 99
/* text copied here, no more need of include "text.h" */
#define FMT01 "\nEPANET Version %d.%d.%d\n"
#define FMT03 "\nUsage:\n %s <input_filename> <report_filename> [<binary_filename>]\n"
@@ -54,7 +70,7 @@ int main(int argc, char *argv[])
minor= (version%10000)/100;
patch= version%100;
printf(FMT01, major, minor, patch);
/* Check for proper number of command line arguments */
if (argc < 2) {
printf(FMT03, argv[0]);