Skip to content
Snippets Groups Projects
CMakeLists.txt 9.70 KiB
#-------------------------------------------------------------------------------
# Author: Marco Biasini
#-------------------------------------------------------------------------------

cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
project(OpenStructure CXX C)
set (CMAKE_EXPORT_COMPILE_COMMANDS 1)
set (OST_VERSION_MAJOR 1)
set (OST_VERSION_MINOR 7)
set (OST_VERSION_PATCH 1)
set (OST_VERSION_STRING ${OST_VERSION_MAJOR}.${OST_VERSION_MINOR}.${OST_VERSION_PATCH} )
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake_support)
include(OST)


if (CMAKE_COMPILER_IS_GNUCXX)  
  exec_program(gcc ARGS --version OUTPUT_VARIABLE CMAKE_C_COMPILER_VERSION)
  if(CMAKE_C_COMPILER_VERSION MATCHES ".*4\\.[5-9].*")
    set(OST_GCC_45 true)
  else()   
    set(OST_GCC_45 false)  
  endif()
endif()

option(USE_SHADER "whether to compile with shader support"
       OFF)
option(USE_RPATH "embed rpath upon make install"
       OFF)
option(COMPILE_TMTOOLS "whether to compile the tmalign and tmscore programs"
       OFF)
option(PROFILE "whether to compile with profiling support"
       OFF)       
option(ENABLE_GUI "whether the graphical user interface should be enabled"
       ON)
option(ENABLE_GFX "whether graphics support should be enabled"
      ON)
option(USE_MESA "use software rendered Mesa instead of hardware GL"
      OFF)
option(ENABLE_IMG "whether the image processing module should be compiled"
       ON)
option(ENABLE_INFO "whether openstructure should be compiled with support for the info library"
       ON)
option(USE_NUMPY "whether numpy support is added"
      OFF)
option(USE_DOUBLE_PRECISION "whether to compile in double precision" 
       OFF)
option(ENABLE_SPNAV "whether 3DConnexion devices should be supported"
      OFF)
option(STATIC_PROPERTY_WORKAROUND "workaround for static property bug with some boost/boost_python combinations" OFF)
option(COMPILE_TESTS "whether unit tests should be compiled by default" OFF)
option(ENABLE_STATIC "whether static libraries should be compiled" OFF)
option(UBUNTU_LAYOUT "whether Debian/Ubuntu's lib and libexec directory layout should be used" OFF)
option(HIDDEN_VISIBILITY "on gcc, use -fvisibility=hidden" OFF)
option(ENABLE_MM "whether openmm support is added" OFF)

if (CXX)
  set(CMAKE_CXX_COMPILER ${CXX})
endif()

if (CC)
  set(CMAKE_C_COMPILER ${CC})
endif()

if (FORTRAN_COMPILER)
  set(CMAKE_FORTRAN_COMPILER ${FORTRAN_COMPILER})
endif()



if (PREFIX)