4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
22 # Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
23 # Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
24 # Copyright 2016, 2024 Andreas Wacknitz <a.wacknitz@gmx.de>
25 # Copyright 2023 Niklas Poslovski
28 USE_PARALLEL_BUILD
= yes
29 USE_COMMON_TEST_MASTER
= no
30 include ..
/..
/..
/make-rules
/shared-macros.mk
33 COMPONENT_MAJOR_VERSION
= 3.31
34 COMPONENT_VERSION
= $(COMPONENT_MAJOR_VERSION
).2
35 COMPONENT_SUMMARY
= A cross-platform
, open-source make system
36 COMPONENT_DESCRIPTION
= \
37 CMake is a family of tools designed to build
, test and package software. \
38 It is used to control the software compilation process using simple platform \
39 and compiler-independent configuration files. \
40 CMake generates native makefiles and workspaces that can be used in the \
41 workspaces that can be used in the compiler environment of your choice.
42 COMPONENT_PROJECT_URL
= https
://www.cmake.org
43 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
44 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.gz
45 COMPONENT_ARCHIVE_HASH
= sha256
:42abb3f48f37dbd739cdfeb19d3712db0c5935ed5c2aef6c340f9ae9114238a2
46 COMPONENT_ARCHIVE_URL
= $(COMPONENT_PROJECT_URL
)/files
/v
$(COMPONENT_MAJOR_VERSION
)/$(COMPONENT_ARCHIVE
)
47 COMPONENT_FMRI
= developer
/build
/cmake
48 COMPONENT_CLASSIFICATION
=Development
/Distribution Tools
49 COMPONENT_LICENSE
= BSD
3 Clause
, MIT
, GPLv2
, LGPLv2.1
, LGPLv3
, Curl
, PD
51 include $(WS_MAKE_RULES
)/common.mk
53 CMAKE_VERSION
= $(COMPONENT_MAJOR_VERSION
)
54 PKG_MACROS
+= CMAKE_VERSION
=$(CMAKE_VERSION
)
56 GENERATE_EXTRA_CMD
+= | \
57 $(GSED
) -e
's/$(subst .,\.,$(CMAKE_VERSION))/$$(CMAKE_VERSION)/g'
59 # Need to remove this option from LD_OPTIONS (only affects sparc build);
60 # it causes a SegFault failure in kwsys/testSystemInformation
61 # when testing on sparc
64 LDFLAGS
+= $($(COMPILER
)_NORUNPATH
)
66 CONFIGURE_ENV
+= MAKE
="$(GMAKE)"
68 # Remove undesriable /opt/csw lines from the Modules/*.cmake files.
69 COMPONENT_PREP_ACTION
+= \
70 cd
$(COMPONENT_SRC
)/Modules
; $(GNU_GREP
) -l
'/opt/csw' *.cmake | \
71 /usr
/bin
/xargs
-I \
{\
} $(GSED
) -i
-e
'/^[ ]*\/opt\/csw/d' \
{\
}
73 # Remove files polluting the generated manifest
74 COMPONENT_PRE_INSTALL_ACTION
= \
75 $(FIND
) $(SOURCE_DIR
) -name
'*.~1~' -exec
$(RM
) {} \
;
77 CONFIGURE_OPTIONS
= --prefix=$(CONFIGURE_PREFIX
)
78 CONFIGURE_OPTIONS
+= --datadir=/share
/cmake-
$(COMPONENT_MAJOR_VERSION
)
79 CONFIGURE_OPTIONS
+= --docdir
=/share
/doc
/cmake-
$(COMPONENT_MAJOR_VERSION
)
80 CONFIGURE_OPTIONS
+= --mandir=/share
/man
82 # Use system-installed third-party libraries, rather than the private
83 # copies in the cmake source.
84 CONFIGURE_OPTIONS
+= --system-bzip2
85 CONFIGURE_OPTIONS
+= --system-curl
86 CONFIGURE_OPTIONS
+= --system-expat
87 CONFIGURE_OPTIONS
+= --system-jsoncpp
88 CONFIGURE_OPTIONS
+= --system-libarchive
89 CONFIGURE_OPTIONS
+= --system-liblzma
90 CONFIGURE_OPTIONS
+= --system-libuv
91 CONFIGURE_OPTIONS
+= --system-nghttp2
92 CONFIGURE_OPTIONS
+= --system-zlib
93 CONFIGURE_OPTIONS
+= --system-zstd
95 COMPONENT_BUILD_ENV
+= CC
="$(CC)"
96 COMPONENT_BUILD_ENV
+= CXX
="$(CXX)"
97 COMPONENT_BUILD_ENV
+= FC
="$(FC)"
98 COMPONENT_BUILD_ENV
+= CFLAGS
="$(CFLAGS)"
99 COMPONENT_BUILD_ENV
+= CXXFLAGS
="$(CXXFLAGS)"
100 COMPONENT_BUILD_ENV
+= CFLAGS
="$(FCFLAGS)"
101 COMPONENT_BUILD_ENV
+= LDFLAGS
="$(LDFLAGS)"
102 COMPONENT_BUILD_ENV
+= MAKE
="$(GMAKE)"
103 COMPONENT_BUILD_TARGETS
= all
105 ASLR_MODE
= $(ASLR_ENABLE
)
107 # Need C and C++ compiler locations for cmake tests
108 COMPONENT_TEST_ENV
+= LANG
=C
109 COMPONENT_TEST_ENV
+= CC
="$(CC)"
110 COMPONENT_TEST_ENV
+= CXX
="$(CXX)"
111 COMPONENT_TEST_ENV
+= FC
="$(FC)"
112 COMPONENT_TEST_ENV
+= CFLAGS
="$(CFLAGS)"
113 COMPONENT_TEST_ENV
+= CXXFLAGS
="$(CXXFLAGS)"
114 COMPONENT_TEST_ENV
+= FCFLAGS
="$(FCFLAGS)"
115 COMPONENT_TEST_ENV
+= LDFLAGS
="$(LDFLAGS)"
116 # Disable term colors to avoid test failures (actual and expected output mismatch).
117 COMPONENT_TEST_ENV
+= CLICOLOR
=0
119 # Most Fortran tests fail because -m64 they do not pass compiler flags as they should.
120 # Results output is different on Intel vs. SPARC.
121 # The tests should run by a user with default privileges. Otherwise some tests will fail.
122 COMPONENT_TEST_MASTER
= $(COMPONENT_TEST_RESULTS_DIR
)/results-
$(MACH
).master
123 COMPONENT_TEST_TARGETS
= test
125 # Normalize test results
126 COMPONENT_TEST_TRANSFORMS
+= "-e 's/ *[0-9]\{1,\}\.[0-9]\{1,\} sec//'" # remove timing
127 COMPONENT_TEST_TRANSFORMS
+= "-e '/^ *Start/d'" # drop Start lines
128 COMPONENT_TEST_TRANSFORMS
+= "-e 's/^ *[0-9]\{1,\}\/[0-9]\{1,\} Test *\#[0-9]\{1,\}:/Test/'" # drop test numbers
129 COMPONENT_TEST_TRANSFORMS
+= "-e '/^make:/d'" # drop make logs
131 # To get consistent test results we need following packages
132 TEST_REQUIRED_PACKAGES
+= $(GFORTRAN_RUNTIME_PKG
)
133 TEST_REQUIRED_PACKAGES
+= developer
/versioning
/cvs
134 TEST_REQUIRED_PACKAGES
+= developer
/versioning
/mercurial
135 TEST_REQUIRED_PACKAGES
+= developer
/versioning
/subversion
137 # Auto-generated dependencies
138 REQUIRED_PACKAGES
+= $(GCC_RUNTIME_PKG
)
139 REQUIRED_PACKAGES
+= $(GXX_RUNTIME_PKG
)
140 REQUIRED_PACKAGES
+= library
/expat
141 REQUIRED_PACKAGES
+= library
/jsoncpp
142 REQUIRED_PACKAGES
+= library
/libarchive
143 REQUIRED_PACKAGES
+= library
/libuv
144 REQUIRED_PACKAGES
+= library
/ncurses
145 REQUIRED_PACKAGES
+= library
/zlib
146 REQUIRED_PACKAGES
+= system
/library
147 REQUIRED_PACKAGES
+= system
/library
/math
148 REQUIRED_PACKAGES
+= web
/curl