Skip to content

Commit f219479

Browse files
committed
- initial commit
1 parent ada07aa commit f219479

File tree

1,851 files changed

+1304481
-43
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,851 files changed

+1304481
-43
lines changed

.gitignore

+7-43
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,7 @@
1-
# Windows image file caches
2-
Thumbs.db
3-
ehthumbs.db
4-
5-
# Folder config file
6-
Desktop.ini
7-
8-
# Recycle Bin used on file shares
9-
$RECYCLE.BIN/
10-
11-
# Windows Installer files
12-
*.cab
13-
*.msi
14-
*.msm
15-
*.msp
16-
17-
# Windows shortcuts
18-
*.lnk
19-
20-
# =========================
21-
# Operating System Files
22-
# =========================
23-
24-
# OSX
25-
# =========================
26-
27-
.DS_Store
28-
.AppleDouble
29-
.LSOverride
30-
31-
# Thumbnails
32-
._*
33-
34-
# Files that might appear on external disk
35-
.Spotlight-V100
36-
.Trashes
37-
38-
# Directories potentially created on remote AFP share
39-
.AppleDB
40-
.AppleDesktop
41-
Network Trash Folder
42-
Temporary Items
43-
.apdisk
1+
/build32
2+
/build64
3+
/build
4+
/release
5+
/dist
6+
/install*
7+
/vs*

CMakeLists.txt

+286
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
###############################################################################
2+
#
3+
# Description : CMake build script for libSBML dependencies
4+
# Original author(s): Frank Bergmann <fbergman@caltech.edu>
5+
# Organization : California Institute of Technology
6+
#
7+
# This file is part of libSBML. Please visit http://sbml.org for more
8+
# information about SBML, and the latest version of libSBML.
9+
#
10+
# Copyright 2005-2011 California Institute of Technology.
11+
# Copyright 2002-2005 California Institute of Technology and
12+
# Japan Science and Technology Corporation.
13+
#
14+
# This library is free software; you can redistribute it and/or modify it
15+
# under the terms of the GNU Lesser General Public License as published by
16+
# the Free Software Foundation. A copy of the license agreement is provided
17+
# in the file named "LICENSE.txt" included with this software distribution
18+
# and also available online as http://sbml.org/software/libsbml/license.html
19+
#
20+
###############################################################################
21+
22+
cmake_minimum_required(VERSION 2.8)
23+
project(libsbml_dependencies)
24+
25+
include (CMakeTestCCompiler)
26+
include (CheckCSourceCompiles)
27+
include (CheckCXXSourceCompiles)
28+
include (CheckStructHasMember)
29+
include (CheckLibraryExists)
30+
include (CheckFunctionExists)
31+
include (CheckCCompilerFlag)
32+
include (CheckCSourceRuns)
33+
include (CheckSymbolExists)
34+
include (CheckTypeSize)
35+
36+
37+
###############################################################################
38+
#
39+
# Parse VERSION.txt to determine the package version
40+
#
41+
SET(DEPENDENCIES_VERSION_MAJOR)
42+
SET(DEPENDENCIES_VERSION_MINOR)
43+
SET(DEPENDENCIES_VERSION_PATCH)
44+
SET(DEPENDENCIES_VERSION_RELEASE)
45+
46+
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt")
47+
48+
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt" VersionString NEWLINE_CONSUME)
49+
string(STRIP "${VersionString}" VersionString)
50+
string(REPLACE "." ";" VersionString "${VersionString}" )
51+
string(REPLACE "-" ";" VersionString "${VersionString}" )
52+
list(LENGTH VersionString versionLength)
53+
list(GET VersionString 0 DEPENDENCIES_VERSION_MAJOR )
54+
list(GET VersionString 1 DEPENDENCIES_VERSION_MINOR )
55+
list(GET VersionString 2 DEPENDENCIES_VERSION_PATCH )
56+
57+
if (${versionLength} GREATER 3)
58+
list(GET VersionString 3 DEPENDENCIES_VERSION_RELEASE )
59+
endif()
60+
61+
endif()
62+
63+
SET(PACKAGE_VERSION "${DEPENDENCIES_VERSION_MAJOR}.${DEPENDENCIES_VERSION_MINOR}.${DEPENDENCIES_VERSION_PATCH}-${DEPENDENCIES_VERSION_RELEASE}")
64+
65+
###############################################################################
66+
#
67+
# the next lines configure the parameters for packaging the binaries
68+
# they can be invoked with: make package / nmake package or by using
69+
# cpack -G zip|deb|rpm|dmg|nsis
70+
#
71+
72+
INCLUDE(InstallRequiredSystemLibraries)
73+
74+
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Dependencies for libsbml (bz2, check, expat, iconv, libxml2, xerces-c, zlib")
75+
SET(CPACK_PACKAGE_NAME "libSBML Dependencies")
76+
SET(CPACK_PACKAGE_VENDOR "The SBML Team")
77+
SET(CPACK_PACKAGE_CONTACT "LibSBML Team <libsbml-team@caltech.edu>")
78+
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
79+
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.txt")
80+
81+
# version for this dependencies release
82+
SET(CPACK_PACKAGE_VERSION_MAJOR "${DEPENDENCIES_VERSION_MAJOR}")
83+
SET(CPACK_PACKAGE_VERSION_MINOR "${DEPENDENCIES_VERSION_MINOR}")
84+
SET(CPACK_PACKAGE_VERSION_PATCH "${DEPENDENCIES_VERSION_PATCH}")
85+
SET(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}")
86+
87+
INCLUDE(CPack)
88+
89+
90+
91+
92+
###############################################################################
93+
#
94+
# Here we have the main configuration options for libsbml
95+
#
96+
97+
# build static / shared library
98+
option(BUILD_SHARED_LIBS "Build shared library (Set to OFF to build static libraries)" OFF)
99+
100+
# choose the xml parsing library to be used
101+
option(WITH_BZIP2 "Compile BZ2 compression library" ON )
102+
option(WITH_CHECK "Compile libcheck unit test library" ON )
103+
option(WITH_EXPAT "Compile Expat XML parser" ON )
104+
option(WITH_ZLIB "Compile zlib compression library" ON )
105+
106+
if (WITH_BZIP2)
107+
add_subdirectory(bzip2)
108+
endif()
109+
110+
if (WITH_CHECK)
111+
add_subdirectory(check)
112+
endif()
113+
114+
if (WITH_EXPAT)
115+
add_subdirectory(expat)
116+
endif()
117+
118+
119+
if (WIN32)
120+
option(WITH_XERCES "Compile xerces XML parser" ON )
121+
option(WITH_ICONV "Compile libiconv" ON )
122+
option(WITH_LIBXML "Compile libxml XML parser" ON )
123+
124+
if (WITH_ICONV)
125+
add_subdirectory(libiconv)
126+
endif()
127+
128+
if (WITH_LIBXML)
129+
add_subdirectory(libxml2)
130+
endif()
131+
132+
133+
if (WITH_XERCES)
134+
add_subdirectory(xerces-c)
135+
endif()
136+
endif()
137+
138+
if (WITH_ZLIB)
139+
add_subdirectory(zlib)
140+
endif()
141+
142+
143+
###############################################################################
144+
# misc variables
145+
#
146+
147+
if(UNIX)
148+
set(PATH_SEP "/")
149+
set(FILE_SEP ":")
150+
else()
151+
set(PATH_SEP "\\")
152+
set(FILE_SEP ";")
153+
endif()
154+
155+
###############################################################################
156+
#
157+
# Set up remaining variables, add option for universal binaries
158+
#
159+
set(BUILD_DEFINITIONS)
160+
if(UNIX)
161+
if(APPLE)
162+
add_definitions(-DMACOSX)
163+
set(BUILD_DEFINITIONS "${BUILD_DEFINITIONS} -DMACOSX")
164+
165+
# On OSX it is common to build universal binaries to support multiple
166+
# processor architectures. The default behavior is not to build
167+
# multiple architectures, as most users might not need that.
168+
option(ENABLE_UNIVERSAL "Create Universal Binaries" OFF)
169+
170+
set(CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}" CACHE STRING "A semicolon separated list of build architectures to be used")
171+
if(ENABLE_UNIVERSAL)
172+
# if universal binaries are requested and none defined so far
173+
# overwrite them with all three common architectures. If the user
174+
# specified their own list of architectures do not touch!
175+
if (CMAKE_OSX_ARCHITECTURES STREQUAL "")
176+
set(CMAKE_OSX_ARCHITECTURES "i386;ppc;x86_64" CACHE STRING "A semicolon separated list of build architectures to be used" FORCE)
177+
endif()
178+
endif(ENABLE_UNIVERSAL)
179+
else(APPLE)
180+
add_definitions(-DLINUX)
181+
182+
if (NOT CYGWIN)
183+
# on cygwin all code is position independent so -fPIC is not needed
184+
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fPIC")
185+
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fPIC")
186+
endif()
187+
188+
set(BUILD_DEFINITIONS "${BUILD_DEFINITIONS} -DLINUX")
189+
endif(APPLE)
190+
191+
add_definitions( -DPACKAGE_VERSION=\"${PACKAGE_VERSION}\" -DPACKAGE_NAME=\"${PROJECT_NAME}\")
192+
set(BUILD_DEFINITIONS "${BUILD_DEFINITIONS} -DPACKAGE_VERSION=\"${PACKAGE_VERSION}\" -DPACKAGE_NAME=\"${PROJECT_NAME}\"")
193+
194+
else(UNIX)
195+
add_definitions(-DWIN32 -DLIBSBML_EXPORTS -DLIBLAX_EXPORTS)
196+
set(BUILD_DEFINITIONS "${BUILD_DEFINITIONS} -DWIN32 -DLIBSBML_EXPORTS -DLIBLAX_EXPORTS")
197+
if(MSVC)
198+
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
199+
set(BUILD_DEFINITIONS "${BUILD_DEFINITIONS} -D_CRT_SECURE_NO_WARNINGS")
200+
option(WITH_STATIC_RUNTIME "Compile using the static MSVC Runtime" OFF)
201+
if (WITH_STATIC_RUNTIME)
202+
foreach(flag_var
203+
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
204+
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
205+
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
206+
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
207+
208+
if(${flag_var} MATCHES "/MD")
209+
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
210+
endif(${flag_var} MATCHES "/MD")
211+
212+
213+
endforeach(flag_var)
214+
add_definitions( -D_MT)
215+
endif(WITH_STATIC_RUNTIME)
216+
217+
218+
# CMake no longer creates PDB files for static libraries after 2.8.11
219+
# so we store debug information in the object files instead
220+
if (${CMAKE_VERSION} VERSION_GREATER "2.8.11")
221+
foreach(flag_var
222+
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
223+
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
224+
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
225+
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
226+
227+
if(${flag_var} MATCHES "/Zi")
228+
STRING(REPLACE "/Zi" "/Z7" "${flag_var}" "${${flag_var}}")
229+
endif(${flag_var} MATCHES "/Zi")
230+
231+
endforeach(flag_var)
232+
endif()
233+
234+
file(GLOB WIN32_BINARIES ${CMAKE_SOURCE_DIR}/dependencies/bin/*.dll)
235+
INSTALL(FILES ${WIN32_BINARIES} DESTINATION bin)
236+
237+
elseif(CYGWIN)
238+
add_definitions(-DCYGWIN)
239+
set(BUILD_DEFINITIONS "${BUILD_DEFINITIONS} -DCYGWIN")
240+
elseif(MINGW)
241+
if(WITH_LIBXML)
242+
# this is necessary to build with libxml2 on mingw
243+
add_definitions(-DLIBXML_STATIC)
244+
endif(WITH_LIBXML)
245+
endif(MSVC)
246+
247+
endif(UNIX)
248+
249+
###############################################################################
250+
#
251+
# Disable in-source build
252+
#
253+
254+
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}" )
255+
message(FATAL_ERROR "In-source builds have been disabled. Please create a separate build directory.")
256+
endif()
257+
258+
259+
260+
if (CMAKE_BUILD_TYPE STREQUAL "")
261+
# CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up
262+
# differentiation between debug and release builds.
263+
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
264+
endif ()
265+
266+
if (NOT UNIX)
267+
# Create debug libraries with _d postfix
268+
set(CMAKE_DEBUG_POSTFIX "_d")
269+
endif ()
270+
271+
272+
if (APPLE)
273+
if (CMAKE_OSX_ARCHITECTURES STREQUAL "")
274+
message(STATUS " Building universal binaries = no (using native arch)")
275+
else()
276+
list(REMOVE_DUPLICATES CMAKE_OSX_ARCHITECTURES)
277+
list(REMOVE_ITEM CMAKE_OSX_ARCHITECTURES "")
278+
list(SORT CMAKE_OSX_ARCHITECTURES)
279+
list(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
280+
if (NUMARCHS EQUAL 1)
281+
message(STATUS " Building universal binaries = no (using ${CMAKE_OSX_ARCHITECTURES})")
282+
else()
283+
message(STATUS " Building universal binaries = yes (using ${CMAKE_OSX_ARCHITECTURES})")
284+
endif()
285+
endif()
286+
endif()

0 commit comments

Comments
 (0)