Finalize 1.7.6 release.
[ginac.git] / ginac / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 set(ginaclib_sources
4     add.cpp
5     archive.cpp
6     basic.cpp
7     clifford.cpp
8     color.cpp
9     constant.cpp
10     excompiler.cpp
11     ex.cpp
12     expair.cpp
13     expairseq.cpp
14     exprseq.cpp
15     factor.cpp
16     fail.cpp
17     fderivative.cpp
18     function.cpp
19     idx.cpp
20     indexed.cpp
21     inifcns.cpp
22     inifcns_gamma.cpp
23     inifcns_nstdsums.cpp
24     inifcns_trans.cpp
25     integral.cpp
26     lst.cpp
27     matrix.cpp
28     mul.cpp
29     ncmul.cpp
30     normal.cpp
31     numeric.cpp
32     operators.cpp
33     parser/default_reader.cpp
34     parser/lexer.cpp
35     parser/parse_binop_rhs.cpp
36     parser/parse_context.cpp
37     parser/parser_compat.cpp
38     parser/parser.cpp
39     polynomial/chinrem_gcd.cpp
40     polynomial/collect_vargs.cpp
41     polynomial/cra_garner.cpp
42     polynomial/divide_in_z_p.cpp
43     polynomial/gcd_uvar.cpp
44     polynomial/mgcd.cpp
45     polynomial/mod_gcd.cpp
46     polynomial/normalize.cpp
47     polynomial/optimal_vars_finder.cpp
48     polynomial/pgcd.cpp
49     polynomial/primpart_content.cpp
50     polynomial/remainder.cpp
51     polynomial/upoly_io.cpp
52     power.cpp
53     print.cpp
54     pseries.cpp
55     registrar.cpp
56     relational.cpp
57     remember.cpp
58     symbol.cpp
59     symmetry.cpp
60     tensor.cpp
61     utils.cpp
62     wildcard.cpp
63 )
64
65 set(ginaclib_public_headers
66     ginac.h
67     add.h
68     archive.h
69     assertion.h
70     basic.h
71     class_info.h
72     clifford.h
73     color.h
74     compiler.h
75     constant.h
76     container.h
77     ex.h
78     excompiler.h
79     expair.h
80     expairseq.h 
81     exprseq.h
82     fail.h
83     factor.h
84     fderivative.h
85     flags.h
86     ${CMAKE_CURRENT_BINARY_DIR}/function.h
87     hash_map.h
88     idx.h
89     indexed.h 
90     inifcns.h
91     integral.h
92     lst.h
93     matrix.h
94     mul.h
95     ncmul.h
96     normal.h
97     numeric.h
98     operators.h 
99     power.h
100     print.h
101     pseries.h
102     ptr.h
103     registrar.h
104     relational.h
105     structure.h 
106     symbol.h
107     symmetry.h
108     tensor.h
109     version.h
110     wildcard.h 
111     parser/parser.h 
112     parser/parse_context.h
113 )
114
115 set(ginaclib_private_headers
116     remember.h
117     utils.h
118     crc32.h
119     hash_seed.h
120     parser/lexer.h
121     parser/debug.h
122     polynomial/gcd_euclid.h
123     polynomial/remainder.h
124     polynomial/normalize.h
125     polynomial/upoly.h
126     polynomial/ring_traits.h
127     polynomial/mod_gcd.h
128     polynomial/cra_garner.h
129     polynomial/upoly_io.h
130     polynomial/prem_uvar.h
131     polynomial/eval_uvar.h
132     polynomial/interpolate_padic_uvar.h
133     polynomial/sr_gcd_uvar.h
134     polynomial/heur_gcd_uvar.h
135     polynomial/chinrem_gcd.h
136     polynomial/collect_vargs.h
137     polynomial/divide_in_z_p.h
138     polynomial/euclid_gcd_wrap.h
139     polynomial/eval_point_finder.h
140     polynomial/newton_interpolate.h
141     polynomial/optimal_vars_finder.h
142     polynomial/pgcd.h
143     polynomial/poly_cra.h
144     polynomial/primes_factory.h
145     polynomial/smod_helpers.h
146     polynomial/debug.h
147 )
148
149 add_library(ginac ${ginaclib_sources})
150 add_definitions(-DLIBEXECDIR="${LIBEXECDIR}/")
151 set_target_properties(ginac PROPERTIES
152         SOVERSION ${ginaclib_soversion}
153         VERSION ${ginaclib_version})
154 target_link_libraries(ginac ${CLN_LIBRARIES})
155 include_directories(${CMAKE_SOURCE_DIR}/ginac)
156
157 if (NOT BUILD_SHARED_LIBS)
158         set_target_properties(ginac PROPERTIES OUTPUT_NAME "ginac")
159         # Avoid the static library vs import library conflict (necessary for
160         # m$ toolchain).
161         set_target_properties(ginac PROPERTIES PREFIX "lib")
162 endif()
163
164 install(TARGETS ginac LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
165                       RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
166                       ARCHIVE DESTINATION "${LIB_INSTALL_DIR}")
167 install(FILES ${ginaclib_public_headers} DESTINATION "${INCLUDE_INSTALL_DIR}/ginac")
168
169 add_custom_command(
170         OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/function.h
171         COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/function.py -o ${CMAKE_CURRENT_BINARY_DIR}/function.h ${CMAKE_CURRENT_SOURCE_DIR}/function.hppy
172         DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/function.hppy ${CMAKE_CURRENT_SOURCE_DIR}/function.py)
173
174 add_custom_command(
175         OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/function.cpp
176         COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/function.py -o ${CMAKE_CURRENT_BINARY_DIR}/function.cpp ${CMAKE_CURRENT_SOURCE_DIR}/function.cppy
177         DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/function.h ${CMAKE_CURRENT_SOURCE_DIR}/function.cppy ${CMAKE_CURRENT_SOURCE_DIR}/function.py)
178