Skip to content

Commit 7fef94f

Browse files
committed
Added -2 option
1 parent 7b41bda commit 7fef94f

File tree

3 files changed

+47
-24
lines changed

3 files changed

+47
-24
lines changed

README.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,27 @@ brew install mulle-kybernetik/software/mulle-xcode-to-cmake
2929
usage: mulle-xcode-to-cmake [options] <commands> <file.xcodeproj>
3030
3131
Options:
32-
-a : always prefix cmake variables with target
33-
-b : suppress boilerplate definitions
34-
-d : create static and shared library
35-
-f : suppress Foundation (implicitly added)
36-
-l <lang> : specify language (c,c++,objc) for mulle-configuration (default: objc)
37-
-m : include mulle-configuration (affects boilerplate)
38-
-n : suppress find_library trace
39-
-p : suppress project
40-
-r : suppress reminder, what generated this file
41-
-s <suffix> : create standalone test library (framework/shared)
42-
-t <target> : target to export
43-
-u : add UIKIt
32+
-2 : CMakeLists.txt includes CMakeSourcesAndHeaders.txt
33+
-a : always prefix cmake variables with target
34+
-b : suppress boilerplate definitions
35+
-d : create static and shared library
36+
-f : suppress Foundation (implicitly added)
37+
-l <lang> : specify language (c,c++,objc) for mulle-configuration (default: objc)
38+
-m : include mulle-configuration (affects boilerplate)
39+
-n : suppress find_library trace
40+
-p : suppress project
41+
-r : suppress reminder, what generated this file
42+
-s <suffix> : create standalone test library (framework/shared)
43+
-t <target> : target to export
44+
-u : add UIKIt
4445
4546
Commands:
46-
export : export CMakeLists.txt to stdout
47-
list : list targets
48-
sexport : export sources and private/public headers only
47+
export : export CMakeLists.txt to stdout
48+
list : list targets
49+
sexport : export sources and private/public headers only
4950
5051
Environment:
51-
VERBOSE : dump some info to stderr
52+
VERBOSE : dump some info to stderr
5253
```
5354

5455
### Examples
@@ -232,6 +233,12 @@ This is basically a stripped down version of `mulle_xcode_utility`.
232233

233234
### Releasenotes
234235

236+
##### 0.6.0
237+
238+
* there is a new option `-2`. It generates a `CMakeLists.txt` that includes
239+
a file called `CMakeSourcesAndHeaders.txt`. This is a file that you can generate
240+
with a second run of `mulle-xcode-to-cmake` using `sexport`.
241+
235242
##### 0.5.4
236243

237244
* the reminder is now more readable

mulle-xcode-to-cmake.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@
367367
1DEB927908733DD40010E9CD /* Debug */ = {
368368
isa = XCBuildConfiguration;
369369
buildSettings = {
370-
CURRENT_PROJECT_VERSION = 0.5.4;
370+
CURRENT_PROJECT_VERSION = 0.6.0;
371371
DEBUG_INFORMATION_FORMAT = dwarf;
372372
DYLIB_COMPATIBILITY_VERSION = "$(CURRENT_PROJECT_VERSION)";
373373
DYLIB_CURRENT_VERSION = 0.0.0;
@@ -388,7 +388,7 @@
388388
1DEB927A08733DD40010E9CD /* Release */ = {
389389
isa = XCBuildConfiguration;
390390
buildSettings = {
391-
CURRENT_PROJECT_VERSION = 0.5.4;
391+
CURRENT_PROJECT_VERSION = 0.6.0;
392392
DEBUG_INFORMATION_FORMAT = dwarf;
393393
DYLIB_COMPATIBILITY_VERSION = "$(CURRENT_PROJECT_VERSION)";
394394
DYLIB_CURRENT_VERSION = 0.0.0;

src/mulle-xcode-to-cmake/main.m

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
static BOOL verbose;
106106
static BOOL alwaysPrefix;
107107
static BOOL dualLibrary;
108+
static BOOL twoStageCMakeLists;
108109
static BOOL suppressTrace;
109110
static BOOL suppressBoilerplate;
110111
static BOOL enableMulleConfiguration;
@@ -164,6 +165,7 @@ static void usage()
164165
"\n"
165166
"Options:\n"
166167
""
168+
"\t-2 : CMakeLists.txt includes CMakeSourcesAndHeaders.txt\n"
167169
"\t-a : always prefix cmake variables with target\n"
168170
"\t-b : suppress boilerplate definitions\n"
169171
"\t-d : create static and shared library\n"
@@ -1239,14 +1241,21 @@ static void exporter( PBXProject *root,
12391241
print_boilerplate();
12401242
}
12411243

1242-
rover = [targets objectEnumerator];
1243-
while( pbxtarget = [rover nextObject])
1244+
if( twoStageCMakeLists && cmd == Export)
12441245
{
1245-
if( cmd == Export || cmd == SourceExport)
1246-
print_files_header_comment( [pbxtarget name]);
1247-
file_exporter( pbxtarget, cmd, multipleTargets);
1246+
printf( "\n# produce CMakeSourcesAndHeaders.txt with `mulle-xcode-to-cmake sexport`\n"
1247+
"\ninclude( CMakeSourcesAndHeaders.txt)\n");
1248+
}
1249+
else
1250+
{
1251+
rover = [targets objectEnumerator];
1252+
while( pbxtarget = [rover nextObject])
1253+
{
1254+
if( cmd == Export || cmd == SourceExport)
1255+
print_files_header_comment( [pbxtarget name]);
1256+
file_exporter( pbxtarget, cmd, multipleTargets);
1257+
}
12481258
}
1249-
12501259
// ugliness ensues...
12511260

12521261
if( cmd != Export)
@@ -1304,6 +1313,13 @@ static int _main( int argc, const char * argv[])
13041313
{
13051314
s = [arguments objectAtIndex:i];
13061315

1316+
if( [s isEqualToString:@"-2"] ||
1317+
[s isEqualToString:@"--two-stage"])
1318+
{
1319+
twoStageCMakeLists = YES;
1320+
continue;
1321+
}
1322+
13071323
if( [s isEqualToString:@"-a"] ||
13081324
[s isEqualToString:@"--always-prefix"])
13091325
{

0 commit comments

Comments
 (0)