Merge branch 'dev' into dev-decouple

This commit is contained in:
Michael Tryby
2018-03-21 15:53:08 -04:00
committed by GitHub
11 changed files with 512 additions and 22 deletions

View File

@@ -0,0 +1,40 @@
#
# CMakeLists.txt - CMake configuration file for epanet-output library
#
# Created: March 9, 2018
# Author: Michael E. Tryby
# US EPA ORD/NRMRL
#
cmake_minimum_required (VERSION 3.0)
# 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)
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# configure file groups
set(EPANET_OUT_SOURCES src/epanet_output.c src/errormanager.c)
# the binary output file API
add_library(epanet-output SHARED ${EPANET_OUT_SOURCES})
target_include_directories(epanet-output PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
include(GenerateExportHeader)
generate_export_header(epanet-output
BASE_NAME epanet_output
EXPORT_MACRO_NAME DLLEXPORT
EXPORT_FILE_NAME epanet_output_export.h
STATIC_DEFINE SHARED_EXPORTS_BUILT_AS_STATIC)
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/epanet_output_export.h DESTINATION
${CMAKE_CURRENT_SOURCE_DIR}/include)

View File

@@ -61,15 +61,19 @@ typedef enum {
} ENR_LinkAttribute;
#ifdef WINDOWS
#ifdef __cplusplus
#define DLLEXPORT __declspec(dllexport) __cdecl
#else
#define DLLEXPORT __declspec(dllexport) __stdcall
#endif
#else
#define DLLEXPORT
#endif
// #ifdef WINDOWS
// #ifdef __cplusplus
// #define DLLEXPORT __declspec(dllexport) __cdecl
// #else
// #define DLLEXPORT __declspec(dllexport) __stdcall
// #endif
// #else
// #define DLLEXPORT
// #endif
#include "epanet_output_export.h"
#ifdef __cplusplus
extern "C" {

View File

@@ -25,6 +25,8 @@ setup(
version = "0.1.0-alpha",
ext_modules = [
Extension("_epanet_output",
define_macros = [('epanet_output_EXPORTS', None)],
include_dirs = ['include'],
sources = ['src/epanet_output.i', 'src/epanet_output.c', 'src/errormanager.c'],
swig_opts=['-modern'],
language = 'C'

View File

@@ -11,6 +11,7 @@
# $ pip install --src build/packages -r tools/requirements.txt
#
-e git+https://github.com/OpenWaterAnalytics/nrtest.git@master#egg=nrtest
#-e git+https://github.com/OpenWaterAnalytics/nrtest.git@master#egg=nrtest
nrtest>=0.2.3
-e ./tools/epanet-output
-e ./tools/nrtest-epanet