Massive conversion from Package to CMakePackage (#4975)
This commit is contained in:
@@ -23,11 +23,9 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
from spack import *
|
||||
import os
|
||||
import shutil
|
||||
|
||||
|
||||
class Cereal(Package):
|
||||
class Cereal(CMakePackage):
|
||||
"""cereal is a header-only C++11 serialization library. cereal takes
|
||||
arbitrary data types and reversibly turns them into different
|
||||
representations, such as compact binary encodings, XML, or
|
||||
@@ -54,25 +52,18 @@ class Cereal(Package):
|
||||
|
||||
depends_on('cmake@2.6.2:', type='build')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
def patch(self):
|
||||
# Don't use -Werror
|
||||
filter_file(r'-Werror', '', 'CMakeLists.txt')
|
||||
|
||||
# configure
|
||||
def cmake_args(self):
|
||||
# Boost is only used for self-tests, which we are not running (yet?)
|
||||
cmake('.',
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_Boost=TRUE',
|
||||
'-DSKIP_PORTABILITY_TEST=TRUE',
|
||||
*std_cmake_args)
|
||||
return [
|
||||
'-DCMAKE_DISABLE_FIND_PACKAGE_Boost=TRUE',
|
||||
'-DSKIP_PORTABILITY_TEST=TRUE',
|
||||
]
|
||||
|
||||
# Build
|
||||
make()
|
||||
|
||||
# Install
|
||||
shutil.rmtree(join_path(prefix, 'doc'), ignore_errors=True)
|
||||
shutil.rmtree(join_path(prefix, 'include'), ignore_errors=True)
|
||||
shutil.rmtree(join_path(prefix, 'lib'), ignore_errors=True)
|
||||
shutil.copytree('doc', join_path(prefix, 'doc'), symlinks=True)
|
||||
shutil.copytree('include', join_path(prefix, 'include'), symlinks=True)
|
||||
# Create empty directory to avoid linker warnings later
|
||||
os.mkdir(join_path(prefix, 'lib'))
|
||||
def install(self, spec, prefix):
|
||||
with working_dir(self.build_directory):
|
||||
install_tree('doc', prefix.doc)
|
||||
install_tree('include', prefix.include)
|
||||
|
Reference in New Issue
Block a user