No subject
Wed Apr 10 07:51:04 EDT 2013
Exectuable2 for iOS but Executable1 should have OSX as the target platform.
As it stands, I cannot switch CMAKE_OSX_SYSROOT midway. Either all
sub-projects are targetted for iOS or all are targetted for OSX. I cannot
mix the two.
Mixing platform targets is possible when manually creating/manipulating
XCode projects. So I am wondering whether it is possible to get CMake to
build MainProject such that I can control the target for each library and
executable.
Thanks,
Saad
--bcaec51a74ac089f1f04dc9e43c5
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hi,<div><br></div><div>I currently have a CMake project wi=
th multiple=A0sub-projects=A0where the=A0sub-projects=A0are libraries and e=
xecutables. The project works on windows and iOS (via XCode). One such sub-=
project is an executable that can only be run on OSX and must be run after =
every build. This executable makes a few changes to a couple of source file=
s automatically (mainly for tracking build related information which is aut=
omatically generated). To ensure that it runs after every build, a custom t=
arget is built which simply runs the previously mentioned exectuable. =A0</=
div>
<div><br></div><div>Currently, for building iOS libraries and executables, =
I have the following set in the root CMakeLists</div><div><br></div><div><d=
iv>set(CMAKE_OSX_SYSROOT iphoneos)</div></div><div><br></div><div style>
With the above line, in XCode I get the iOS targets. What I would like to k=
now is if CMake will be able to mix iOS and OSX targets? I am aware that I =
create a new CMake project just for this, but then the executable will not =
be automatically run each time the main project is built.=A0</div>
<div style><br></div><div style>A little hierarchy to make things easier to=
understand</div><div style><br></div><div style><font face=3D"courier new,=
monospace">MainProject</font></div><div style><font face=3D"courier new, m=
onospace">=A0 +- Library1 (compiles on iOS)</font></div>
<div style><font face=3D"courier new, monospace">=A0 +- Library2 (compiles =
on iOS)</font></div><div style><font face=3D"courier new, monospace">=A0 +-=
Executable1 (compiles on iOS but does not run on iOS - it must be run auto=
matically when MainProject is built)</font></div>
<div style><font face=3D"courier new, monospace">=A0 +- Executable2 (compil=
es/runs on iOS)</font></div><div style><font face=3D"courier new, monospace=
">=A0 +- ToolExecutable1 (runs the executable built by Executable1 - again,=
Executable1 must be built for OSX only)</font></div>
<div style><font face=3D"courier new, monospace">=A0=A0</font></div><div st=
yle>From the diagram, I would like XCode to build Library1, Library2 and Ex=
ectuable2 for iOS but Executable1 should have OSX as the target platform. A=
s it stands, I cannot switch CMAKE_OSX_SYSROOT midway. Either all sub-proje=
cts are targetted for iOS or all are targetted for OSX. I cannot mix the tw=
o.</div>
<div style><br></div><div style>Mixing platform targets is possible when ma=
nually creating/manipulating XCode projects. So I am wondering whether it i=
s possible to get CMake to build MainProject such that I can control the ta=
rget for each library and executable.</div>
<div style><br></div><div style>Thanks,</div><div style>Saad</div></div>
--bcaec51a74ac089f1f04dc9e43c5--
More information about the CMake
mailing list