diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a9e2eb783..0203687203 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,14 +173,16 @@ IF(NOT CYCLUS_DOC_ONLY) MESSAGE("-- HDF5 High Level Libraries: ${HDF5_C_HL_LIBRARIES}") # find coin and link to it - FIND_PACKAGE(COIN) - if(COIN_FOUND) - SET(CYCAMORE_INCLUDE_DIRS ${CYCAMORE_INCLUDE_DIRS} ${COIN_INCLUDE_DIRS}) - SET(LIBS ${LIBS} ${COIN_LIBRARIES}) + if(DEFAULT_ALLOW_MILPS) + FIND_PACKAGE(COIN REQUIRED) + if(COIN_FOUND) + SET(CYCAMORE_INCLUDE_DIRS ${CYCAMORE_INCLUDE_DIRS} ${COIN_INCLUDE_DIRS}) + SET(LIBS ${LIBS} ${COIN_LIBRARIES}) + endif() + MESSAGE("-- COIN Root: ${COIN_ROOT}") + MESSAGE("-- COIN Include directories: ${COIN_INCLUDE_DIRS}") + MESSAGE("-- COIN Libraries: ${COIN_LIBRARIES}") endif() - MESSAGE("-- COIN Root: ${COIN_ROOT}") - MESSAGE("-- COIN Include directories: ${COIN_INCLUDE_DIRS}") - MESSAGE("-- COIN Libraries: ${COIN_LIBRARIES}") # find SQLite FIND_PACKAGE( SQLite3 REQUIRED ) @@ -249,13 +251,13 @@ IF(NOT CYCLUS_DOC_ONLY) ENDIF(ICUUC_LIBRARIES) # Python - find_package(PythonInterp) - message("-- PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}") - find_package(PythonLibs) - MESSAGE("-- Found Python Libraries (optional): ${PYTHON_LIBRARIES}") - IF(PYTHON_LIBRARIES) - set(LIBS ${LIBS} ${PYTHON_LIBRARIES}) - ENDIF(PYTHON_LIBRARIES) + find_package(Python3 COMPONENTS Interpreter Development) + message("-- PYTHON_EXECUTABLE: ${Python3_EXECUTABLE}") + MESSAGE("-- Found Python Libraries (optional): ${Python3_LIBRARIES}") + IF(Python3_FOUND) + set(LIBS ${LIBS} ${Python3_LIBRARIES}) + message("libs set with ${Python3_LIBRARIES}") + ENDIF(Python3_FOUND) # include all the directories we just found INCLUDE_DIRECTORIES(${CYCAMORE_INCLUDE_DIRS}) diff --git a/cmake/FindCyclus.cmake b/cmake/FindCyclus.cmake index 873c317d24..2a2fecea59 100644 --- a/cmake/FindCyclus.cmake +++ b/cmake/FindCyclus.cmake @@ -88,6 +88,30 @@ FIND_LIBRARY(CYCLUS_CORE_LIBRARY NAMES cyclus /opt/local /opt/local/cyclus PATH_SUFFIXES cyclus/lib lib) +# Look for the library +FIND_LIBRARY(CYCLUS_EVENTHOOKS_LIBRARY NAMES eventhooks.so + HINTS "${CYCLUS_ROOT_DIR}" "${CYCLUS_ROOT_DIR}/cyclus" + ${DEPS_CYCLUS} + /usr/local/cyclus/lib /usr/local/cyclus + /opt/local /opt/local/cyclus + PATH_SUFFIXES cyclus/lib lib) + +# Look for the library +FIND_LIBRARY(CYCLUS_PYINFILE_LIBRARY NAMES pyinfile.so + HINTS "${CYCLUS_ROOT_DIR}" "${CYCLUS_ROOT_DIR}/cyclus" + ${DEPS_CYCLUS} + /usr/local/cyclus/lib /usr/local/cyclus + /opt/local /opt/local/cyclus + PATH_SUFFIXES cyclus/lib lib) + +# Look for the library +FIND_LIBRARY(CYCLUS_PYMODULE_LIBRARY NAMES pymodule.so + HINTS "${CYCLUS_ROOT_DIR}" "${CYCLUS_ROOT_DIR}/cyclus" + ${DEPS_CYCLUS} + /usr/local/cyclus/lib /usr/local/cyclus + /opt/local /opt/local/cyclus + PATH_SUFFIXES cyclus/lib lib) + # Look for the library FIND_LIBRARY(CYCLUS_AGENT_TEST_LIBRARY NAMES baseagentunittests HINTS "${CYCLUS_ROOT_DIR}" "${CYCLUS_ROOT_DIR}/cyclus" @@ -112,6 +136,17 @@ IF(CYCLUS_CORE_INCLUDE_DIR AND CYCLUS_CORE_TEST_INCLUDE_DIR AND CYCLUS_AGENT_TEST_LIBRARY) SET(CYCLUS_CORE_FOUND 1) SET(CYCLUS_CORE_LIBRARIES "${CYCLUS_CORE_LIBRARY}") + # if Cyclus was installed without Cython these three libraries won't be found because they don't exist + # if Cyclus was installed WITH Cython we need to link against them + if(NOT ${CYCLUS_EVENTHOOKS_LIBRARY} STREQUAL "CYCLUS_EVENTHOOKS_LIBRARY-NOTFOUND") + SET(CYCLUS_CORE_LIBRARIES "${CYCLUS_CORE_LIBRARIES}" "${CYCLUS_EVENTHOOKS_LIBRARY}") + endif() + if(NOT ${CYCLUS_PYINFILE_LIBRARY} STREQUAL "CYCLUS_PYINFILE_LIBRARY-NOTFOUND") + SET(CYCLUS_CORE_LIBRARIES "${CYCLUS_CORE_LIBRARIES}" "${CYCLUS_PYINFILE_LIBRARY}") + endif() + if(NOT ${CYCLUS_PYMODULE_LIBRARY} STREQUAL "CYCLUS_PYMODULE_LIBRARY-NOTFOUND") + SET(CYCLUS_CORE_LIBRARIES "${CYCLUS_CORE_LIBRARIES}" "${CYCLUS_PYMODULE_LIBRARY}") + endif() SET(CYCLUS_TEST_LIBRARIES "${CYCLUS_GTEST_LIBRARY}" "${CYCLUS_AGENT_TEST_LIBRARY}") SET(CYCLUS_AGENT_TEST_LIBRARIES "${CYCLUS_AGENT_TEST_LIBRARY}") SET(CYCLUS_CORE_INCLUDE_DIRS "${CYCLUS_CORE_INCLUDE_DIR}")