Lines 1-16
Link Here
|
1 |
# Please ensure that any changes remain compliant with 2.4.8. |
1 |
# Please ensure that any changes remain compliant with 2.4.8. |
2 |
if(NOT EMBED_OPENBABEL) |
2 |
if(NOT EMBED_OPENBABEL) |
3 |
cmake_minimum_required(VERSION 2.4.8) |
3 |
cmake_minimum_required(VERSION 2.4.10) |
4 |
endif() |
4 |
endif() |
5 |
|
5 |
|
6 |
project(openbabel) |
6 |
project(openbabel) |
7 |
set(CMAKE_MODULE_PATH ${openbabel_SOURCE_DIR}/cmake/modules) |
7 |
set(CMAKE_MODULE_PATH ${openbabel_SOURCE_DIR}/cmake/modules) |
8 |
|
8 |
|
9 |
# Allow loose loop constructs, i.e. no matching in if/else/endif or loops. |
|
|
10 |
# Note that this is true by default in CMake 2.6.0, but we currently only |
11 |
# require CMake 2.4.8 - remove this when the CMake requirement is bumped. |
12 |
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 1) |
13 |
|
14 |
if(COMMAND cmake_policy) |
9 |
if(COMMAND cmake_policy) |
15 |
cmake_policy(SET CMP0003 NEW) |
10 |
cmake_policy(SET CMP0003 NEW) |
16 |
cmake_policy(SET CMP0005 OLD) # add_definitions need updating to set to NEW |
11 |
cmake_policy(SET CMP0005 OLD) # add_definitions need updating to set to NEW |
Lines 20-26
if(COMMAND cmake_policy)
Link Here
|
20 |
endif() |
15 |
endif() |
21 |
|
16 |
|
22 |
include (CheckCXXCompilerFlag) |
17 |
include (CheckCXXCompilerFlag) |
23 |
include (MacroEnsureVersion) |
|
|
24 |
|
18 |
|
25 |
# Version numbering - should be bumped for each release |
19 |
# Version numbering - should be bumped for each release |
26 |
# Note that for "beta" releases, we should start at x.90.0 -- we've |
20 |
# Note that for "beta" releases, we should start at x.90.0 -- we've |
Lines 238-253
check_type_size(clock_t CLOCK_T)
Link Here
|
238 |
|
232 |
|
239 |
# Get the GCC version - from KDE4 cmake files |
233 |
# Get the GCC version - from KDE4 cmake files |
240 |
if(CMAKE_COMPILER_IS_GNUCXX) |
234 |
if(CMAKE_COMPILER_IS_GNUCXX) |
241 |
exec_program(${CMAKE_C_COMPILER} ARGS --version OUTPUT_VARIABLE _gcc_version_info) |
235 |
if(NOT(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.0.0)) |
242 |
string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}") |
236 |
set(GCC_IS_NEWER_THAN_4_0 TRUE) |
243 |
# gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the |
237 |
else() |
244 |
# patch level, handle this here: |
238 |
set(GCC_IS_NEWER_THAN_4_0 FALSE) |
245 |
if (NOT _gcc_version) |
239 |
endif() |
246 |
string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${_gcc_version_info}") |
240 |
if(NOT(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.1.0)) |
247 |
endif () |
241 |
set(GCC_IS_NEWER_THAN_4_1 TRUE) |
248 |
macro_ensure_version("4.0.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_0) |
242 |
else() |
249 |
macro_ensure_version("4.1.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_1) |
243 |
set(GCC_IS_NEWER_THAN_4_1 FALSE) |
250 |
macro_ensure_version("4.2.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_2) |
244 |
endif() |
|
|
245 |
if(NOT(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.2.0)) |
246 |
set(GCC_IS_NEWER_THAN_4_2 TRUE) |
247 |
else() |
248 |
set(GCC_IS_NEWER_THAN_4_2 FALSE) |
249 |
endif() |
251 |
endif() |
250 |
endif() |
252 |
|
251 |
|
253 |
if(UNIX) |
252 |
if(UNIX) |