|
1 |
| -############################################################################### |
2 |
| -# |
3 |
| -# $URL$ |
4 |
| -# $Id$ |
5 |
| -# |
6 |
| -# Description : CMake build script for libSBML dependencies (iconv) |
7 |
| -# Original author(s): Frank Bergmann <fbergman@caltech.edu> |
8 |
| -# Organization : California Institute of Technology |
9 |
| -# |
10 |
| -# This file is part of libSBML. Please visit http://sbml.org for more |
11 |
| -# information about SBML, and the latest version of libSBML. |
12 |
| -# |
13 |
| -# Copyright 2005-2011 California Institute of Technology. |
14 |
| -# Copyright 2002-2005 California Institute of Technology and |
15 |
| -# Japan Science and Technology Corporation. |
16 |
| -# |
17 |
| -# This library is free software; you can redistribute it and/or modify it |
18 |
| -# under the terms of the GNU Lesser General Public License as published by |
19 |
| -# the Free Software Foundation. A copy of the license agreement is provided |
20 |
| -# in the file named "LICENSE.txt" included with this software distribution |
21 |
| -# and also available online as http://sbml.org/software/libsbml/license.html |
22 |
| -# |
23 |
| -############################################################################### |
24 |
| - |
25 |
| -if (WITH_LIBXML) |
26 |
| -project(libxml2) |
27 |
| - |
28 |
| -if (WITH_STATIC_RUNTIME) |
29 |
| - foreach(flag_var |
30 |
| - CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE |
31 |
| - CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO |
32 |
| - CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE |
33 |
| - CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO) |
34 |
| - |
35 |
| - if(${flag_var} MATCHES "/MD") |
36 |
| - string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") |
37 |
| - endif(${flag_var} MATCHES "/MD") |
38 |
| - |
39 |
| - |
40 |
| - endforeach(flag_var) |
41 |
| - add_definitions( -D_MT) |
42 |
| -endif(WITH_STATIC_RUNTIME) |
43 |
| - |
44 |
| -set(LIBXML_SOURCE |
45 |
| - "c14n.c" |
46 |
| - "catalog.c" |
47 |
| - "chvalid.c" |
48 |
| - "debugXML.c" |
49 |
| - "dict.c" |
50 |
| - "DOCBparser.c" |
51 |
| - "encoding.c" |
52 |
| - "entities.c" |
53 |
| - "error.c" |
54 |
| - "globals.c" |
55 |
| - "hash.c" |
56 |
| - "HTMLparser.c" |
57 |
| - "HTMLtree.c" |
58 |
| - "legacy.c" |
59 |
| - "list.c" |
60 |
| - "nanoftp.c" |
61 |
| - "nanohttp.c" |
62 |
| - "parser.c" |
63 |
| - "parserInternals.c" |
64 |
| - "pattern.c" |
65 |
| - "relaxng.c" |
66 |
| - "SAX.c" |
67 |
| - "SAX2.c" |
68 |
| - "schematron.c" |
69 |
| - "threads.c" |
70 |
| - "tree.c" |
71 |
| - "uri.c" |
72 |
| - "valid.c" |
73 |
| - "xinclude.c" |
74 |
| - "xlink.c" |
75 |
| - "xmlIO.c" |
76 |
| - "xmlmemory.c" |
77 |
| - "xmlmodule.c" |
78 |
| - "xmlreader.c" |
79 |
| - "xmlregexp.c" |
80 |
| - "xmlsave.c" |
81 |
| - "xmlschemas.c" |
82 |
| - "xmlschemastypes.c" |
83 |
| - "xmlstring.c" |
84 |
| - "xmlunicode.c" |
85 |
| - "xmlwriter.c" |
86 |
| - "xpath.c" |
87 |
| - "xpointer.c" |
88 |
| -) |
89 |
| - |
90 |
| - |
91 |
| -include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/libxml" |
92 |
| - "${CMAKE_SOURCE_DIR}/libiconv/source/include" |
93 |
| - "${CMAKE_SOURCE_DIR}/zlib/source" |
94 |
| - "${CMAKE_CURRENT_SOURCE_DIR}/include" |
95 |
| - "${CMAKE_CURRENT_SOURCE_DIR}") |
96 |
| - |
97 |
| - |
98 |
| -if (WIN32) |
99 |
| -add_definitions(-DWIN32 |
100 |
| - -DHAVE_ZLIB_H |
101 |
| - -D_CRT_SECURE_NO_WARNINGS |
102 |
| - -D_CRT_SECURE_NO_DEPRECATE |
103 |
| - -D_CRT_NONSTDC_NO_DEPRECATE |
| 1 | +############################################################################### |
| 2 | +# |
| 3 | +# $URL$ |
| 4 | +# $Id$ |
| 5 | +# |
| 6 | +# Description : CMake build script for libSBML dependencies (iconv) |
| 7 | +# Original author(s): Frank Bergmann <fbergman@caltech.edu> |
| 8 | +# Organization : California Institute of Technology |
| 9 | +# |
| 10 | +# This file is part of libSBML. Please visit http://sbml.org for more |
| 11 | +# information about SBML, and the latest version of libSBML. |
| 12 | +# |
| 13 | +# Copyright 2005-2011 California Institute of Technology. |
| 14 | +# Copyright 2002-2005 California Institute of Technology and |
| 15 | +# Japan Science and Technology Corporation. |
| 16 | +# |
| 17 | +# This library is free software; you can redistribute it and/or modify it |
| 18 | +# under the terms of the GNU Lesser General Public License as published by |
| 19 | +# the Free Software Foundation. A copy of the license agreement is provided |
| 20 | +# in the file named "LICENSE.txt" included with this software distribution |
| 21 | +# and also available online as http://sbml.org/software/libsbml/license.html |
| 22 | +# |
| 23 | +############################################################################### |
| 24 | + |
| 25 | +if (WITH_LIBXML) |
| 26 | +project(libxml2) |
| 27 | + |
| 28 | +if (WITH_STATIC_RUNTIME) |
| 29 | + foreach(flag_var |
| 30 | + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE |
| 31 | + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO |
| 32 | + CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE |
| 33 | + CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO) |
| 34 | + |
| 35 | + if(${flag_var} MATCHES "/MD") |
| 36 | + string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") |
| 37 | + endif(${flag_var} MATCHES "/MD") |
| 38 | + |
| 39 | + |
| 40 | + endforeach(flag_var) |
| 41 | + add_definitions( -D_MT) |
| 42 | + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") |
| 43 | +endif(WITH_STATIC_RUNTIME) |
| 44 | + |
| 45 | +set(LIBXML_SOURCE |
| 46 | + "c14n.c" |
| 47 | + "catalog.c" |
| 48 | + "chvalid.c" |
| 49 | + "debugXML.c" |
| 50 | + "dict.c" |
| 51 | + "DOCBparser.c" |
| 52 | + "encoding.c" |
| 53 | + "entities.c" |
| 54 | + "error.c" |
| 55 | + "globals.c" |
| 56 | + "hash.c" |
| 57 | + "HTMLparser.c" |
| 58 | + "HTMLtree.c" |
| 59 | + "legacy.c" |
| 60 | + "list.c" |
| 61 | + "nanoftp.c" |
| 62 | + "nanohttp.c" |
| 63 | + "parser.c" |
| 64 | + "parserInternals.c" |
| 65 | + "pattern.c" |
| 66 | + "relaxng.c" |
| 67 | + "SAX.c" |
| 68 | + "SAX2.c" |
| 69 | + "schematron.c" |
| 70 | + "threads.c" |
| 71 | + "tree.c" |
| 72 | + "uri.c" |
| 73 | + "valid.c" |
| 74 | + "xinclude.c" |
| 75 | + "xlink.c" |
| 76 | + "xmlIO.c" |
| 77 | + "xmlmemory.c" |
| 78 | + "xmlmodule.c" |
| 79 | + "xmlreader.c" |
| 80 | + "xmlregexp.c" |
| 81 | + "xmlsave.c" |
| 82 | + "xmlschemas.c" |
| 83 | + "xmlschemastypes.c" |
| 84 | + "xmlstring.c" |
| 85 | + "xmlunicode.c" |
| 86 | + "xmlwriter.c" |
| 87 | + "xpath.c" |
| 88 | + "xpointer.c" |
| 89 | +) |
| 90 | + |
| 91 | + |
| 92 | +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/libxml" |
| 93 | + "${CMAKE_SOURCE_DIR}/libiconv/source/include" |
| 94 | + "${CMAKE_SOURCE_DIR}/zlib/source" |
| 95 | + "${CMAKE_CURRENT_SOURCE_DIR}/include" |
| 96 | + "${CMAKE_CURRENT_SOURCE_DIR}") |
| 97 | + |
| 98 | + |
| 99 | +if (WIN32) |
| 100 | +add_definitions(-DWIN32 |
| 101 | + -DHAVE_ZLIB_H |
| 102 | + -D_CRT_SECURE_NO_WARNINGS |
| 103 | + -D_CRT_SECURE_NO_DEPRECATE |
| 104 | + -D_CRT_NONSTDC_NO_DEPRECATE |
104 | 105 | )
|
105 |
| -add_library (libxml2 ${LIBXML_SOURCE} ) |
106 |
| -target_link_libraries(libxml2 zdll libiconv wsock32.lib ws2_32.lib) |
107 |
| -INSTALL(TARGETS libxml2 |
108 |
| - RUNTIME DESTINATION bin |
109 |
| - LIBRARY DESTINATION lib |
110 |
| - ARCHIVE DESTINATION lib |
111 |
| - ) |
112 |
| - |
| 106 | +add_library (libxml2 ${LIBXML_SOURCE} ) |
| 107 | +target_link_libraries(libxml2 zdll libiconv wsock32.lib ws2_32.lib) |
| 108 | +INSTALL(TARGETS libxml2 |
| 109 | + RUNTIME DESTINATION bin |
| 110 | + LIBRARY DESTINATION lib |
| 111 | + ARCHIVE DESTINATION lib |
| 112 | + ) |
| 113 | + |
113 | 114 |
|
114 | 115 | else()
|
115 |
| -if (NOT CYGWIN) |
116 |
| - # on cygwin all code is position independent so -fPIC is not needed |
117 |
| - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fPIC") |
118 |
| - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fPIC") |
119 |
| -endif() |
120 |
| - |
121 |
| -add_definitions( |
122 |
| - -DHAVE_ZLIB_H |
123 |
| --DHAVE_STDLIB_H |
124 |
| --DHAVE_UNISTD_H |
125 |
| --DHAVE_SYS_SOCKET_H |
126 |
| --DHAVE_NETINET_IN_H |
127 |
| --DHAVE_ARPA_INET_H |
128 |
| --DHAVE_NETDB_H-DHAVE_FCNTL_H |
129 |
| --DHAVE_SYS_TIME_H |
130 |
| --DHAVE_SYS_SELECT_H |
131 |
| --DHAVE_SYS_SOCKET_H |
132 |
| --DHAVE_SYS_TYPES_H |
| 116 | +if (NOT CYGWIN) |
| 117 | + # on cygwin all code is position independent so -fPIC is not needed |
| 118 | + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fPIC") |
| 119 | + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fPIC") |
| 120 | +endif() |
| 121 | + |
| 122 | +add_definitions( |
| 123 | + -DHAVE_ZLIB_H |
| 124 | +-DHAVE_STDLIB_H |
| 125 | +-DHAVE_UNISTD_H |
| 126 | +-DHAVE_SYS_SOCKET_H |
| 127 | +-DHAVE_NETINET_IN_H |
| 128 | +-DHAVE_ARPA_INET_H |
| 129 | +-DHAVE_NETDB_H |
| 130 | +-DHAVE_FCNTL_H |
| 131 | + |
| 132 | +-DHAVE_SYS_TIME_H |
| 133 | +-DHAVE_SYS_SELECT_H |
| 134 | +-DHAVE_SYS_SOCKET_H |
| 135 | +-DHAVE_SYS_TYPES_H |
133 | 136 | -DHAVE_STRINGS_H
|
134 |
| -) |
| 137 | +) |
| 138 | + |
| 139 | +add_library (xml2 ${LIBXML_SOURCE} ) |
| 140 | +target_link_libraries(xml2 zlib libiconv ) |
| 141 | +INSTALL(TARGETS xml2 |
| 142 | + RUNTIME DESTINATION bin |
| 143 | + LIBRARY DESTINATION lib |
| 144 | + ARCHIVE DESTINATION lib |
| 145 | + ) |
135 | 146 |
|
136 |
| -add_library (xml2 ${LIBXML_SOURCE} ) |
137 |
| -target_link_libraries(xml2 zlib libiconv ) |
138 |
| -INSTALL(TARGETS xml2 |
139 |
| - RUNTIME DESTINATION bin |
140 |
| - LIBRARY DESTINATION lib |
141 |
| - ARCHIVE DESTINATION lib |
142 |
| - ) |
143 |
| - |
144 | 147 |
|
145 | 148 | endif()
|
146 |
| - |
147 |
| - |
148 |
| -install(DIRECTORY |
149 |
| - "include/libxml" |
150 |
| - DESTINATION include |
151 |
| - FILES_MATCHING PATTERN "*.h") |
152 |
| - |
153 |
| -file(GLOB HEADERS include/libxml/*.h) |
154 |
| -install(FILES ${HEADERS} |
155 |
| - DESTINATION include/libxml) |
156 |
| - |
157 |
| - |
| 149 | + |
| 150 | + |
| 151 | +install(DIRECTORY |
| 152 | + "include/libxml" |
| 153 | + DESTINATION include |
| 154 | + FILES_MATCHING PATTERN "*.h") |
| 155 | + |
| 156 | +file(GLOB HEADERS include/libxml/*.h) |
| 157 | +install(FILES ${HEADERS} |
| 158 | + DESTINATION include/libxml) |
| 159 | + |
| 160 | + |
158 | 161 | endif()
|
0 commit comments