cmake_minimum_required (VERSION 2.6) # コンパイラ設定 set(CMAKE_C_COMPILER gcc) set(CMAKE_CXX_COMPILER g++) #set(CMAKE_C_COMPILER clang) #set(CMAKE_CXX_COMPILER clang++) # プロジェクトの設定 project (generator CXX) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set (Revision 465) find_package(PkgConfig) set(CMAKE_C_FLAGS "-w -O3") set(CMAKE_CXX_FLAGS "-w -O3") #set(CMAKE_VERBOSE_MAKEFILE 1) # SQLite pkg_check_modules(SQLite sqlite3) if(NOT SQLite_FOUND) message(FATAL_ERROR "Could not find SQLite.") endif() include_directories(${SQLite_INCLUDE_DIRS}) # Boost set(Boost_NO_BOOST_CMAKE ON) find_package(Boost REQUIRED COMPONENTS iostreams) include_directories(${Boost_INCLUDE_DIRS}) # OpenBabel if(OpenBabel_DIR) find_path(OpenBabel_INCLUDE_DIR NAMES openbabel/mol.h PATHS ${OpenBabel_DIR}/include PATH_SUFFIXES openbabel-2.0 NO_DEFAULT_PATH) find_library(OpenBabel_LIBRARY NAMES openbabel PATHS ${OpenBabel_DIR}/lib NO_DEFAULT_PATH) else() find_path(OpenBabel_INCLUDE_DIR NAMES openbabel/mol.h PATHS /usr/include /usr/local/include PATH_SUFFIXES openbabel-2.0) find_library(OpenBabel_LIBRARY NAMES openbabel PATHS /usr/lib64 /usr/local/lib /usr/local/lib64) endif() if(OpenBabel_INCLUDE_DIR) message(STATUS "OpenBabel found.") file(STRINGS ${OpenBabel_INCLUDE_DIR}/openbabel/babelconfig.h BABEL_H REGEX "^#define BABEL_VERSION \"([0-9.]+)\"$") string(REGEX REPLACE "^#define BABEL_VERSION \"([^\"]+)\"" "\\1" OpenBabel_VERSION ${BABEL_H}) message(STATUS " found OpenBabel, version " ${OpenBabel_VERSION}) if(${OpenBabel_VERSION} VERSION_LESS 2.3.2) message(WARNING "version 2.3.2 or greater is required.") endif() else() message(FATAL_ERROR "Could not find OpenBabel.") endif() include_directories(${OpenBabel_INCLUDE_DIR}) # サブディレクトリを追加 add_subdirectory(src)