Skip to content
Snippets Groups Projects
Commit d20b8fcc authored by Bienchen's avatar Bienchen Committed by BIOPZ-Johner Niklaus
Browse files

Update CMakeLists.txt in docu

parent 2f5ed067
No related branches found
No related tags found
No related merge requests found
...@@ -18,9 +18,9 @@ set(PROMOD3_VERSION_MINOR 1) ...@@ -18,9 +18,9 @@ set(PROMOD3_VERSION_MINOR 1)
set(PROMOD3_VERSION_PATCH 0) set(PROMOD3_VERSION_PATCH 0)
set(PROMOD3_VERSION_STRING ${PROMOD3_VERSION_MAJOR}.${PROMOD3_VERSION_MINOR}.${PROMOD3_VERSION_PATCH}) set(PROMOD3_VERSION_STRING ${PROMOD3_VERSION_MAJOR}.${PROMOD3_VERSION_MINOR}.${PROMOD3_VERSION_PATCH})
option(DISABLE_DOCUMENTATION "whether to compile with shader support" OFF) option(DISABLE_DOCUMENTATION "Do not build documentation" OFF)
option(DISABLE_DISABLE_DOCTEST "whether to compile with shader support" OFF) option(DISABLE_DISABLE_DOCTEST "Do not check examples in documentation" OFF)
option(DISABLE_DISABLE_LINKCHECK "whether to compile with shader support" OFF) option(DISABLE_DISABLE_LINKCHECK "Do not check links in the documentation" OFF)
if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCXX)
exec_program(gcc ARGS --version OUTPUT_VARIABLE CMAKE_C_COMPILER_VERSION) exec_program(gcc ARGS --version OUTPUT_VARIABLE CMAKE_C_COMPILER_VERSION)
......
...@@ -189,7 +189,7 @@ the Internet. Nevertheless, here is a short list of most important advices: ...@@ -189,7 +189,7 @@ the Internet. Nevertheless, here is a short list of most important advices:
:file:`tests/data` :file:`tests/data`
* If 'exotic' |python| modules are used, consider making the test aware of the * If 'exotic' |python| modules are used, consider making the test aware of the
possibility that the module is not available possibility that the module is not available
* Test do not fail on purpose * Tests do not fail on purpose
* No failing tests, that are considered 'this does not affect anything' * No failing tests, that are considered 'this does not affect anything'
To run the whole test suite, ``make check`` is enough. This will also trigger To run the whole test suite, ``make check`` is enough. This will also trigger
...@@ -359,108 +359,130 @@ top level :file:`CMakeLists.txt`: ...@@ -359,108 +359,130 @@ top level :file:`CMakeLists.txt`:
.. code-block:: cmake .. code-block:: cmake
:linenos: :linenos:
:emphasize-lines: 83 :emphasize-lines: 103
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Author: Bienchen # Author: Bienchen
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Options to CMake: # Options to CMake:
# DISABLE_DOCUMENTATION: Don't build documentation, don't search for Sphinx # DISABLE_DOCUMENTATION: Don't build documentation, don't search for Sphinx
# DISABLE_DOCTEST: Don't run example code from documentation on 'make check' # DISABLE_DOCTEST: Don't run example code from documentation on 'make check'
# DISABLE_LINKCHECK: Don't test links from documentation on 'make check' # DISABLE_LINKCHECK: Don't test links from documentation on 'make check'
# (if documentation is disabled, there is no doctest, linkcheck at all) # (if documentation is disabled, there is no doctest, linkcheck at all)
cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR) cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake_support) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake_support)
project(PROMOD3 CXX C) project(ProMod3 CXX C)
include(PROMOD3) include(PROMOD3)
set(PROMOD3_VERSION_MAJOR 0) set(PROMOD3_VERSION_MAJOR 0)
set(PROMOD3_VERSION_MINOR 1) set(PROMOD3_VERSION_MINOR 1)
set(PROMOD3_VERSION_PATCH 0) set(PROMOD3_VERSION_PATCH 0)
set(PROMOD3_VERSION_STRING ${PROMOD3_VERSION_MAJOR}.${PROMOD3_VERSION_MINOR}.${PROMOD3_VERSION_PATCH}) set(PROMOD3_VERSION_STRING ${PROMOD3_VERSION_MAJOR}.${PROMOD3_VERSION_MINOR}.${PROMOD3_VERSION_PATCH})
if (CMAKE_COMPILER_IS_GNUCXX) option(DISABLE_DOCUMENTATION "Do not build documentation" OFF)
exec_program(gcc ARGS --version OUTPUT_VARIABLE CMAKE_C_COMPILER_VERSION) option(DISABLE_DISABLE_DOCTEST "Do not check examples in documentation" OFF)
if(CMAKE_C_COMPILER_VERSION MATCHES ".*4\\.[5-9].*") option(DISABLE_DISABLE_LINKCHECK "Do not check links in the documentation" OFF)
set(PROMOD_GCC_45 true)
else() if (CMAKE_COMPILER_IS_GNUCXX)
set(PROMOD_GCC_45 false) exec_program(gcc ARGS --version OUTPUT_VARIABLE CMAKE_C_COMPILER_VERSION)
endif() if(CMAKE_C_COMPILER_VERSION MATCHES ".*4\\.[5-9].*")
endif() set(PROMOD_GCC_45 true)
else()
if (OPTIMIZE) set(PROMOD_GCC_45 false)
set(CMAKE_BUILD_TYPE Release) endif()
set(_OPT ON) endif()
else()
set(CMAKE_BUILD_TYPE Debug) if (OPTIMIZE)
set(_OPT OFF) set(CMAKE_BUILD_TYPE Release)
endif() set(_OPT ON)
else()
setup_stage() set(CMAKE_BUILD_TYPE Debug)
file(MAKE_DIRECTORY ${STAGE_DIR} set(_OPT OFF)
${EXECUTABLE_OUTPUT_PATH} endif()
${HEADER_STAGE_PATH}
${LIB_STAGE_PATH} setup_stage()
${LIBEXEC_STAGE_PATH}) file(MAKE_DIRECTORY ${STAGE_DIR}
${EXECUTABLE_OUTPUT_PATH}
setup_compiler_flags() ${HEADER_STAGE_PATH}
setup_boost() ${LIB_STAGE_PATH}
${LIBEXEC_STAGE_PATH})
find_package(Python 2.7 REQUIRED)
if(NOT DISABLE_DOCUMENTATION) setup_compiler_flags()
find_package(Sphinx ${PYTHON_VERSION} REQUIRED) setup_boost()
set(PYTHON_DOC_URL "https://docs.python.org/${PYTHON_VERSION}")
# set this to the URL corresponding to the version of OST you are using find_package(Python 2.7 REQUIRED)
set(OST_DOC_URL "http://www.openstructure.org/docs/1.3") if(NOT DISABLE_DOCUMENTATION)
endif() find_package(Sphinx ${PYTHON_VERSION} REQUIRED)
find_package(OPENSTRUCTURE 1.4 REQUIRED set(PYTHON_DOC_URL "https://docs.python.org/${PYTHON_VERSION}")
COMPONENTS io mol seq seq_alg mol_alg conop) # set this to the URL corresponding to the version of OST you are using
find_package(QMEAN 1.0 REQUIRED) set(OST_DOC_URL "http://www.openstructure.org/docs/1.3")
endif()
if (CMAKE_COMPILER_IS_GNUCXX) find_package(OPENSTRUCTURE 1.4 REQUIRED
# do not write back into cache, otherwise the compile command line gets COMPONENTS io mol seq seq_alg mol_alg conop)
# expanded with multiple -fno-strict-aliasing flags, triggering a complete find_package(QMEAN 1.0 REQUIRED)
# rebuild whenever cmake is run
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-strict-aliasing") #The KIC loop closing algorithm requires a solver for a generalized eigen
if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "4.6") #problem. Eigen3 would provide such a solver, but only allows to extract
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes") #the resulting eigenvalues and not the eigenvectors.
endif("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "4.6") #As soon as there is an Eigen3 release with the required functionality,
endif() #The Lapack dependency can be dropped.
find_package(LAPACK)
# basic environment
include_directories(${Boost_INCLUDE_DIRS} if (CMAKE_COMPILER_IS_GNUCXX)
${OST_INCLUDE_DIR} # do not write back into cache, otherwise the compile command line gets
${QMEAN_INCLUDE_DIR}) # expanded with multiple -fno-strict-aliasing flags, triggering a complete
# rebuild whenever cmake is run
set(FILES_TO_BE_REMOVED ${PROJECT_BINARY_DIR}/stage) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-strict-aliasing")
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "4.6")
"${FILES_TO_BE_REMOVED}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes")
endif("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "4.6")
## sub dirs to be recognised by CMake endif()
## e.g. add_subdirectory(src), subdirs have their own CMakeLists.txt
add_subdirectory(config) # additional packages/ headers/ etc.
add_subdirectory(core) # Eigen3 is mandatory right now but may vanish once OST switches to the same
add_subdirectory(meld) # version.
add_subdirectory(sidechains) find_package(Eigen3 3.2.1 REQUIRED)
add_subdirectory(scripts) if(NOT EIGEN3_FOUND)
add_subdirectory(actions) message(FATAL_ERROR "Eigen3 is essential for building ${PROJECT_NAME}.")
add_subdirectory(extras) endif()
if(NOT DISABLE_DOCUMENTATION)
add_changelog_to_doc(FILE "${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG") # basic environment
add_subdirectory(doc) include_directories(${Boost_INCLUDE_DIRS}
endif() ${OST_INCLUDE_DIR}
${QMEAN_INCLUDE_DIR}
## report setup ${EIGEN3_INCLUDE_DIR})
message(STATUS "PROMOD3 will be built with the following options:\n"
" OpenStructure (-DOST_ROOT) : ${OST_ROOT}\n" set(FILES_TO_BE_REMOVED ${PROJECT_BINARY_DIR}/stage)
" QMEAN (-DQMEAN_ROOT) : ${QMEAN_ROOT}\n" set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
" Optimized (-DOPTIMIZE) : ${_OPT}\n" "${FILES_TO_BE_REMOVED}")
" Python : ${PYTHON_BINARY}\n")
## sub dirs to be recognised by CMake
## e.g. add_subdirectory(src), subdirs have their own CMakeLists.txt
add_subdirectory(config)
add_subdirectory(core)
add_subdirectory(meld)
add_subdirectory(sidechains)
add_subdirectory(loop)
add_subdirectory(scripts)
add_subdirectory(actions)
add_subdirectory(extras)
if(NOT DISABLE_DOCUMENTATION)
add_changelog_to_doc(FILE "${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG")
add_subdirectory(doc)
endif()
## report setup
message(STATUS "${PROJECT_NAME} will be built with the following options:\n"
" OpenStructure (-DOST_ROOT) : ${OST_ROOT}\n"
" QMEAN (-DQMEAN_ROOT) : ${QMEAN_ROOT}\n"
" Optimized (-DOPTIMIZE) : ${_OPT}\n"
" Python : ${PYTHON_BINARY}\n"
" Eigen3 : ${EIGEN3_INCLUDE_DIR}\n")
All that needs to be done for |cmake| to recognise your module is adding its All that needs to be done for |cmake| to recognise your module is adding its
directory as shown in line 83. directory as shown in line 103.
This was the final step to set up the build system. Running |cmake| at this This was the final step to set up the build system. Running |cmake| at this
point would create the build environment in place. But building software in point would create the build environment in place. But building software in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment