Changeset View
Changeset View
Standalone View
Standalone View
modules/ksb/BuildSystem/KDE4.pm
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Line(s) | 157 | { | |||
---|---|---|---|---|---|
165 | # Add -DBUILD_foo=OFF options for the directories in do-not-compile. | 165 | # Add -DBUILD_foo=OFF options for the directories in do-not-compile. | ||
166 | # This will only work if the CMakeLists.txt file uses macro_optional_add_subdirectory() | 166 | # This will only work if the CMakeLists.txt file uses macro_optional_add_subdirectory() | ||
167 | my @masked_directories = split(' ', $module->getOption('do-not-compile')); | 167 | my @masked_directories = split(' ', $module->getOption('do-not-compile')); | ||
168 | push @commands, "-DBUILD_$_=OFF" foreach @masked_directories; | 168 | push @commands, "-DBUILD_$_=OFF" foreach @masked_directories; | ||
169 | 169 | | |||
170 | # Get the user's CXXFLAGS, use them if specified and not already given | 170 | # Get the user's CXXFLAGS, use them if specified and not already given | ||
171 | # on the command line. | 171 | # on the command line. | ||
172 | my $cxxflags = $module->getOption('cxxflags'); | 172 | my $cxxflags = $module->getOption('cxxflags'); | ||
173 | if ($cxxflags and not grep { /^-DCMAKE_CXX_FLAGS(:\w+)?=/ } @commands) | 173 | if ($cxxflags and not $cxxflags eq ' ' and not grep { /^-DCMAKE_CXX_FLAGS(:\w+)?=/ } @commands) | ||
mpyne: You're right there's a better way, by adding a couple of lines to trip leading and trailing… | |||||
174 | { | 174 | { | ||
175 | push @commands, "-DCMAKE_CXX_FLAGS:STRING=$cxxflags"; | 175 | push @commands, "-DCMAKE_CXX_FLAGS:STRING=$cxxflags"; | ||
176 | } | 176 | } | ||
177 | 177 | | |||
178 | my $prefix = $module->installationPath(); | 178 | my $prefix = $module->installationPath(); | ||
179 | 179 | | |||
180 | push @commands, "-DCMAKE_INSTALL_PREFIX=$prefix"; | 180 | push @commands, "-DCMAKE_INSTALL_PREFIX=$prefix"; | ||
181 | 181 | | |||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |
You're right there's a better way, by adding a couple of lines to trip leading and trailing whitespace. I may have a utility function that does this already but if not it's probably time to add it.