Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90021684
CMakeLists.txt
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Oct 28, 13:20
Size
5 KB
Mime Type
text/x-c
Expires
Wed, Oct 30, 13:20 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
21994914
Attached To
rLIBMULTISCALE LibMultiScale
CMakeLists.txt
View Options
#===============================================================================
# @file CMakeLists.txt
#
# @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
# @author Nicolas Richart <nicolas.richart@epfl.ch>
#
# @date Mon Jul 28 12:20:03 2014
#
# @brief This is the main CMake configuration file for LM
#
# @section LICENSE
#
# Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne)
# Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
#
# LibMultiScale is free software: you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# LibMultiScale is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with LibMultiScale. If not, see <http://www.gnu.org/licenses/>.
#
#===============================================================================
#===============================================================================
# Project definition
#===============================================================================
cmake_minimum_required(VERSION 2.8)
project(LibMultiScale)
enable_language(CXX)
#===============================================================================
# Misc. config for cmake
#===============================================================================
set(LIBMULTISCALE_CMAKE_DIR "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules")
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries.")
include(LibMultiScaleMacros)
include(CMakeFlagsHandling)
include(CMakeVersionGenerator)
include(CMakeDebugMessages)
include(CMakePackagesSystem)
#===============================================================================
# Version Number
#===============================================================================
# LIBMULTISCALE version number. An even minor number corresponds to releases.
set(LIBMULTISCALE_MAJOR_VERSION 2)
set(LIBMULTISCALE_MINOR_VERSION 1)
set(LIBMULTISCALE_BUILD_VERSION 0)
define_project_version()
#===============================================================================
# Options
#===============================================================================
option(LIBMULTISCALE_OPTIMIZE "Set this if you want libmultiscale to be fully optimized" OFF)
if(LIBMULTISCALE_OPTIMIZE)
add_definitions(-DLM_OPTIMIZED)
endif(LIBMULTISCALE_OPTIMIZE)
add_flags(cxx -Wall)
add_flags(cxx -fPIC)
#add_flags(cxx -std=gnu++0x)
#add_flags(cxx -std=c++11)
add_flags(SHARED_LINKER -fPIC)
if (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
add_flags(cxx -vec-report=0)
endif()
#===============================================================================
# LibMultiScale library
#===============================================================================
#cmake_activate_debug_message(TestSystem)
cmake_deactivate_debug_message()
package_list_packages(${PROJECT_SOURCE_DIR}/packages
EXTRA_PACKAGES_FOLDER ${PROJECT_SOURCE_DIR}/extra_packages)
add_subdirectory(src)
set(LIBMULTISCALE_DEPEND_FILES "")
#===============================================================================
# Release file target
#===============================================================================
set(GET_RELEASE_INFO ${PROJECT_SOURCE_DIR}/get_release_info.sh)
set(RELEASE_FILE ${PROJECT_BINARY_DIR}/release.cc)
find_program(uuencode_exec "uuencode")
mark_as_advanced(uuencode_exec)
if(uuencode_exec)
add_custom_command(
OUTPUT ${RELEASE_FILE}
COMMAND bash ${GET_RELEASE_INFO} ${uuencode_exec} ${PROJECT_BINARY_DIR} > ${RELEASE_FILE}
DEPENDS ${LIBMULTISCALE_DEPEND_FILES} ${GET_RELEASE_INFO}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
else()
message("install uuencode on the building machine to have access to release information.")
file(WRITE "${RELEASE_FILE}"
"
#include <string>
std::string lm_release_info = \" install uuencode on the building machine to have access to release information.\";
")
endif()
add_custom_target(RELEASE_INFO DEPENDS ${RELEASE_FILE})
#===============================================================================
# LibMultiScale AMEL + LMPOST
#===============================================================================
add_subdirectory(clients)
#===============================================================================
# Documentation
#===============================================================================
option(LIBMULTISCALE_DOCUMENTATION "Build documentation." OFF)
if(LIBMULTISCALE_DOCUMENTATION)
add_subdirectory(doc)
endif(LIBMULTISCALE_DOCUMENTATION)
#===============================================================================
# Tests
#===============================================================================
package_declare(TESTS
DESCRIPTION "Activate the tests"
DEFAULT OFF
)
package_get_option_name(TESTS _option_name)
if(${_option_name})
enable_testing()
include(CTest)
add_subdirectory(test)
mark_as_advanced(BUILD_TESTING)
endif()
#===============================================================================
# CPack
#===============================================================================
include(LibMultiScaleCPack)
Event Timeline
Log In to Comment