forked from libsbmlsim/libsbmlsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
128 lines (106 loc) · 4.29 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
cmake_minimum_required(VERSION 2.8.12)
project(libsbmlsim)
# version number
file(STRINGS VERSION.txt PACKAGE_VERSION)
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\..*$" "\\1.\\2" PACKAGE_COMPAT_VERSION "${PACKAGE_VERSION}")
# cmake variables
if(MSVC)
add_definitions(/W3)
else(MSVC)
# add_definitions(-Wall -Wextra -ansi -pedantic -fno-strict-aliasing)
add_definitions(-Wall -Wextra -fno-strict-aliasing)
endif(MSVC)
# enable @rpath in the install name for any shared library being built
set(CMAKE_MACOSX_RPATH 1)
# build mode
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
# language bindings
option(WITH_JAVA "Generate Java language bindings." OFF)
option(WITH_PYTHON "Generate Python language bindings." OFF)
option(WITH_CSHARP "Generate C# language bindings." OFF)
if(NOT WIN32)
# option(WITH_PERL "Generate Perl language bindings." OFF)
option(WITH_RUBY "Generate Ruby language bindings." OFF)
endif(NOT WIN32)
# debug options
option(DEBUG_PRINT "Enable debug-print (only for developers)" OFF)
option(DEBUG_MEMORY "Enable debug-memory (only for developers)" OFF)
option(PROGRESS_PRINT "Enable progress-print (only for developers)" OFF)
if(NOT MSVC)
if(CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-g -O0)
SET(DEBUG_MEMORY ON)
else(CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-O3)
endif(CMAKE_BUILD_TYPE MATCHES Debug)
endif(NOT MSVC)
if(DEBUG_PRINT)
add_definitions(-DDEBUG_PRINT)
endif(DEBUG_PRINT)
if(DEBUG_MEMORY)
add_definitions(-DDEBUG_MEMORY)
endif(DEBUG_MEMORY)
if(PROGRESS_PRINT)
add_definitions(-DPROGRESS_PRINT)
endif(PROGRESS_PRINT)
# - Try to find libSBML
# Once done this will define
# LIBSBML_FOUND - System has libSBML
# LIBSBML_INCLUDE_DIRS - The libSBML include directories
# LIBSBML_LIBRARIES - The libraries needed to use libSBML
# LIBSBML_DEFINITIONS - Compiler switches required for using libSBML
find_package(PkgConfig)
pkg_check_modules(PC_LIBSBML QUIET libsbml)
set(LIBSBML_DEFINITIONS ${PC_LIBSBML_CFLAGS_OTHER})
find_path(LIBSBML_INCLUDE_DIR
NAMES sbml/SBMLTypes.h
PATHS ENV C_INCLUDE_PATH
/usr/include /usr/local/include /opt/local/include
${CMAKE_SOURCE_DIR}/depend/include
HINTS ${PC_LIBSBML_INCLUDEDIR} ${PC_LIBSBML_INCLUDE_DIRS} )
find_library(LIBSBML_LIBRARY
NAMES libsbml.lib sbml
PATHS ENV DYLD_LIBRARY_PATH
ENV LD_LIBRARY_PATH
/usr/lib /usr/local/lib /opt/local/lib
${CMAKE_SOURCE_DIR}/depend/lib
HINTS ${PC_LIBSBML_LIBDIR} ${PC_LIBSBML_LIBRARY_DIRS} )
find_library(LIBBZIP2_LIBRARY
NAMES bzip2.lib bz2 libbz2.lib
PATHS ENV DYLD_LIBRARY_PATH
ENV LD_LIBRARY_PATH
/usr/lib /usr/local/lib /opt/local/lib
${CMAKE_SOURCE_DIR}/depend/lib
HINTS ${PC_LIBBZIP2} ${PC_LIBBZIP2_LIBRARY_DIRS} )
set(LIBSBML_LIBRARIES ${LIBSBML_LIBRARY} ${LIBBZIP2_LIBRARY} )
set(LIBSBML_INCLUDE_DIRS ${LIBSBML_INCLUDE_DIR} )
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBSBML_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LIBSBML DEFAULT_MSG LIBSBML_LIBRARY LIBSBML_INCLUDE_DIR)
add_subdirectory(src)
message(STATUS "
----------------------------------------------------------------------
libSBMLSim version ${PACKAGE_VERSION}
----------------------------------------------------------------------
Configured on host '${HOSTNAME}'
host type = ${CMAKE_SYSTEM_NAME}
host operating system = ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}
host CPU architecture = ${CMAKE_SYSTEM_PROCESSOR}
General build flags:
CC = ${CMAKE_C_COMPILER}
CXX = ${CMAKE_CXX_COMPILER}
CPPFLAGS = ${BUILD_DEFINITIONS}
CFLAGS = ${CMAKE_C_FLAGS}
CXXFLAGS = ${CMAKE_CXX_FLAGS}
LDFLAGS = ${CMAKE_EXE_LINKER_FLAGS}
SBML parser library configuration:
SBML library = ${LIBSBML_LIBRARY}
CPPFLAGS for SBML = -I${LIBSBML_INCLUDE_DIR}
LIBS for SBML = ${LIBSBML_LIBRARY}
Other libSBMLSim configuration settings:
Installation $prefix = ${CMAKE_INSTALL_PREFIX}")