cosmotool/CMakeLists.txt
2011-06-06 10:07:12 -04:00

47 lines
1.5 KiB
CMake

cmake_minimum_required(VERSION 2.6)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
project(CosmoToolbox)
include(GetGitRevisionDescription)
get_git_head_revision(HEAD GIT_VER)
option(BUILD_SHARED_LIBS "Build shared libraries." OFF)
find_path(NETCDF_INCLUDE_PATH NAMES netcdf.h)
find_path(GSL_INCLUDE_PATH NAMES gsl/gsl_blas.h)
find_library(NETCDF_LIBRARY netcdf)
find_library(NETCDFCPP_LIBRARY netcdf_c++)
find_library(GSL_LIBRARY gsl)
find_library(GSLCBLAS_LIBRARY gslcblas)
set(HDF5_FIND_COMPONENTS CXX)
include(FindHDF5)
include(FindPackageHandleStandardArgs)
set(NETCDF_FIND_REQUIRED TRUE)
set(GSL_FIND_REQUIRED TRUE)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NetCDF DEFAULT_MSG NETCDF_LIBRARY NETCDFCPP_LIBRARY NETCDF_INCLUDE_PATH)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GSL DEFAULT_MSG GSL_LIBRARY GSLCBLAS_LIBRARY GSL_INCLUDE_PATH)
# CPACK Configuration
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A toolbox for impatient cosmologists")
SET(CPACK_PACKAGE_VENDOR "Guilhem Lavaux")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENCE_CeCILL_V2")
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
SET(CPACK_PACKAGE_VERSION_MINOR "0")
SET(CPACK_PACKAGE_VERSION_PATCH "0-${GIT_VER}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CosmoToolbox-${GalaxExplorer_VERSION_MAJOR}.${GalaxExplorer_VERSION_MINOR}")
SET(CPACK_STRIP_FILES "lib/libCosmoTool.so")
SET(CPACK_SOURCE_IGNORE_FILES
"/CVS/;/\\\\.git/;/\\\\.svn/;\\\\.swp$;\\\\.#;/#;.*~;cscope.*;/CMakeFiles/;.*\\\\.cmake;Makefile")
add_subdirectory(src)
add_subdirectory(sample)
include(CPack)