mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
ConformerParser updated
This commit is contained in:
@@ -1,55 +1,23 @@
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
set(RDKit_Year "2014")
|
||||
set(RDKit_Month "03")
|
||||
set(RDKit_ABI "1")
|
||||
|
||||
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
|
||||
find_package (RDKit REQUIRED)
|
||||
|
||||
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../Code/cmake/Modules)
|
||||
set(RDKit_LibDir ${PROJECT_SOURCE_DIR}/../../lib)
|
||||
include_directories (${RDKIT_INCLUDE_DIR})
|
||||
|
||||
include(RDKitUtils)
|
||||
install(EXPORT ${RDKit_EXPORTED_TARGETS} DESTINATION ${RDKit_LibDir})
|
||||
|
||||
macro(local_library)
|
||||
PARSE_ARGUMENTS(RDKLIB
|
||||
"LINK_LIBRARIES;DEST"
|
||||
"SHARED"
|
||||
${ARGN})
|
||||
CAR(RDKLIB_NAME ${RDKLIB_DEFAULT_ARGS})
|
||||
CDR(RDKLIB_SOURCES ${RDKLIB_DEFAULT_ARGS})
|
||||
if(MSVC)
|
||||
add_library(${RDKLIB_NAME} ${RDKLIB_SOURCES})
|
||||
target_link_libraries(${RDKLIB_NAME} ${Boost_SYSTEM_LIBRARY} )
|
||||
INSTALL(TARGETS ${RDKLIB_NAME} EXPORT ${RDKit_EXPORTED_TARGETS}
|
||||
DESTINATION ${RDKit_LibDir}/${RDKLIB_DEST}
|
||||
COMPONENT dev )
|
||||
else(MSVC)
|
||||
# we're going to always build in shared mode since we
|
||||
# need exceptions to be (correctly) catchable across
|
||||
# boundaries. As of now (June 2010), this doesn't work
|
||||
# with g++ unless libraries are shared.
|
||||
add_library(${RDKLIB_NAME} SHARED ${RDKLIB_SOURCES})
|
||||
INSTALL(TARGETS ${RDKLIB_NAME} EXPORT ${RDKit_EXPORTED_TARGETS}
|
||||
DESTINATION ${RDKit_LibDir}/${RDKLIB_DEST}
|
||||
COMPONENT runtime )
|
||||
if(RDK_INSTALL_STATIC_LIBS)
|
||||
add_library(${RDKLIB_NAME}_static ${RDKLIB_SOURCES})
|
||||
INSTALL(TARGETS ${RDKLIB_NAME}_static EXPORT ${RDKit_EXPORTED_TARGETS}
|
||||
DESTINATION ${RDKit_LibDir}/${RDKLIB_DEST}
|
||||
COMPONENT dev )
|
||||
endif(RDK_INSTALL_STATIC_LIBS)
|
||||
IF(RDKLIB_LINK_LIBRARIES)
|
||||
target_link_libraries(${RDKLIB_NAME} ${RDKLIB_LINK_LIBRARIES})
|
||||
ENDIF(RDKLIB_LINK_LIBRARIES)
|
||||
endif(MSVC)
|
||||
if(WIN32)
|
||||
set_target_properties(${RDKLIB_NAME} PROPERTIES
|
||||
OUTPUT_NAME "${RDKLIB_NAME}"
|
||||
VERSION "${RDKit_ABI}.${RDKit_Year}.${RDKit_Month}")
|
||||
else(WIN32)
|
||||
set_target_properties(${RDKLIB_NAME} PROPERTIES
|
||||
OUTPUT_NAME ${RDKLIB_NAME}
|
||||
)
|
||||
endif(WIN32)
|
||||
|
||||
endmacro(local_library)
|
||||
set(RDK_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
|
||||
set(RDK_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
|
||||
set(RDK_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lib")
|
||||
set(RDK_PYTHON_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/rdkit")
|
||||
|
||||
find_package(PythonLibs)
|
||||
if(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6)
|
||||
@@ -64,9 +32,13 @@ find_package(Boost 1.42.0 COMPONENTS python REQUIRED)
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
link_directories(${Boost_LIBRARY_DIRS})
|
||||
|
||||
local_library(ConformerParser ConformerParser.cpp
|
||||
rdkit_library(ConformerParser ConformerParser.cpp
|
||||
LINK_LIBRARIES ${RDKIT_LIBARIES})
|
||||
|
||||
set(RDK_BUILD_CPP_TESTS ON)
|
||||
|
||||
enable_testing()
|
||||
|
||||
rdkit_test(testConformerParser test.cpp
|
||||
LINK_LIBRARIES ConformerParser
|
||||
${RDKIT_LIBRARIES}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
set(RDK_BUILD_PYTHON_WRAPPERS ON)
|
||||
set(RDK_PYTHON_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/rdkit")
|
||||
set(RDKit_PythonDir ${PROJECT_SOURCE_DIR}/../../rdkit)
|
||||
|
||||
rdkit_python_extension(rdConformerParser rdConformerParser.cpp
|
||||
@@ -10,5 +9,6 @@ rdkit_python_extension(rdConformerParser rdConformerParser.cpp
|
||||
${RDKIT_LIBRARIES}
|
||||
)
|
||||
|
||||
add_pytest(pyConformerParser ${CMAKE_CURRENT_SOURCE_DIR}/testConformerParser.py)
|
||||
#add_pytest(pyConformerParser ${CMAKE_CURRENT_SOURCE_DIR}/testConformerParser.py)
|
||||
add_test(pyConformerParser ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/testConformerParser.py)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class TestCase(unittest.TestCase) :
|
||||
pass
|
||||
|
||||
def testReadAmberTraj(self):
|
||||
fileN = os.path.join(RDConfig.RDBaseDir,'Code','GraphMol','ConformerParser',
|
||||
fileN = os.path.join(RDConfig.RDBaseDir,'Contrib','ConformerParser',
|
||||
'test_data','water_coords.trx')
|
||||
mol = Chem.MolFromSmiles('O')
|
||||
mol = Chem.AddHs(mol)
|
||||
@@ -22,7 +22,7 @@ class TestCase(unittest.TestCase) :
|
||||
self.failUnless(len(ids) == 1)
|
||||
self.failUnless(ids[0] == 0)
|
||||
|
||||
fileN = os.path.join(RDConfig.RDBaseDir,'Code','GraphMol','ConformerParser',
|
||||
fileN = os.path.join(RDConfig.RDBaseDir,'Contrib','ConformerParser',
|
||||
'test_data','water_coords2.trx')
|
||||
ids = rdConformerParser.AddConformersFromAmberTrajectory(mol, fileN, clearConfs=True)
|
||||
self.failUnless(mol.GetNumConformers() == 2)
|
||||
|
||||
Reference in New Issue
Block a user