# try to find specmicp # -------------------- # The following variables are defined : # # - SPECMICP_FOUND : true if specmicp is found # - SPECMICP_INCLUDE_DIR : the include dir # - SPECMICP_LIBRARIES : All the SpecMiCP libraries # - SPECMICP_LIBRARY : the specmicp library # - SPECMICP_DATABASE_LIBRARY : the specmicp_database library # - DFPM_LIBRARY : the database library # - REACTMICP_LIBRARY : the reactmicp library # # To help the search the variables SPECMICP_LIBS_DIR (directory of the library) # and SPECMICP_INCLUDE_DIR can be set. # # copyright (c) 2015 Fabien georget # Redistribution and use is allowed according to the terms of the 3-clause BSD license. # Find the includes requirements # ------------------------------ if (${SpecMiCP_FIND_REQUIRED}) find_package(Eigen3 REQUIRED) else() find_package(Eigen3) endif() # Find the libraries # ------------------ if (NOT SPECMICP_LIBRARIES) # specmicp if (NOT SPECMICP_LIBRARY) find_library(SPECMICP_LIBRARY NAMES specmicp libspecmicp HINTS ${SPECMICP_LIBS_DIR} ) endif() # specmicp_database if (NOT SPECMICP_DATABASE_LIBRARY) find_library(SPECMICP_DATABASE_LIBRARY NAMES specmicp_database libspecmicp_database HINTS ${SPECMICP_LIBS_DIR} ) endif() # dfpm if (NOT DFPM_LIBRARY) find_library(DFPM_LIBRARY NAMES dfpm libdfpm HINTS ${SPECMICP_LIBS_DIR} ) endif() # reactmicp if (NOT REACTMICP_LIBRARY) find_library(REACTMICP_LIBRARY NAMES reactmicp libreactmicp HINTS ${SPECMICP_LIBS_DIR} ) endif() set(SPECMICP_LIBRARIES "${SPECMICP_LIBRARY} ${SPECMICP_DATABASE_LIBRARY} ${DFPM_LIBRARY} ${REACTMICP_LIBRARY}" ) endif() # Find the includes # ----------------- if (NOT SPECMICP_INCLUDE_DIR) find_path(SPECMICP_INCLUDE_DIR NAMES specmicp.hpp reactmicp.hpp PATHS ${CMAKE_INSTALL_PREFIX}/include PATH_SUFFIXES specmicp ) endif() # Check that everything is ok # --------------------------- include(FindPackageHandleStandardArgs) find_package_handle_standard_args(SpecMiCP DEFAULT_MSG SPECMICP_LIBRARIES SPECMICP_INCLUDE_DIR) mark_as_advanced(SPECMICP_INCLUDE_DIR SPECMICP_LIBRARIES SPECMICP_LIBRARY SPECMICP_DATABASE_LIBRARY DFPM_LIBRARY REACTMICP_LIBRARY) # compilation flag required : # ----------------------------- include(CheckCXXCompilerFlag) if(NOT CX11_FLAG) check_cxx_compiler_flag("-std=c++11" HAS_CXX11) if(NOT HAS_CXX11) message(FATAL_ERROR "A c++11 compatible compiler is necessary") else() set(CXX11_FLAG "-std=c++11") endif() endif() SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_FLAG}")