builds on darwin; all tests except testGrid pass

This commit is contained in:
Greg Landrum
2009-09-28 14:07:28 +00:00
parent 76297b0fff
commit 1ec5a0a039
4 changed files with 74 additions and 4 deletions

View File

@@ -21,10 +21,18 @@ find_package(Boost COMPONENTS python thread REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
# pull BLAS and LAPACK (Fortran required by LAPACK)
enable_language(Fortran)
# -----------
# pull BLAS and LAPACK
# Things are easy if we have fortran:
workaround_9220(Fortran OPTIONAL)
IF (CMAKE_Fortran_COMPILER_WORKS)
find_package(BLAS)
find_package(LAPACK)
ELSE()
# otherwise just assume there are lapack and blas libraries out there somewhere:
set(LAPACK_LIBRARIES lapack blas)
ENDIF()
# setup our compiler flags:
if(CMAKE_COMPILER_IS_GNUCXX)

View File

@@ -1,5 +1,5 @@
rdkit_library(Alignment AlignPoints.cpp LINK_LIBRARIES RDGeometry)
rdkit_test(alignment testAlignment.cpp LINK_LIBRARIES Alignment)
rdkit_test(testAlignment testAlignment.cpp LINK_LIBRARIES Alignment)
add_subdirectory(Wrap)

View File

@@ -2,4 +2,4 @@ add_subdirectory(Alignment)
add_subdirectory(EigenSolvers)
add_subdirectory(Optimizer)
rdkit_test(matrices testMatrices.cpp LINK_LIBRARIES RDGeneral)
rdkit_test(testMatrices testMatrices.cpp LINK_LIBRARIES RDGeneral)

View File

@@ -44,3 +44,65 @@ macro(rdkit_test)
add_test(${RDKTEST_NAME} ${EXECUTABLE_OUTPUT_PATH}/${RDKTEST_NAME})
endmacro(rdkit_test)
# ---------------
# downloaded from: http://www.cmake.org/Bug/file_download.php?file_id=2421&type=bug
# This additional function definition is needed to provide a workaround for
# CMake bug 9220.
# On debian testing (cmake 2.6.2), I get return code zero when calling
# cmake the first time, but cmake crashes when running a second time
# as follows:
#
# -- The Fortran compiler identification is unknown
# CMake Error at /usr/share/cmake-2.6/Modules/CMakeFortranInformation.cmake:7 (GET_FILENAME_COMPONENT):
# get_filename_component called with incorrect number of arguments
# Call Stack (most recent call first):
# CMakeLists.txt:3 (enable_language)
#
# My workaround is to invoke cmake twice. If both return codes are zero,
# it is safe to invoke ENABLE_LANGUAGE(Fortran OPTIONAL)
function(workaround_9220 language language_works)
#message("DEBUG: language = ${language}")
set(text
"project(test NONE)
cmake_minimum_required(VERSION 2.6.0)
enable_language(${language} OPTIONAL)
"
)
file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/language_tests/${language})
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language})
file(WRITE ${CMAKE_BINARY_DIR}/language_tests/${language}/CMakeLists.txt
${text})
execute_process(
COMMAND ${CMAKE_COMMAND} .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}
RESULT_VARIABLE return_code
OUTPUT_QUIET
ERROR_QUIET
)
if(return_code EQUAL 0)
# Second run
execute_process (
COMMAND ${CMAKE_COMMAND} .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}
RESULT_VARIABLE return_code
OUTPUT_QUIET
ERROR_QUIET
)
if(return_code EQUAL 0)
set(${language_works} ON PARENT_SCOPE)
else(return_code EQUAL 0)
set(${language_works} OFF PARENT_SCOPE)
endif(return_code EQUAL 0)
else(return_code EQUAL 0)
set(${language_works} OFF PARENT_SCOPE)
endif(return_code EQUAL 0)
endfunction(workaround_9220)
# Temporary tests of the above function.
#workaround_9220(CXX CXX_language_works)
#message("CXX_language_works = ${CXX_language_works}")
#workaround_9220(CXXp CXXp_language_works)
#message("CXXp_language_works = ${CXXp_language_works}")