[CMake] Framework
I want to use a framework for the includes and library linkage. FIND_LIBRARY seems like it will work for the library, but what about the include. Should I use a FIND_FILE followed by a INCLUDE_DIRECTORIES. I want to link against the Apple profiling library found in /System/ Library/PrivateFrameworks/CHUD.framework . Thanks, James ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Framework
So, life is slightly trickier since you are using a PrivateFramework. We never requested the CMake folks handle this explicitly, though there may already be enough built-in flexibility to handle this. For the library: FIND_LIBRARY(CHUD_LIBRARY NAMES CHUD PATHS /System/Library/PrivateFrameworks ) The one thing that worries me is if you combine this with an SDK (like the 10.4u SDK). We had a serious bug awhile back where CMake explicitly listed -F/System/Library/Frameworks which triggered mysterious gcc problems when also specifying an SDK. Apple wants to remap the /System stuff to the SDKs in this case and caused some weird gcc internal conflict. CMake now has a workaround to avoid doing the -F/System/Library/Frameworks and let the SDK do the driving, but I don't know if this extends to PrivateFrameworks. So if you are using an SDK, and assuming things don't just work, you may need to list the path to the PrivateFrameworks in the SDK you are using instead of /System. This will cost you some generality if you are trying to make a stand-alone Find module that works on all Macs. For the headers, I can't find any CHUD headers in my framework on my system. Strange... Anyway, if they are in the usual 'Headers' directory (symlink) in the CHUD.framework, then this should work: FIND_PATH(CHUD_INCLUDE_DIR CHUD/CHUD.h /System/Library/PrivateFrameworks ) This assumes there is a header called CHUD.h and you are including in your code like: #include Also, change the /System path to the one in the SDK as needed like above. -Eric On 9/10/07, James Bigler <[EMAIL PROTECTED]> wrote: > I want to use a framework for the includes and library linkage. > FIND_LIBRARY seems like it will work for the library, but what about > the include. Should I use a FIND_FILE followed by a > INCLUDE_DIRECTORIES. > > I want to link against the Apple profiling library found in /System/ > Library/PrivateFrameworks/CHUD.framework . > > Thanks, > James > ___ > CMake mailing list > CMake@cmake.org > http://www.cmake.org/mailman/listinfo/cmake > ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] Framework + Unix tools help
Hi, I have already looked everywhere possible (so to speak) on how to create a Framework + Unix tools as described in [1] but found no examples. So far I was able to create a Framework only [2]. I'm trying to add Mac OS X support to GeneratorRunner[3] and my current CMakeLists.txt can be viewed in [4]. Any help would be appreciated :-) Thanks, Carlos Gonçalves [1] http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_.2B_Unix_tools [2] http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_only [3] http://qt.gitorious.org/pyside/generatorrunner [4] http://pastebin.com/p7CKYP2z ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Framework + Unix tools help
On 8/12/10 10:20 AM, Carlos Gonçalves wrote: > Hi, > > I have already looked everywhere possible (so to speak) on how to create a > Framework + Unix tools as described in [1] but found no examples. So far I > was able to create a Framework only [2]. > > I'm trying to add Mac OS X support to GeneratorRunner[3] and my current > CMakeLists.txt can be viewed in [4]. Any help would be appreciated :-) > > Thanks, > Carlos Gonçalves > > [1] > http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_.2B_Unix_tools > [2] http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_only > [3] http://qt.gitorious.org/pyside/generatorrunner > [4] http://pastebin.com/p7CKYP2z I am not certain about your main question - but looking at your code, I see you have: add_custom_target(dist... ...which creates a file, "ChangeLog.txt" from the git log, then creates an archive. You only need to create the "ChangeLog.txt" file here; you don't need to create temp dirs and invoke tar and bzip2 - cpack can do that for you, via the defined package generators. For creating source and/or binary archives, just use one of the CPack package generators: http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#TBZ2 To create the configured binary package(s), either invoke "make package" or invoke cpack directly: "cpack" To create the configured source package, either invoke cpack via: "make package_source" or directly via: "cpack --config ./CPackSourceConfig.cmake" Sorry I couldn't answer your "real" question... ;) -Chris ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Framework + Unix tools help
Hi, On 2010/08/12, at 20:15, Chris Wolf wrote: > > > On 8/12/10 10:20 AM, Carlos Gonçalves wrote: >> Hi, >> >> I have already looked everywhere possible (so to speak) on how to create a >> Framework + Unix tools as described in [1] but found no examples. So far I >> was able to create a Framework only [2]. >> >> I'm trying to add Mac OS X support to GeneratorRunner[3] and my current >> CMakeLists.txt can be viewed in [4]. Any help would be appreciated :-) >> >> Thanks, >> Carlos Gonçalves >> >> [1] >> http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_.2B_Unix_tools >> [2] http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_only >> [3] http://qt.gitorious.org/pyside/generatorrunner >> [4] http://pastebin.com/p7CKYP2z > > I am not certain about your main question - but looking at your code, I see > you have: > > add_custom_target(dist... > > ...which creates a file, "ChangeLog.txt" from the git log, then creates an > archive. You only need to create the "ChangeLog.txt" file here; you > don't need to create temp dirs and invoke tar and bzip2 - cpack can > do that for you, via the defined package generators. That's a custom target to create a new release tarball, so nothing to do with my question :-) > For creating source and/or binary archives, just use one of the CPack > package generators: > > http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#TBZ2 > > To create the configured binary package(s), either invoke "make package" > or invoke cpack directly: "cpack" > > To create the configured source package, either invoke cpack via: > "make package_source" or directly via: > "cpack --config ./CPackSourceConfig.cmake" > > > Sorry I couldn't answer your "real" question... ;) My fault, not yours. Ok, let me explain it better. GeneratorRunner builds successfully on Linux and installs just fine. Now, I want to add Mac OS X support on it. Since GeneratorRunner contains an application (generatorrunner) and a library (genrunner) the installation file hierarchy should be, for what I have understand, something equivalent to the example given in http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_.2B_Unix_tools -- Installing: /Library/Frameworks/genrunner.framework -- Installing: /Library/Frameworks/genrunner.framework/genrunner -- Installing: /Library/Frameworks/genrunner.framework/Resources -- Installing: /Library/Frameworks/genrunner.framework/Versions -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1 -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/genrunner -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1 -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1/GeneratorRunnerConfig.cmake -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1/GeneratorRunnerConfigVersion.cmake -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/pkgconfig -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/pkgconfig/generatorrunner.pc -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/Resources -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/Resources/Info.plist -- Installing: /Library/Frameworks/genrunner.framework/Versions/Current -- Installing: /Applications/GeneratorRunner/bin/generatorrunner My question is mainly about file /Applications/GeneratorRunner/bin/generatorrunner which, although I've set it to be installed there for testing purposes, what I want is it so be installed either in /Library/Frameworks/genrunner.framework/Versions/0.6.1/Commands/generatorrunner or in Library/Frameworks/genrunner.framework/Versions/0.6.1/bin/generatorrunner (I truly don't know what the difference between Commands/ and bin/ is since they both contain executables), but I don't know how to do it. I tried messing with RUNTIME DESTINATION setting it to "bin" but that didn't help. Hope I have clarified my question ;-) Thanks, Carlos Gonçalves ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Framework + Unix tools help
On 12. Aug, 2010, at 22:41 , Carlos Gonçalves wrote: > Hi, > > On 2010/08/12, at 20:15, Chris Wolf wrote: > >> >> >> On 8/12/10 10:20 AM, Carlos Gonçalves wrote: >>> Hi, >>> >>> I have already looked everywhere possible (so to speak) on how to create a >>> Framework + Unix tools as described in [1] but found no examples. So far I >>> was able to create a Framework only [2]. >>> >>> I'm trying to add Mac OS X support to GeneratorRunner[3] and my current >>> CMakeLists.txt can be viewed in [4]. Any help would be appreciated :-) >>> >>> Thanks, >>> Carlos Gonçalves >>> >>> [1] >>> http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_.2B_Unix_tools >>> [2] http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_only >>> [3] http://qt.gitorious.org/pyside/generatorrunner >>> [4] http://pastebin.com/p7CKYP2z >> >> I am not certain about your main question - but looking at your code, I see >> you have: >> >> add_custom_target(dist... >> >> ...which creates a file, "ChangeLog.txt" from the git log, then creates an >> archive. You only need to create the "ChangeLog.txt" file here; you >> don't need to create temp dirs and invoke tar and bzip2 - cpack can >> do that for you, via the defined package generators. > > That's a custom target to create a new release tarball, so nothing to do with > my question :-) > >> For creating source and/or binary archives, just use one of the CPack >> package generators: >> >> http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#TBZ2 >> >> To create the configured binary package(s), either invoke "make package" >> or invoke cpack directly: "cpack" >> >> To create the configured source package, either invoke cpack via: >> "make package_source" or directly via: >> "cpack --config ./CPackSourceConfig.cmake" >> >> >> Sorry I couldn't answer your "real" question... ;) > > My fault, not yours. Ok, let me explain it better. > > GeneratorRunner builds successfully on Linux and installs just fine. Now, I > want to add Mac OS X support on it. Since GeneratorRunner contains an > application (generatorrunner) and a library (genrunner) the installation file > hierarchy should be, for what I have understand, something equivalent to the > example given in > http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_.2B_Unix_tools > > -- Installing: /Library/Frameworks/genrunner.framework > -- Installing: /Library/Frameworks/genrunner.framework/genrunner > -- Installing: /Library/Frameworks/genrunner.framework/Resources > -- Installing: /Library/Frameworks/genrunner.framework/Versions > -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1 > -- Installing: > /Library/Frameworks/genrunner.framework/Versions/0.6.1/genrunner > -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib > -- Installing: > /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake > -- Installing: > /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1 > -- Installing: > /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1/GeneratorRunnerConfig.cmake > -- Installing: > /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1/GeneratorRunnerConfigVersion.cmake > -- Installing: > /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/pkgconfig > -- Installing: > /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/pkgconfig/generatorrunner.pc > -- Installing: > /Library/Frameworks/genrunner.framework/Versions/0.6.1/Resources > -- Installing: > /Library/Frameworks/genrunner.framework/Versions/0.6.1/Resources/Info.plist > -- Installing: /Library/Frameworks/genrunner.framework/Versions/Current > -- Installing: /Applications/GeneratorRunner/bin/generatorrunner > > My question is mainly about file > /Applications/GeneratorRunner/bin/generatorrunner which, although I've set it > to be installed there for testing purposes, what I want is it so be installed > either in > /Library/Frameworks/genrunner.framework/Versions/0.6.1/Commands/generatorrunner > or in > Library/Frameworks/genrunner.framework/Versions/0.6.1/bin/generatorrunner (I > truly don't know what the difference between Commands/ and bin/ is since they > both contain executables), but I don't know how to do it. I tried messing > with RUNTIME DESTINATION setting it to "bin" but that didn't help. > > Hope I have clarified my question ;-) > > Thanks, > Carlos Gonçalves Now you only have to use execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ...) to create a symlink somewhere in your build tree that points to the executable inside the framework (either using a relative path or the absolute install-path) and then install it using install(FILES ...). HTH Michael ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
Re: [CMake] Framework + Unix tools help
On 2010/08/13, at 08:52, Michael Wild wrote: > > On 12. Aug, 2010, at 22:41 , Carlos Gonçalves wrote: > >> Hi, >> >> On 2010/08/12, at 20:15, Chris Wolf wrote: >> >>> >>> >>> On 8/12/10 10:20 AM, Carlos Gonçalves wrote: Hi, I have already looked everywhere possible (so to speak) on how to create a Framework + Unix tools as described in [1] but found no examples. So far I was able to create a Framework only [2]. I'm trying to add Mac OS X support to GeneratorRunner[3] and my current CMakeLists.txt can be viewed in [4]. Any help would be appreciated :-) Thanks, Carlos Gonçalves [1] http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_.2B_Unix_tools [2] http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_only [3] http://qt.gitorious.org/pyside/generatorrunner [4] http://pastebin.com/p7CKYP2z >>> >>> I am not certain about your main question - but looking at your code, I see >>> you have: >>> >>> add_custom_target(dist... >>> >>> ...which creates a file, "ChangeLog.txt" from the git log, then creates an >>> archive. You only need to create the "ChangeLog.txt" file here; you >>> don't need to create temp dirs and invoke tar and bzip2 - cpack can >>> do that for you, via the defined package generators. >> >> That's a custom target to create a new release tarball, so nothing to do >> with my question :-) >> >>> For creating source and/or binary archives, just use one of the CPack >>> package generators: >>> >>> http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#TBZ2 >>> >>> To create the configured binary package(s), either invoke "make package" >>> or invoke cpack directly: "cpack" >>> >>> To create the configured source package, either invoke cpack via: >>> "make package_source" or directly via: >>> "cpack --config ./CPackSourceConfig.cmake" >>> >>> >>> Sorry I couldn't answer your "real" question... ;) >> >> My fault, not yours. Ok, let me explain it better. >> >> GeneratorRunner builds successfully on Linux and installs just fine. Now, I >> want to add Mac OS X support on it. Since GeneratorRunner contains an >> application (generatorrunner) and a library (genrunner) the installation >> file hierarchy should be, for what I have understand, something equivalent >> to the example given in >> http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_.2B_Unix_tools >> >> -- Installing: /Library/Frameworks/genrunner.framework >> -- Installing: /Library/Frameworks/genrunner.framework/genrunner >> -- Installing: /Library/Frameworks/genrunner.framework/Resources >> -- Installing: /Library/Frameworks/genrunner.framework/Versions >> -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1 >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/genrunner >> -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1 >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1/GeneratorRunnerConfig.cmake >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1/GeneratorRunnerConfigVersion.cmake >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/pkgconfig >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/pkgconfig/generatorrunner.pc >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/Resources >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/Resources/Info.plist >> -- Installing: /Library/Frameworks/genrunner.framework/Versions/Current >> -- Installing: /Applications/GeneratorRunner/bin/generatorrunner >> >> My question is mainly about file >> /Applications/GeneratorRunner/bin/generatorrunner which, although I've set >> it to be installed there for testing purposes, what I want is it so be >> installed either in >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/Commands/generatorrunner >> or in >> Library/Frameworks/genrunner.framework/Versions/0.6.1/bin/generatorrunner (I >> truly don't know what the difference between Commands/ and bin/ is since >> they both contain executables), but I don't know how to do it. I tried >> messing with RUNTIME DESTINATION setting it to "bin" but that didn't help. >> >> Hope I have clarified my question ;-) >> >> Thanks, >> Carlos Gonçalves > > Now you only have to use execute_process(COMMAND ${CMAKE_COMMAND} -E > create_symlink ...) to create a symlink somewhere in your build tree that > points to the executable inside the framework (either using a relative path > or the absolute install-path) and then install it using install(FILES ...). Hmm, I thought CMake
Re: [CMake] Framework + Unix tools help
On 2010/08/13, at 08:52, Michael Wild wrote: > > On 12. Aug, 2010, at 22:41 , Carlos Gonçalves wrote: > >> Hi, >> >> On 2010/08/12, at 20:15, Chris Wolf wrote: >> >>> >>> >>> On 8/12/10 10:20 AM, Carlos Gonçalves wrote: Hi, I have already looked everywhere possible (so to speak) on how to create a Framework + Unix tools as described in [1] but found no examples. So far I was able to create a Framework only [2]. I'm trying to add Mac OS X support to GeneratorRunner[3] and my current CMakeLists.txt can be viewed in [4]. Any help would be appreciated :-) Thanks, Carlos Gonçalves [1] http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_.2B_Unix_tools [2] http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_only [3] http://qt.gitorious.org/pyside/generatorrunner [4] http://pastebin.com/p7CKYP2z >>> >>> I am not certain about your main question - but looking at your code, I see >>> you have: >>> >>> add_custom_target(dist... >>> >>> ...which creates a file, "ChangeLog.txt" from the git log, then creates an >>> archive. You only need to create the "ChangeLog.txt" file here; you >>> don't need to create temp dirs and invoke tar and bzip2 - cpack can >>> do that for you, via the defined package generators. >> >> That's a custom target to create a new release tarball, so nothing to do >> with my question :-) >> >>> For creating source and/or binary archives, just use one of the CPack >>> package generators: >>> >>> http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#TBZ2 >>> >>> To create the configured binary package(s), either invoke "make package" >>> or invoke cpack directly: "cpack" >>> >>> To create the configured source package, either invoke cpack via: >>> "make package_source" or directly via: >>> "cpack --config ./CPackSourceConfig.cmake" >>> >>> >>> Sorry I couldn't answer your "real" question... ;) >> >> My fault, not yours. Ok, let me explain it better. >> >> GeneratorRunner builds successfully on Linux and installs just fine. Now, I >> want to add Mac OS X support on it. Since GeneratorRunner contains an >> application (generatorrunner) and a library (genrunner) the installation >> file hierarchy should be, for what I have understand, something equivalent >> to the example given in >> http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_.2B_Unix_tools >> >> -- Installing: /Library/Frameworks/genrunner.framework >> -- Installing: /Library/Frameworks/genrunner.framework/genrunner >> -- Installing: /Library/Frameworks/genrunner.framework/Resources >> -- Installing: /Library/Frameworks/genrunner.framework/Versions >> -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1 >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/genrunner >> -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1 >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1/GeneratorRunnerConfig.cmake >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1/GeneratorRunnerConfigVersion.cmake >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/pkgconfig >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/pkgconfig/generatorrunner.pc >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/Resources >> -- Installing: >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/Resources/Info.plist >> -- Installing: /Library/Frameworks/genrunner.framework/Versions/Current >> -- Installing: /Applications/GeneratorRunner/bin/generatorrunner >> >> My question is mainly about file >> /Applications/GeneratorRunner/bin/generatorrunner which, although I've set >> it to be installed there for testing purposes, what I want is it so be >> installed either in >> /Library/Frameworks/genrunner.framework/Versions/0.6.1/Commands/generatorrunner >> or in >> Library/Frameworks/genrunner.framework/Versions/0.6.1/bin/generatorrunner (I >> truly don't know what the difference between Commands/ and bin/ is since >> they both contain executables), but I don't know how to do it. I tried >> messing with RUNTIME DESTINATION setting it to "bin" but that didn't help. >> >> Hope I have clarified my question ;-) >> >> Thanks, >> Carlos Gonçalves > > Now you only have to use execute_process(COMMAND ${CMAKE_COMMAND} -E > create_symlink ...) to create a symlink somewhere in your build tree that > points to the executable inside the framework (either using a relative path > or the absolute install-path) and then install it using install(FILES ...). But how do I install
Re: [CMake] Framework + Unix tools help
On 13. Aug, 2010, at 23:29 , Carlos Gonçalves wrote: > On 2010/08/13, at 08:52, Michael Wild wrote: > >> >> On 12. Aug, 2010, at 22:41 , Carlos Gonçalves wrote: >> >>> Hi, >>> >>> On 2010/08/12, at 20:15, Chris Wolf wrote: >>> On 8/12/10 10:20 AM, Carlos Gonçalves wrote: > Hi, > > I have already looked everywhere possible (so to speak) on how to create > a Framework + Unix tools as described in [1] but found no examples. So > far I was able to create a Framework only [2]. > > I'm trying to add Mac OS X support to GeneratorRunner[3] and my current > CMakeLists.txt can be viewed in [4]. Any help would be appreciated :-) > > Thanks, > Carlos Gonçalves > > [1] > http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_.2B_Unix_tools > [2] http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_only > [3] http://qt.gitorious.org/pyside/generatorrunner > [4] http://pastebin.com/p7CKYP2z I am not certain about your main question - but looking at your code, I see you have: add_custom_target(dist... ...which creates a file, "ChangeLog.txt" from the git log, then creates an archive. You only need to create the "ChangeLog.txt" file here; you don't need to create temp dirs and invoke tar and bzip2 - cpack can do that for you, via the defined package generators. >>> >>> That's a custom target to create a new release tarball, so nothing to do >>> with my question :-) >>> For creating source and/or binary archives, just use one of the CPack package generators: http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#TBZ2 To create the configured binary package(s), either invoke "make package" or invoke cpack directly: "cpack" To create the configured source package, either invoke cpack via: "make package_source" or directly via: "cpack --config ./CPackSourceConfig.cmake" Sorry I couldn't answer your "real" question... ;) >>> >>> My fault, not yours. Ok, let me explain it better. >>> >>> GeneratorRunner builds successfully on Linux and installs just fine. Now, I >>> want to add Mac OS X support on it. Since GeneratorRunner contains an >>> application (generatorrunner) and a library (genrunner) the installation >>> file hierarchy should be, for what I have understand, something equivalent >>> to the example given in >>> http://www.cmake.org/Wiki/CMake:Bundles_And_Frameworks#Framework_.2B_Unix_tools >>> >>> -- Installing: /Library/Frameworks/genrunner.framework >>> -- Installing: /Library/Frameworks/genrunner.framework/genrunner >>> -- Installing: /Library/Frameworks/genrunner.framework/Resources >>> -- Installing: /Library/Frameworks/genrunner.framework/Versions >>> -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1 >>> -- Installing: >>> /Library/Frameworks/genrunner.framework/Versions/0.6.1/genrunner >>> -- Installing: /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib >>> -- Installing: >>> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake >>> -- Installing: >>> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1 >>> -- Installing: >>> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1/GeneratorRunnerConfig.cmake >>> -- Installing: >>> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/cmake/GeneratorRunner-0.6.1/GeneratorRunnerConfigVersion.cmake >>> -- Installing: >>> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/pkgconfig >>> -- Installing: >>> /Library/Frameworks/genrunner.framework/Versions/0.6.1/lib/pkgconfig/generatorrunner.pc >>> -- Installing: >>> /Library/Frameworks/genrunner.framework/Versions/0.6.1/Resources >>> -- Installing: >>> /Library/Frameworks/genrunner.framework/Versions/0.6.1/Resources/Info.plist >>> -- Installing: /Library/Frameworks/genrunner.framework/Versions/Current >>> -- Installing: /Applications/GeneratorRunner/bin/generatorrunner >>> >>> My question is mainly about file >>> /Applications/GeneratorRunner/bin/generatorrunner which, although I've set >>> it to be installed there for testing purposes, what I want is it so be >>> installed either in >>> /Library/Frameworks/genrunner.framework/Versions/0.6.1/Commands/generatorrunner >>> or in >>> Library/Frameworks/genrunner.framework/Versions/0.6.1/bin/generatorrunner >>> (I truly don't know what the difference between Commands/ and bin/ is since >>> they both contain executables), but I don't know how to do it. I tried >>> messing with RUNTIME DESTINATION setting it to "bin" but that didn't help. >>> >>> Hope I have clarified my question ;-) >>> >>> Thanks, >>> Carlos Gonçalves >> >> Now you only have to use execute_process(COMMAND ${CMAKE_COMMAND} -E >> create_symlink ...) to create a symlink somewhere in your build tree that >> points
[CMake] Framework Installation Directory / Framework copying
Hi all, Does anyone have any experience with how to copy a built framework into the application bundle? In Xcode we set the Installation Directory of the Framework to @executable_path/../Frameworks/, then as a post-link phase of building the app we run a python script to copy the built framework into the application bundle. I can set up the dependency between my app target and my framework target, and if I leave everything alone the app even runs. However, if I move the framework into the app bundle by hand, it won't launch because it can't find the framework. This is because the Installation Directory is being set to the BINARY_DIR location. If I by hand fix the Xcode project's Installation Directory to @executable_path/../Frameworks/ and rebuild, (and move it to the correct location by hand) everything works. (So, I know my suspicions about what needs to be done are correct). So, does anyone know how to set a Framework's Installation Directory parameter via CMake? Part of my problem in researching this problem is that "Installation Directory" is an overloaded term in the CMake lexicon. I'm talking about the OS X Framework attribute here, not the CPack or Squish variables. Also, any idea about the best way to do the Framework copy? I could probably just re-use our python script, but maybe there's a cleaner CMake way of doing something like this... Thanks in advance... Glenn ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Framework installation problems with ninja
Let's say I have a simple CMakeLists.txt: cmake_minimum_required(VERSION 3.11) project(foo C) add_subdirectory(foo) foo/CMakeLists.txt looks like: add_library(foo SHARED foo.c) set_target_properties(foo PROPERTIES FRAMEWORK ON FRAMEWORK_VERSION A) install(TARGETS foo FRAMEWORK DESTINATION Frameworks) add_custom_target(install-foo DEPENDS foo COMMAND echo "Installing") An actual useful install-foo target would do something along the lines of `cmake -P cmake_install.cmake`, but we don't need that to demonstrate the issue. foo.c is also irrelevant; it could even be empty. With CMake 3.11.4 and when using the Ninja generator, my custom install-foo target ends up transitively depending on "foo/foo.framework/foo", which doesn't exist and causes a build error. There is a "foo.framework/foo" target, which is just a phony target depending on "foo/foo.framework/Versions/A/foo" (which is the actual library), and I suspect that's the actual desired dependency, but instead, the subdirectory is being incorrectly prepended to the dependency name. This works correctly when using the Makefile generator instead of the Ninja generator. It works with the Ninja generator if my framework target is in the top-level CMakeLists.txt instead of a subdirectory, but that's not a viable workaround for my use case. Am I doing something wrong, or is this a bug with CMake's Ninja generator? If it's the latter, any thoughts on how to work around it? I suppose I could try to manually create the "foo/foo.framework/foo" target, but that seems kinda gross. Thanks, Shoaib Meenai -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake
Re: [CMake] Framework Installation Directory / Framework copying
http://www.cmake.org/Wiki/BundleUtilitiesExample Might Help Mike Jackson On Dec 8, 2009, at 5:11 PM, Glenn Hughes wrote: Hi all, Does anyone have any experience with how to copy a built framework into the application bundle? In Xcode we set the Installation Directory of the Framework to @executable_path/../Frameworks/, then as a post-link phase of building the app we run a python script to copy the built framework into the application bundle. I can set up the dependency between my app target and my framework target, and if I leave everything alone the app even runs. However, if I move the framework into the app bundle by hand, it won't launch because it can't find the framework. This is because the Installation Directory is being set to the BINARY_DIR location. If I by hand fix the Xcode project's Installation Directory to @executable_path/../Frameworks/ and rebuild, (and move it to the correct location by hand) everything works. (So, I know my suspicions about what needs to be done are correct). So, does anyone know how to set a Framework's Installation Directory parameter via CMake? Part of my problem in researching this problem is that "Installation Directory" is an overloaded term in the CMake lexicon. I'm talking about the OS X Framework attribute here, not the CPack or Squish variables. Also, any idea about the best way to do the Framework copy? I could probably just re-use our python script, but maybe there's a cleaner CMake way of doing something like this... Thanks in advance... Glenn ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Framework Installation Directory / Framework copying
Thanks Mike, I pretty much got my build process on the Mac working. The thing that took me awhile to understand were the different running contexts that bits of the CMake script are processed within. What I want is a little different than the standard way that things are done in the CMake way of handling Frameworks and bundles. I basically always want the Frameworks copied into the app, not just during the install phase. Here's what I'm doing: 1) In my framework CMakeLists.txt file, I have the following: IF (APPLE) SET_TARGET_PROPERTIES( MyFramework PROPERTIES FRAMEWORK true) SET_TARGET_PROPERTIES( MyFramework PROPERTIES XCODE_ATTRIBUTE_INSTALL_PATH @executable_path/../Frameworks/ ) ENDIF (APPLE) The second "set_target_properties" line configures the framework to always be looked for in the application bundle in the Frameworks sub-folder. 2) In my top-level CMakeLists.txt file, I add setup a unified binary output directory (thanks Mike!): SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin) SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin ) SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin ) 3) Then, in my applications' CMakeLists.txt file, I have the following: IF (APPLE) ADD_CUSTOM_COMMAND( TARGET MyApp POST_BUILD COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_HOME_DIRECTORY}/CopyFramework.py --binary ${PROJECT_BINARY_DIR}/Bin --framework MyFramework.framework --app MyApp.app ) ENDIF (APPLE) This calls out to my python script, which does the work of assembling the src and dest paths, and actually copying the Framework. The final trick is that since this is a Mac only thing, I can rely on an Xcode environment variable within the Python script: config= os.environ["CONFIGURATION"] This allows me to assemble the complete path to the actual binary locations of the framework and the app. The one thing I wish was that there was a CMake variable that would expand to the current Config within the context of the ADD_CUSTOM_COMMAND... It'd be nice to not have to resort to using the Xcode environment variable. Thanks again Glenn ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Framework Installation Directory / Framework copying
On Wed, Dec 9, 2009 at 4:05 PM, Glenn Hughes wrote: > Thanks Mike, > > I pretty much got my build process on the Mac working. The thing that > took me awhile to understand were the different running contexts that > bits of the CMake script are processed within. What I want is a little > different than the standard way that things are done in the CMake way > of handling Frameworks and bundles. I basically always want the > Frameworks copied into the app, not just during the install phase. > > Here's what I'm doing: > > 1) In my framework CMakeLists.txt file, I have the following: > > IF (APPLE) > SET_TARGET_PROPERTIES( MyFramework PROPERTIES FRAMEWORK true) > SET_TARGET_PROPERTIES( MyFramework PROPERTIES > XCODE_ATTRIBUTE_INSTALL_PATH @executable_path/../Frameworks/ ) > ENDIF (APPLE) > > The second "set_target_properties" line configures the framework to > always be looked for in the application bundle in the Frameworks > sub-folder. > > 2) In my top-level CMakeLists.txt file, I add setup a unified binary > output directory (thanks Mike!): > > SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin) > SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin ) > SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin ) > > 3) Then, in my applications' CMakeLists.txt file, I have the following: > > IF (APPLE) > ADD_CUSTOM_COMMAND( > TARGET MyApp > POST_BUILD > COMMAND ${PYTHON_EXECUTABLE} > ARGS ${CMAKE_HOME_DIRECTORY}/CopyFramework.py > --binary ${PROJECT_BINARY_DIR}/Bin > --framework MyFramework.framework > --app MyApp.app > > ) > ENDIF (APPLE) > > This calls out to my python script, which does the work of assembling > the src and dest paths, and actually copying the Framework. > > The final trick is that since this is a Mac only thing, I can rely on > an Xcode environment variable within the Python script: > config= os.environ["CONFIGURATION"] > > This allows me to assemble the complete path to the actual binary > locations of the framework and the app. > > The one thing I wish was that there was a CMake variable that would > expand to the current Config within the context of the > ADD_CUSTOM_COMMAND... It'd be nice to not have to resort to using the > Xcode environment variable. > > Thanks again > Glenn Looks like you generally have a handle on things. The subtle thing about the Xcode Environment variables is that your CMake Code is run at "Cmake Time" which will have no idea about the Xcode variables that are set during a "Build Time". Chicken-and-Egg sort of thing. In the recent HDF5 Version 1.8 CMake Port/Fork I have the following code that runs an executable as soon as it is compiled: SET (CFG_INIT "/${CMAKE_CFG_INTDIR}") IF (MAKE_SYSTEM) SET (CFG_INIT "") ENDIF (MAKE_SYSTEM) SET (CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}${CFG_INIT}/H5detect${EXE_EXT}) IF(XCODE) SET (CMD "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/\${CONFIGURATION}/H5detect") ENDIF(XCODE) ADD_EXECUTABLE(H5detect ${HDF5_SRC_DIR}/H5detect.c) ADD_CUSTOM_COMMAND( OUTPUT ${HDF5_BINARY_DIR}/H5Tinit.c COMMAND ${CMD} ARGS > ${HDF5_BINARY_DIR}/H5Tinit.c DEPENDS H5detect ) The part to take away from this is that if you look at the if(XCODE) section I am picking up the proper Xcode variable that determines the "Debug/Release" sub directory of "Bin". That is then used in the "add_custom_command()". The other thing you might be able to do would be to "save" the CMAKE_*_OUTPUT_DIRECTORY variables, set those variables to inside the MyApp.app bundle for the Framework target, then set them back to the originals at the bottom of the Frameworks CMakeLists.txt file. This _should_ end up compiling/generating the framework at the correct spot in the App bundle. You could also use the add_custom_target() command to copy the built framework into the app bundle after it is compiled: add_custom_command(TARGET target PRE_BUILD | PRE_LINK | POST_BUILD COMMAND command1 [ARGS] [args1...] [COMMAND command2 [ARGS] [args2...] ...] [WORKING_DIRECTORY dir] [COMMENT comment] [VERBATIM] ) add_custom_target(${qtlib}-Debug-Copy ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different ${QT_DLL_PATH_tmp}/${qtlib}${TYPE}4.dll ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/ COMMENT "Copying ${qtlib}${TYPE}4.dll to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/") The "COMMAND" would be actually using CMake itself to do the copying. Just FYI. _ Mike Jackson mike.jack...@bluequartz.net BlueQuartz Softwarewww.bluequartz.net Principal Software Engineer Dayton, Ohio ___ Powered by www.kitware.com Visit other Kitwar
Re: [CMake] Framework Installation Directory / Framework copying
On Wednesday 09 December 2009 02:23:34 pm Mike Jackson wrote: > On Wed, Dec 9, 2009 at 4:05 PM, Glenn Hughes wrote: > > Thanks Mike, > > > > I pretty much got my build process on the Mac working. The thing that > > took me awhile to understand were the different running contexts that > > bits of the CMake script are processed within. What I want is a little > > different than the standard way that things are done in the CMake way > > of handling Frameworks and bundles. I basically always want the > > Frameworks copied into the app, not just during the install phase. > > > > Here's what I'm doing: > > > > 1) In my framework CMakeLists.txt file, I have the following: > > > > IF (APPLE) > >SET_TARGET_PROPERTIES( MyFramework PROPERTIES FRAMEWORK true) > >SET_TARGET_PROPERTIES( MyFramework PROPERTIES > > XCODE_ATTRIBUTE_INSTALL_PATH @executable_path/../Frameworks/ ) > > ENDIF (APPLE) > > > > The second "set_target_properties" line configures the framework to > > always be looked for in the application bundle in the Frameworks > > sub-folder. > > > > 2) In my top-level CMakeLists.txt file, I add setup a unified binary > > output directory (thanks Mike!): > > > > SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin) > > SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin ) > > SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin ) > > > > 3) Then, in my applications' CMakeLists.txt file, I have the following: > > > > IF (APPLE) > >ADD_CUSTOM_COMMAND( > >TARGET MyApp > >POST_BUILD > >COMMAND ${PYTHON_EXECUTABLE} > >ARGS ${CMAKE_HOME_DIRECTORY}/CopyFramework.py > >--binary ${PROJECT_BINARY_DIR}/Bin > >--framework MyFramework.framework > >--app MyApp.app > > > > ) > > ENDIF (APPLE) > > > > This calls out to my python script, which does the work of assembling > > the src and dest paths, and actually copying the Framework. > > > > The final trick is that since this is a Mac only thing, I can rely on > > an Xcode environment variable within the Python script: > >config= os.environ["CONFIGURATION"] > > > > This allows me to assemble the complete path to the actual binary > > locations of the framework and the app. > > > > The one thing I wish was that there was a CMake variable that would > > expand to the current Config within the context of the > > ADD_CUSTOM_COMMAND... It'd be nice to not have to resort to using the > > Xcode environment variable. > > > > Thanks again > > Glenn > > Looks like you generally have a handle on things. The subtle thing > about the Xcode Environment variables is that your CMake Code is run > at "Cmake Time" which will have no idea about the Xcode variables that > are set during a "Build Time". Chicken-and-Egg sort of thing. In the > recent HDF5 Version 1.8 CMake Port/Fork I have the following code that > runs an executable as soon as it is compiled: > > SET (CFG_INIT "/${CMAKE_CFG_INTDIR}") Don't you mean "/\${CMAKE_CFG_INTDIR}", so the proper variable substitution happens later? If so, is that why you have an IF(XCODE) section? Clint ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Framework Installation Directory / Framework copying
>The subtle thing > about the Xcode Environment variables is that your CMake Code is run > at "Cmake Time" which will have no idea about the Xcode variables that > are set during a "Build Time". Right. But in my case this is OK, because I evaluate the Xcode env variable in my python script which is run at "build time" by Xcode and not at "CMake time"... I guess your code is doing something similar, but in the CMake universe... Just to make sure I understand what you're doing: You're quoting ${CONFIGURATION} when you assemble the CMD string, so it wont be evaluated until the command is actually run by Xcode, right? That's a neat way of doing it, because then I could theoretically build using vanilla make under OSX if I wanted to. I don't want to try to generate the framework into the app bundle itself. We've found you wind up with chicken-and-egg problems with this approach because the Framework needs to be built before the app so the app can link to it, but the app doesn't exist yet, etc etc. In your custom target approach, I would need a different target for each configuration? I'm actually happy using my python script to do the copy, because it can copy the whole framework, not just the dylib, and its also smart about not copying things that are not out of date. This is some code we'd already written so it was nice to be able to reuse it. Anyway I've got it all working now... Thanks for the help! Best wishes Glenn ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Framework Installation Directory / Framework copying
Hmm. I'll have to give that a try. Thanks _ Mike Jackson mike.jack...@bluequartz.net On Wed, Dec 9, 2009 at 4:48 PM, Clinton Stimpson wrote: > On Wednesday 09 December 2009 02:42:13 pm you wrote: >> _ >> Mike Jackson mike.jack...@bluequartz.net >> BlueQuartz Software www.bluequartz.net >> Principal Software Engineer Dayton, Ohio >> >> On Wed, Dec 9, 2009 at 4:33 PM, Clinton Stimpson > wrote: >> > On Wednesday 09 December 2009 02:23:34 pm Mike Jackson wrote: >> >> On Wed, Dec 9, 2009 at 4:05 PM, Glenn Hughes > wrote: >> >> > Thanks Mike, >> >> > >> >> > I pretty much got my build process on the Mac working. The thing that >> >> > took me awhile to understand were the different running contexts that >> >> > bits of the CMake script are processed within. What I want is a little >> >> > different than the standard way that things are done in the CMake way >> >> > of handling Frameworks and bundles. I basically always want the >> >> > Frameworks copied into the app, not just during the install phase. >> >> > >> >> > Here's what I'm doing: >> >> > >> >> > 1) In my framework CMakeLists.txt file, I have the following: >> >> > >> >> > IF (APPLE) >> >> > SET_TARGET_PROPERTIES( MyFramework PROPERTIES FRAMEWORK true) >> >> > SET_TARGET_PROPERTIES( MyFramework PROPERTIES >> >> > XCODE_ATTRIBUTE_INSTALL_PATH @executable_path/../Frameworks/ ) >> >> > ENDIF (APPLE) >> >> > >> >> > The second "set_target_properties" line configures the framework to >> >> > always be looked for in the application bundle in the Frameworks >> >> > sub-folder. >> >> > >> >> > 2) In my top-level CMakeLists.txt file, I add setup a unified binary >> >> > output directory (thanks Mike!): >> >> > >> >> > SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin) >> >> > SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin ) >> >> > SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin ) >> >> > >> >> > 3) Then, in my applications' CMakeLists.txt file, I have the >> >> > following: >> >> > >> >> > IF (APPLE) >> >> > ADD_CUSTOM_COMMAND( >> >> > TARGET MyApp >> >> > POST_BUILD >> >> > COMMAND ${PYTHON_EXECUTABLE} >> >> > ARGS ${CMAKE_HOME_DIRECTORY}/CopyFramework.py >> >> > --binary ${PROJECT_BINARY_DIR}/Bin >> >> > --framework MyFramework.framework >> >> > --app MyApp.app >> >> > >> >> > ) >> >> > ENDIF (APPLE) >> >> > >> >> > This calls out to my python script, which does the work of assembling >> >> > the src and dest paths, and actually copying the Framework. >> >> > >> >> > The final trick is that since this is a Mac only thing, I can rely on >> >> > an Xcode environment variable within the Python script: >> >> > config= os.environ["CONFIGURATION"] >> >> > >> >> > This allows me to assemble the complete path to the actual binary >> >> > locations of the framework and the app. >> >> > >> >> > The one thing I wish was that there was a CMake variable that would >> >> > expand to the current Config within the context of the >> >> > ADD_CUSTOM_COMMAND... It'd be nice to not have to resort to using the >> >> > Xcode environment variable. >> >> > >> >> > Thanks again >> >> > Glenn >> >> >> >> Looks like you generally have a handle on things. The subtle thing >> >> about the Xcode Environment variables is that your CMake Code is run >> >> at "Cmake Time" which will have no idea about the Xcode variables that >> >> are set during a "Build Time". Chicken-and-Egg sort of thing. In the >> >> recent HDF5 Version 1.8 CMake Port/Fork I have the following code that >> >> runs an executable as soon as it is compiled: >> >> >> >> SET (CFG_INIT "/${CMAKE_CFG_INTDIR}") >> > >> > Don't you mean "/\${CMAKE_CFG_INTDIR}", so the proper variable >> > substitution happens later? >> > If so, is that why you have an IF(XCODE) section? >> > >> > Clint >> >> Well I tried that and either CMake or Xcode just didn't really know >> what to do with it. >> >> CMake turns the add_custom_command into a shell script. The >> "CONFIGURATION" is an environment variable that is set by Xcode during >> the execution of the shell script so during the actual execution the >> proper value gets substituted and everything works. If there is a >> better way, I am all ears.. > > This works for me in XCode/Visual Studio/Makefiles/etc...: > > ADD_CUSTOM_COMMAND( > OUTPUT ${foo_BINARY_DIR}/allwords.h > COMMAND ${foo_BINARY_DIR}/CMake/${CMAKE_CFG_INTDIR}/wordlist > ARGS allwords.h ${COMMAND_TABLES} > DEPENDS ${COMMAND_TABLES} > ${foo_BINARY_DIR}/CMake/${CMAKE_CFG_INTDIR}/wordlist > ) > > Clint > > ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com
[CMake] framework, plugin and umbrella frameworks with cmake ?
Hi, AFAIK cmake doesn't support building these types of frameworks out-of-the-box. Is it possible to do this using cmake macros ? Or is it even planned to implement it directly in cmake ? Bye Alex -- Echte DSL-Flatrate dauerhaft für 0,- Euro*! "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake