## contrib installation file for OpenMS

## *** IMPORTANT ***
## when updating the contrib with new packages:
## GENERAL:
## - make sure to adopt the following variables for each library <LIBNAME>, currently we have
##    * <LIBNAME>_DIR
##    * ARCHIVE_<LIBNAME>
##    * ARCHIVE_<LIBNAME>_TAR
##    * INCLUDE_DIR_<LIBNAME> (or INCLUDE_FILES_<LIBNAME> in the case that there are just files copied to include/ [LIBSVM])
##
## WINDOWS ONLY: [the information below applies only to WINDOWS, but when you update the contrib you MUST do both Linux, Mac OS X and Windows - so read carefully!]
## - usually each package contains a build-system for Windows (solution [*.sln] files or NMake files [Makefile.win] ) and Linux(Makefiles) already provided by
##   the original developer. In some cases you need to rely on third party packages, e.g. the gsl-win project, which provides solution files.
##   HOWEVER, for Windows they are usually not complete (e.g. missing 64bit targets, or even whole solution files
##   for a certain Visual Studio version (we support 8 and 9 and 10).
##	 Case a: 64bit targets are missing in Solution file
##	 	Solution: open the VS solution and add x64 solution platform using the Configuration Manager
##                (you can build the x64 target by adding "|64" to the Build option of devenv.exe - see examples below)
##   Case b: Solution files for a certain Visual Studio Version (usually 9) are missing.
##      Solution: copy the VS8 solution (including vcproj files) - usually this is a separate folder
##				  using the VS9 IDE, open the copied VS8 solution (a converter tool should automatically open) and follow the steps.
##				  (optionally rename the converted solution e.g. from xerces_vs8.sln to xerces_vs9.sln)
## Remember: in the end, you need three solution files (VS8 & VS9 & VS10), each supporting 32 and 64 bit platforms.
##
## Making sure linking is consistent:
##		- when combining external libs with our own, Microsoft's linker can only handle one type of reference to the C(++) standard libs, which is either
##      dynamic (/MD(d)) or static (/MT(d)), but not both (you will get multiply defined symbols and tons of linker errors).
##      Note that this does not mean you cannot mix static and dynamic external libraries (you can), it rather means you cannot mix static and dynamic CRT's.
##      Thus, make sure to check every new solution file you add is linking to the *dynamic* CRT with /MD(d).
##
##
## Alternatively, some projects use NMake-files (libsvm does). There it is easier, because you only need one Makefile.win file for all four cases.
## Be aware though that including object files (*.obj) in Visual Studio is not supported by OpenMS/CMake, you thus will need to create a lib
## (see libsvm Makefile.win for an example)
##
##
## Where do I get Windows-packages with at least partially complete solution files?
## Boost:  NA, Boost uses its in-house Boost-Jam which supports everything we need
## SEQAN:  headers only library, no compilation necessary for OpenMS
## LibSVM: comes with a Makefile.win, but libsvm needed some serious tweaking to support debug mode and to build a lib (instead of object files only)
## XERCES-C: they offer a VS version on their website (http://xerces.apache.org/xerces-c/), usually not for bleeding egde release though - bad luck for us.
## GSL:    get the src package from http://gnuwin32.sourceforge.net/packages/gsl.htm,
##         This should still contain the Linux Makefiles.
## GLPK:   download from http://ftp.gnu.org/gnu/glpk/glpk-4.46.tar.gz
## COIN-OR: we use the CoinMP package available from
##         http://www.coin-or.org/download/source/CoinMP/CoinMP-1.3.3.tgz


## some words:
## Patching: We do not (by intention) use a ".is_patched" file, but let patch(.exe) handle create a .orig file, which is in the same location as the patched file

## required software:
## Windows: 7-Zip & GNUWin32-patch
## Linux&MinGW: Tar & patch
## (these are searched for and an appropriate error message is given when not found)

## Example call (for developers only) - remove QUICKBUILD to build BOOST:
## cmake -D CONTRIB_ADDRESSMODEL:STRING=64 -D QUICKBUILD:BOOL=1 -G "Visual Studio 9 2008" ..\contrib_win
## cmake -D CONTRIB_ADDRESSMODEL:STRING=32 -G "Visual Studio 8 2005" ..\contrib_win


## NOTE: remove "exec_program" calls and substitute with exec_process (see http://www.cmake.org/cmake/help/cmake2.6docs.html#command:execute_process)
##       - however: exec_process seems to handle our arguments incorreclty (at least on Windows). Check functionality before you commit!

PROJECT("OpenMS_CONTRIB")

# Heart of the BUILD system : only edit when you know what you are doing (we don't)
# quick manual for most commands: http://www.cmake.org/cmake/help/cmake2.6docs.html
# useful predefined variables: http://www.paraview.org/Wiki/CMake_Useful_Variables

cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)

## sanity check:
## do not allow source or binary directories with spaces
## The contrib can basically handle those (make sure to wrap calls in quotes where appropriate) but e.g. BOOST under windows cannot

string(REPLACE " " "" PROJECT_BINARY_DIR_NOSPACES ${PROJECT_BINARY_DIR})
if (NOT ${PROJECT_BINARY_DIR} STREQUAL ${PROJECT_BINARY_DIR_NOSPACES})
  message(FATAL_ERROR "The current contrib binary directory contains spaces, which are not allowed. Build the contrib in another directory!")
endif()
string(REPLACE " " "" PROJECT_SOURCE_DIR_NOSPACES ${PROJECT_SOURCE_DIR})
if (NOT ${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_SOURCE_DIR_NOSPACES})
  message(FATAL_ERROR "The current contrib binary directory contains spaces, which are not allowed. Build the contrib in another directory!")
endif()

## target directories
set (CONTRIB_BIN_SOURCE_DIR "${PROJECT_BINARY_DIR}/src" CACHE STRING "Directory inside the binary tree where the (extracted) contrib sources are located")
set (CONTRIB_BIN_INCLUDE_DIR "${PROJECT_BINARY_DIR}/include" CACHE STRING "Directory inside the binary tree where the contrib includes are located")
set (CONTRIB_BIN_LIB_DIR "${PROJECT_BINARY_DIR}/lib" CACHE STRING "Directory inside the binary tree where the contrib libs are located")
set (PATCH_DIR "${PROJECT_SOURCE_DIR}/patches/" CACHE STRING "Directory containing all the patch files")

# project specific source directories
## Warning: ensure these are all upper-case names!
set(BZIP2_DIR ${CONTRIB_BIN_SOURCE_DIR}/bzip2-1.0.5)
set(ZLIB_DIR ${CONTRIB_BIN_SOURCE_DIR}/zlib-1.2.5)
set(BOOST_DIR ${CONTRIB_BIN_SOURCE_DIR}/boost_1_52_0)
set(XERCES_DIR ${CONTRIB_BIN_SOURCE_DIR}/xerces-c-r806068)
set(GSL_DIR ${CONTRIB_BIN_SOURCE_DIR}/gsl-1.13)
set(LIBSVM_DIR ${CONTRIB_BIN_SOURCE_DIR}/libsvm-2.91)
set(SEQAN_DIR ${CONTRIB_BIN_SOURCE_DIR}/seqan-r13067)
set(GLPK_DIR ${CONTRIB_BIN_SOURCE_DIR}/glpk-4.46)
set(COINOR_DIR ${CONTRIB_BIN_SOURCE_DIR}/CoinMP-1.3.3)

## source(archive) paths
## NOTE: if the archive is a tar.gz you need to specify the tar file
##       in an extra variable. Remember while specifying the path that
##       the tar itself will be located in the PROJECT_BINARY_DIR
## e.g.:
##    set(ARCHIVE_ZLIB ${PROJECT_SOURCE_DIR}/src/zlib.tar.gz)
##    set(ARCHIVE_ZLIB_TAR ${PROJECT_BINARY_DIR}/src/zlib.tar)

set(ARCHIVE_BZIP2 ${PROJECT_SOURCE_DIR}/src/bzip2-1.0.5.tar.gz)
set(ARCHIVE_BZIP2_TAR ${PROJECT_BINARY_DIR}/src/bzip2-1.0.5.tar)
set(ARCHIVE_ZLIB ${PROJECT_SOURCE_DIR}/src/zlib-1.2.5.tar.gz)
set(ARCHIVE_ZLIB_TAR ${PROJECT_BINARY_DIR}/src/zlib-1.2.5.tar)
set(ARCHIVE_BOOST ${PROJECT_SOURCE_DIR}/src/boost_1_52_0.tar.gz)
set(ARCHIVE_BOOST_TAR ${PROJECT_BINARY_DIR}/src/boost_1_52_0.tar)
set(ARCHIVE_XERCES ${PROJECT_SOURCE_DIR}/src/xerces-c-r806068.tar.gz)
set(ARCHIVE_XERCES_TAR ${PROJECT_BINARY_DIR}/src/xerces-c-r806068.tar)
set(ARCHIVE_GSL ${PROJECT_SOURCE_DIR}/src/gsl-1.13.tar.gz)
set(ARCHIVE_GSL_TAR ${PROJECT_BINARY_DIR}/src/gsl-1.13.tar)
set(ARCHIVE_LIBSVM ${PROJECT_SOURCE_DIR}/src/libsvm-2.91.tar.gz)
set(ARCHIVE_LIBSVM_TAR ${PROJECT_BINARY_DIR}/src/libsvm-2.91.tar)
set(ARCHIVE_SEQAN ${PROJECT_SOURCE_DIR}/src/seqan-r13067.tar.gz)
set(ARCHIVE_SEQAN_TAR ${PROJECT_BINARY_DIR}/src/seqan-r13067.tar)
set(ARCHIVE_GLPK ${PROJECT_SOURCE_DIR}/src/glpk-4.46.tar.gz)
set(ARCHIVE_GLPK_TAR ${PROJECT_BINARY_DIR}/src/glpk-4.46.tar)
set(ARCHIVE_COINOR ${PROJECT_SOURCE_DIR}/src/CoinMP-1.3.3.tar.gz)
set(ARCHIVE_COINOR_TAR ${PROJECT_BINARY_DIR}/src/CoinMP-1.3.3.tar)

## necessary for cleanup .. change if install process of library changes
set(INCLUDE_DIR_BOOST ${CONTRIB_BIN_INCLUDE_DIR}/boost)
set(INCLUDE_DIR_XERCES ${CONTRIB_BIN_INCLUDE_DIR}/xercesc)
set(INCLUDE_DIR_GSL ${CONTRIB_BIN_INCLUDE_DIR}/gsl)
set(INCLUDE_DIR_SEQAN ${CONTRIB_BIN_INCLUDE_DIR}/seqan)
set(INCLUDE_DIR_GLPK ${CONTRIB_BIN_INCLUDE_DIR}/GLPK)
set(INCLUDE_DIR_COINOR ${CONTRIB_BIN_INCLUDE_DIR}/coin)

## hack for simple libs that do not have include directories
set(INCLUDE_FILES_LIBSVM ${CONTRIB_BIN_INCLUDE_DIR}/svm.h)
set(INCLUDE_FILES_BZIP2 ${CONTRIB_BIN_INCLUDE_DIR}/bzlib.h ${CONTRIB_BIN_INCLUDE_DIR}/bzlib_private.h)
set(INCLUDE_FILES_ZLIB ${CONTRIB_BIN_INCLUDE_DIR}/zlib.h)

## address model of contrib
if (CMAKE_SIZEOF_VOID_P MATCHES "8")
	set(CONTRIB_ADDRESSMODEL 64 CACHE INTERNAL "Architecture-bits")
else()
	set(CONTRIB_ADDRESSMODEL 32 CACHE INTERNAL "Architecture-bits")
endif()
message(STATUS "ADDRESSMODEL IS: ${CONTRIB_ADDRESSMODEL} bit")
if (NOT CONTRIB_ADDRESSMODEL MATCHES "32|64")
	Message(FATAL_ERROR "CONTRIB_ADDRESSMODEL is neither 32 nor 64! Please correct this!")
endif()

# logfile
set(LOGFILE "${PROJECT_BINARY_DIR}/contrib_build.log")

if (MSVC)
	## guess MSVC Version (we need this in order to correctly guess the names of the VS solution targets.
	set(CONTRIB_MSVC_VERSION "" CACHE STRING "Microsoft Visual Studio Version used. Valid values: 8, 9 or 10 (7 is NOT supported)")
	if (CMAKE_GENERATOR MATCHES ".*Visual Studio 8 2005.*")
		set(CONTRIB_MSVC_VERSION "8")
	elseif (CMAKE_GENERATOR MATCHES ".*Visual Studio 9 2008.*")
		set(CONTRIB_MSVC_VERSION "9")
	elseif (CMAKE_GENERATOR MATCHES ".*Visual Studio 10.*")
		set(CONTRIB_MSVC_VERSION "10")
	elseif (CMAKE_GENERATOR MATCHES ".*Visual Studio 11.*")
		set(CONTRIB_MSVC_VERSION "11")
	else()
		message(FATAL_ERROR "Please use 'Visual Studio 8 2005 [Win64]' or 'Visual Studio 9 2008 [Win64]' or 'Visual Studio 10 [Win64]' or 'Visual Studio 11 [Win64]' as Generator - identical to the one you plan to use for OpenMS!")
	endif()
	## parameter validity check
	message(STATUS "MSVC Version is: ${CONTRIB_MSVC_VERSION}")

	## some settings for Building the libs
	if (CONTRIB_ADDRESSMODEL MATCHES 32)
		set(BOOST_ARG "")
		set(WIN_PLATFORM_ARG "Win32")
	else()
		set(BOOST_ARG "address-model=64")
		set(WIN_PLATFORM_ARG "x64")
	endif()

	find_program(PROGRAM_ZIP "7z.exe" PATHS "C:/Program Files/7-Zip" "C:/Programme/7-Zip")
	if (NOT PROGRAM_ZIP)
		message(FATAL_ERROR "Cannot find '7z.exe' on your system. Please install 7-zip and add the directory to your PATH environment variable!")
	endif()

	## http://gnuwin32.sourceforge.net/packages/patch.htm
	find_program(PROGRAM_PATCH "patch.exe" PATHS "C:/Program Files/gnuwin32/bin" "C:/Program Files/patch/bin")
	if (NOT PROGRAM_PATCH)
		message(FATAL_ERROR "Cannot find 'patch.exe' on your system. Please install gnuwin32-patch and add the directory to your PATH environment variable!")
	endif()

else() ## linux/Mingw/macos
  # tar
	find_program(PROGRAM_ZIP "tar")
	if (NOT PROGRAM_ZIP)
		message(FATAL_ERROR "Cannot find 'tar' on your system. Please install 7-zip and add the directory to your PATH environment variable!")
	endif()

  # patch
	find_program(PROGRAM_PATCH "patch")
	if (NOT PROGRAM_PATCH)
		message(FATAL_ERROR "Cannot find 'patch' on your system. Please install patch and add the directory to your PATH environment variable!")
	endif()

  ## following progs are required for xerces-c, since we build from svn and not a release
  # autoconf
  find_program(PROGRAM_AUTOCONF "autoconf")
  if (NOT PROGRAM_AUTOCONF)
    message(FATAL_ERROR "Cannot find 'autoconf' on your system. Please install autoconf and add the directory to your PATH environment variable!")
  endif()

  # automake
  find_program(PROGRAM_AUTOMAKE "automake")
  if (NOT PROGRAM_AUTOMAKE)
    message(FATAL_ERROR "Cannot find 'automake' on your system. Please install automake and add the directory to your PATH environment variable!")
  endif()

	# libtoolize
  find_program(PROGRAM_LIBTOOLIZE NAMES "libtoolize" "glibtoolize")
  if (NOT PROGRAM_LIBTOOLIZE)
    message(FATAL_ERROR "Cannot find '(g)libtoolize' on your system. Please install libtoolize and add the directory to your PATH environment variable!")
  endif()

  # touch
  find_program(PROGRAM_TOUCH "touch")
  if (NOT PROGRAM_TOUCH)
    message(FATAL_ERROR "Cannot find 'touch' on your system. Please install touch and add the directory to your PATH environment variable!")
  endif()

	# libtoolize
  find_program(PROGRAM_LIBTOOLIZE NAMES "libtoolize" "glibtoolize")
  if (NOT PROGRAM_LIBTOOLIZE)
    message(FATAL_ERROR "Cannot find '(g)libtoolize' on your system. Please install libtoolize and add the directory to your PATH environment variable!")
  endif()
endif()

# see if we use GNU CXX/CC -- this one is required for CGAL etc.
# TODO: check if this one is really working
#if(NOT MSVC AND NOT CMAKE_COMPILER_IS_GNUCXX)
#  message(FATAL_ERROR "Please specify the GNU CXX (g++) as C++ compiler")
#elseif(NOT MSVC AND NOT CMAKE_COMPILER_IS_GNUCC)
#  message(FATAL_ERROR "Please specify the GNU C (gcc) as C compiler")
#endif()


## prepare
file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
file(MAKE_DIRECTORY "${CONTRIB_BIN_SOURCE_DIR}")
file(MAKE_DIRECTORY "${CONTRIB_BIN_INCLUDE_DIR}")

## initial log values
file(WRITE ${LOGFILE} "-- Starting to build contrib --\n\r")
file(APPEND ${LOGFILE} "CXX: ${CMAKE_CXX_COMPILER}\n\r")
file(APPEND ${LOGFILE} "CC: ${CMAKE_C_COMPILER}\n\r")

## include extract/patch/build macros
include ("${CMAKE_SOURCE_DIR}/macros.cmake")
include ("${CMAKE_SOURCE_DIR}/libraries.cmake/seqan.cmake")
include ("${CMAKE_SOURCE_DIR}/libraries.cmake/libsvm.cmake")
include ("${CMAKE_SOURCE_DIR}/libraries.cmake/xercesc.cmake")
include ("${CMAKE_SOURCE_DIR}/libraries.cmake/boost.cmake")
include ("${CMAKE_SOURCE_DIR}/libraries.cmake/gsl.cmake")
include ("${CMAKE_SOURCE_DIR}/libraries.cmake/glpk.cmake")
include ("${CMAKE_SOURCE_DIR}/libraries.cmake/bzip2.cmake")
include ("${CMAKE_SOURCE_DIR}/libraries.cmake/zlib.cmake")
include ("${CMAKE_SOURCE_DIR}/libraries.cmake/coinor.cmake")

## build mac os x specific C/C++ flags
set( OPENMS_CONTRIB_MACOSX_MIXED_MODE 0 CACHE INTERNAL "building multiple architectures on MacOSX" FORCE)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  set(CXX_OSX_FLAGS "-mmacosx-version-min=10.6")
  message(STATUS "Using custom OS X architecture flags for CXX compiler: \"${CXX_OSX_FLAGS}\"")
  file(APPEND ${LOGFILE} "Using custom OS X architecture flags for CXX compiler: \"${CXX_OSX_FLAGS}\"\n\r")

	# check ich c++ is used; if, switch to g++ for some strange
	# incompatibility reasons
	if (${CMAKE_CXX_COMPILER} MATCHES "/c[+][+]")
		set(MACOSX_COMPILER ${CMAKE_CXX_COMPILER})
		string(REPLACE "c++" "g++" MACOSX_FIXED_COMPILER ${MACOSX_COMPILER})
		message(WARNING "Using '${CMAKE_CXX_COMPILER}' may cause problems, automatically replacing by '${MACOSX_FIXED_COMPILER}'!")
		set(CMAKE_CXX_COMPILER ${MACOSX_FIXED_COMPILER} CACHE INTERNAL "Forcing '${CMAKE_CXX_COMPILER}' compiler (replacing '${CMAKE_CXX_COMPILER}' compiler)." FORCE)
	endif()

  # force cmake > 2.8.1 to avoid bugs with OSX_DEPLOYMENT_TARGET
  cmake_minimum_required(VERSION 2.8.1 FATAL_ERROR)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

##determine what to build (all or single library)
set( BUILD_TYPE ALL CACHE STRING "Can be used to restrict building to a single library: ALL,SEQAN,LIBSVM,XERCESC,BOOST,GSL,COINOR,BZIP2,ZLIB,GLPK")

set( VALID_BUILD_TYPES "ALL" "SEQAN" "LIBSVM" "XERCESC" "BOOST" "GSL" "COINOR" "BZIP2" "ZLIB" "GLPK")
# check build type
list(FIND VALID_BUILD_TYPES ${BUILD_TYPE} list_pos)
if( ${list_pos} EQUAL -1 )
	message(STATUS "The BUILD_TYPE ${BUILD_TYPE} is invalid")
	message(STATUS "Valid BUILD_TYPEs are:")
	foreach( BT ${VALID_BUILD_TYPES} )
		message(STATUS " * ${BT}")
	endforeach( BT VALID_BUILD_TYPES )
	message(FATAL_ERROR "Aborting contrib build!")
else( ${list_pos} EQUAL -1 )
	message(STATUS "BUILD_TYPE: ${BUILD_TYPE} (one of: ${VALID_BUILD_TYPES})")
endif( ${list_pos} EQUAL -1 )

set( FORCE_REBUILD OFF CACHE BOOL "All installation and build traces of the contrib packages will be removed before building.")
message(STATUS "FORCE_REBUILD: ${FORCE_REBUILD}")

set( NUMBER_OF_JOBS 2 CACHE STRING "Number of jobs executed in parallel during the build process if the build system supports multi-job builds (e.g., make, bjam)")
if("${NUMBER_OF_JOBS}" STREQUAL "")
  set( NUMBER_OF_JOBS 1 )
endif("${NUMBER_OF_JOBS}" STREQUAL "")
message(STATUS "NUMBER_OF_JOBS: ${NUMBER_OF_JOBS} (maximal number of concurrent compile jobs)")

##################################################
###       SEQAN                                ###
##################################################

if (BUILD_TYPE STREQUAL "ALL" OR BUILD_TYPE STREQUAL "SEQAN")
  OPENMS_CLEAN_LIB("SEQAN")
  OPENMS_CONTRIB_BUILD_SEQAN()
  OPENMS_COPY_LIBS("SEQAN")
endif()

##################################################
###       LIBSVM                               ###
##################################################

if (BUILD_TYPE STREQUAL "ALL" OR BUILD_TYPE STREQUAL "LIBSVM")
  OPENMS_CLEAN_LIB("LIBSVM")
  OPENMS_CONTRIB_BUILD_LIBSVM()
  OPENMS_COPY_LIBS("LIBSVM")
endif()

##################################################
###       XERCES                               ###
##################################################

if (BUILD_TYPE STREQUAL "ALL" OR BUILD_TYPE STREQUAL "XERCESC")
  OPENMS_CLEAN_LIB("XERCES")
  OPENMS_CONTRIB_BUILD_XERCESC()
  OPENMS_COPY_LIBS("XERCES")
endif()

##################################################
###       BZIP2                                ###
##################################################

if (BUILD_TYPE STREQUAL "ALL" OR BUILD_TYPE STREQUAL "BZIP2")
  OPENMS_CLEAN_LIB("BZIP2")
  OPENMS_CONTRIB_BUILD_BZIP2()
  OPENMS_COPY_LIBS("BZIP2")
endif()

##################################################
###       ZLIB                                 ###
##################################################

if (BUILD_TYPE STREQUAL "ALL" OR BUILD_TYPE STREQUAL "ZLIB")
  OPENMS_CLEAN_LIB("ZLIB")
  OPENMS_CONTRIB_BUILD_ZLIB()
  OPENMS_COPY_LIBS("ZLIB")
endif()

##################################################
###       BOOST                                ###
##################################################

if (BUILD_TYPE STREQUAL "ALL" OR BUILD_TYPE STREQUAL "BOOST")
  OPENMS_CLEAN_LIB("BOOST")
  OPENMS_CONTRIB_BUILD_BOOST()
  OPENMS_COPY_LIBS("BOOST")
endif()

##################################################
###       GSL                                  ###
##################################################

if (BUILD_TYPE STREQUAL "ALL" OR BUILD_TYPE STREQUAL "GSL")
  OPENMS_CLEAN_LIB("GSL")
  OPENMS_CONTRIB_BUILD_GSL()
  OPENMS_COPY_LIBS("GSL")
endif()


##################################################
###       GLPK                                 ###
##################################################

if (BUILD_TYPE STREQUAL "ALL" OR BUILD_TYPE STREQUAL "GLPK")
  OPENMS_CLEAN_LIB("GLPK")
  OPENMS_CONTRIB_BUILD_GLPK()
  OPENMS_COPY_LIBS("GLPK")
endif()

##################################################
###       COIN-OR                              ###
##################################################

if (BUILD_TYPE STREQUAL "ALL" OR BUILD_TYPE STREQUAL "COINOR")
  OPENMS_CLEAN_LIB("COINOR")
  OPENMS_CONTRIB_BUILD_COINOR()
  OPENMS_COPY_LIBS("COINOR")
endif()

## finally copy README.txt to project-binary directory to mark process complete
configure_file("${PROJECT_SOURCE_DIR}/README" "${PROJECT_BINARY_DIR}/README_contrib1.7.txt"  COPYONLY)


message(STATUS "")
message(STATUS "")
if (BUILD_TYPE STREQUAL "ALL")
  message(STATUS "  The contrib package has been built!")
  message(STATUS "  You can now configure and build OpenMS!")
else()
  message(STATUS "  ${BUILD_TYPE} has been built! Some parts of the contrib might still need (re)building.")
  message(STATUS "  Configure and build OpenMS at your discretion!")
endif()
message(STATUS "")
message(STATUS "")
message(STATUS "")

