Skip to content

Commit b577099

Browse files
committed
- ensure crosscompiling works with libsedml
1 parent 59db0be commit b577099

File tree

9 files changed

+53
-18
lines changed

9 files changed

+53
-18
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ libsedml/_*
173173
examples/python/*.xml
174174
dev/temp_deviser_file.xml
175175
setup.py
176+
MANIFEST.in
176177

177178
# documentation
178179
/doc/html/

CMakeModules/FindEXPAT.cmake

+8-4
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ find_path(EXPAT_INCLUDE_DIR expat.h
4848
/opt/csw/include # Blastwave
4949
/opt/include
5050
/usr/freeware/include
51-
NO_DEFAULT_PATH)
51+
NO_DEFAULT_PATH
52+
CMAKE_FIND_ROOT_PATH_BOTH)
5253
endif ()
5354

5455
if (NOT EXPAT_INCLUDE_DIR)
55-
find_path(EXPAT_INCLUDE_DIR expat.h)
56+
find_path(EXPAT_INCLUDE_DIR expat.h
57+
CMAKE_FIND_ROOT_PATH_BOTH)
5658
endif ()
5759

5860
find_library(EXPAT_LIBRARY
@@ -81,11 +83,13 @@ find_library(EXPAT_LIBRARY
8183
/opt/csw/lib # Blastwave
8284
/opt/lib
8385
/usr/freeware/lib64
84-
NO_DEFAULT_PATH)
86+
NO_DEFAULT_PATH
87+
CMAKE_FIND_ROOT_PATH_BOTH)
8588
endif()
8689

8790
if (NOT EXPAT_LIBRARY)
88-
find_library(EXPAT_LIBRARY NAMES libexpat expat)
91+
find_library(EXPAT_LIBRARY NAMES libexpat expat
92+
CMAKE_FIND_ROOT_PATH_BOTH )
8993
endif ()
9094

9195
mark_as_advanced(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)

CMakeModules/FindLIBNUML.cmake

+5-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if (NOT ${LIBNUML_LIBRARY_NAME}_FOUND)
3434
${CONAN_LIB_DIRS_LIBNUML}/cmake
3535
${${_PROJECT_DEPENDENCY_DIR}}/lib/cmake
3636
${${_PROJECT_DEPENDENCY_DIR}}/lib64/cmake
37+
CMAKE_FIND_ROOT_PATH_BOTH
3738
)
3839
endif()
3940

@@ -90,7 +91,8 @@ find_path(LIBNUML_INCLUDE_DIR numl/NMBase.h
9091
/opt/csw/include # Blastwave
9192
/opt/include
9293
/usr/freeware/include
93-
NO_DEFAULT_PATH)
94+
NO_DEFAULT_PATH
95+
CMAKE_FIND_ROOT_PATH_BOTH)
9496

9597
if (NOT LIBNUML_INCLUDE_DIR)
9698
find_path(LIBNUML_INCLUDE_DIR numl/NMBase.h)
@@ -117,7 +119,8 @@ find_library(LIBNUML_LIBRARY
117119
/opt/csw/lib # Blastwave
118120
/opt/lib
119121
/usr/freeware/lib64
120-
NO_DEFAULT_PATH)
122+
NO_DEFAULT_PATH
123+
CMAKE_FIND_ROOT_PATH_BOTH)
121124

122125
if (NOT LIBNUML_LIBRARY)
123126
find_library(LIBNUML_LIBRARY

CMakeModules/FindLIBSBML.cmake

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the
1+
# Copyright (C) 2019 - 2023 by Pedro Mendes, Rector and Visitors of the
22
# University of Virginia, University of Heidelberg, and University
33
# of Connecticut School of Medicine.
44
# All rights reserved.
@@ -33,11 +33,21 @@ endif()
3333

3434
message (VERBOSE "Looking for ${LIBSBML_LIBRARY_NAME}")
3535

36-
find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET)
3736

3837
string(TOUPPER ${PROJECT_NAME} _UPPER_PROJECT_NAME)
3938
set(_PROJECT_DEPENDENCY_DIR ${_UPPER_PROJECT_NAME}_DEPENDENCY_DIR)
4039

40+
find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET
41+
PATHS ${${_PROJECT_DEPENDENCY_DIR}}/lib/cmake
42+
${${_PROJECT_DEPENDENCY_DIR}}/lib64/cmake
43+
${CONAN_LIB_DIRS_LIBSBML}/cmake
44+
CMAKE_FIND_ROOT_PATH_BOTH
45+
NO_DEFAULT_PATH)
46+
47+
if (NOT ${LIBSBML_LIBRARY_NAME}_FOUND)
48+
find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET)
49+
endif()
50+
4151
if (NOT ${LIBSBML_LIBRARY_NAME}_FOUND)
4252
find_package(${LIBSBML_LIBRARY_NAME} CONFIG QUIET
4353
PATHS /usr/lib/cmake
@@ -48,6 +58,7 @@ if (NOT ${LIBSBML_LIBRARY_NAME}_FOUND)
4858
${${_PROJECT_DEPENDENCY_DIR}}/lib/cmake
4959
${${_PROJECT_DEPENDENCY_DIR}}/lib64/cmake
5060
${CONAN_LIB_DIRS_LIBSBML}/cmake
61+
CMAKE_FIND_ROOT_PATH_BOTH
5162
)
5263
endif()
5364

@@ -111,6 +122,7 @@ find_path(LIBSBML_INCLUDE_DIR sbml/SBase.h
111122
/opt/csw/include # Blastwave
112123
/opt/include
113124
/usr/freeware/include
125+
CMAKE_FIND_ROOT_PATH_BOTH
114126
NO_DEFAULT_PATH)
115127

116128
if (NOT LIBSBML_INCLUDE_DIR)
@@ -140,6 +152,7 @@ find_library(LIBSBML_LIBRARY
140152
/opt/csw/lib # Blastwave
141153
/opt/lib
142154
/usr/freeware/lib64
155+
CMAKE_FIND_ROOT_PATH_BOTH
143156
NO_DEFAULT_PATH)
144157

145158
if (NOT LIBSBML_LIBRARY)

dev/create-source-package.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# this script creates the python source package
4+
cp ./src/bindings/python/setup.py .
5+
cp ./src/bindings/python/MANIFEST.in .
6+
7+
# remove old source packages
8+
rm ./dist/*.tar.gz
9+
10+
# create the source package
11+
python3 setup.py sdist

src/bindings/python/setup.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,18 @@
3636
from setuptools import setup, Extension
3737
from setuptools.command.build_ext import build_ext
3838

39-
def get_python_include():
40-
dir = sysconfig.get_paths()['include']
41-
if exists(dir):
42-
return dir
43-
dir = dir.replace('/local', '/')
44-
if exists(dir):
45-
return dir
39+
def get_python_include():
40+
temp = os.getenv('PYTHON_INCLUDE_DIR')
41+
if temp:
42+
return temp
43+
44+
path = sysconfig.get_paths()['include']
45+
if exists(path):
46+
return path
47+
# for whatever reason 2.7 on centos returns a wrong path here
4648
return sysconfig.get_config_vars()['INCLUDEPY']
4749

50+
4851
def get_win_python_lib():
4952
vars = sysconfig.get_config_vars()
5053
for k in ['prefix', 'installed_base', 'installed_platbase']:

submodules/libSBML

Submodule libSBML updated 497 files

0 commit comments

Comments
 (0)