Hi Matt,

On 12/10/2011 08:39 AM, Clarkson, Matt wrote:
> Hi Sascha,
>
> thanks for all this. I have a few questions:
>
> 1. In the top level CMakeLists.txt of the MITK-ProjectTemplate there seem to 
> be different uses of PROJECT_NAME and MY_PROJECT_NAME
>      Is this intentional, or should they all be MY_PROJECT_NAME
The PROJECT_NAME variable is usually set by the "project(...)" CMake 
command. Hence PROJECT_NAME and MY_PROJECT_NAME are identical for a 
normal build, but not for the superbuild. However, PROJECT_NAME is used 
only in the non-superbuild CMake code (if I remember correctly) so we 
could use MY_PROJECT_NAME everywhere. Using PROJECT_NAME just feels more 
"natural" to me.

> 2. As you know, I had written my own CMake stuff before the 
> MITK-ProjectTemplate was available. I don't think I know enough about 
> sub-projects, but would it be possible to use the MITK-Project stuff exactly, 
> even if it is called within a sub-directory of a much larger project? The 
> reason is that every time the MITK-ProjectTemplate changes, I have to merge 
> stuff.
>
>      eg.
>
>      BigProject/CMakeLists.txt
>      BigProject/Code
>      BigProject/Code/Libs
>      BigProject/Code/Apps - lots of command line apps
>      BigProject/Code/Gui
>      BigProject/Code/Gui/MITK - MITK project, pretty much arranged like the 
> MITK-ProjectTemplate, but buried within another project.
>      BigProject/Code/Gui/MITK/Apps
>      BigProject/Code/Gui/MITK/Modules
>      BigProject/Code/Gui/MITK/Plugins
I did not try embedding the ProjectTemplate in a larger CMake project, 
but it *should* work (maybe needs some minor fixes). You might need to 
set some cache entries to custom values before calling 
"add_subdirectory(MITK)".

Using the original git commits as patches could work most of the time 
(may need some manual stripping of patch paths if your app is not named 
AwesomeApp ;-) ). I will try to keep that use cases in mind when 
crafting new commits.

> 3. Also, in my MITK app I have added things like icons, info.plist files for 
> Mac etc.  and so how would I add this into the new 
> FunctionCreateBlueBerryApplication call? I have attached the CMakeLists.txt 
> from my BigProject/Code/Gui/MITK/Apps/NiftyView2 folder.
>
The function takes a "SOURCES" argument list (see 
http://docs.mitk.org/nightly-qt4/BlueBerry/reference/api/html/namespaceCMake.html#a9f16f167e718f5d68edf4c12f6ed320c
 
). Everything else is done as usual: setting source file properties, 
target properties (the value for the "NAME" argument is the target), etc.

set(MY_APP_NAME NiftyView2)

MITK_USE_MODULE(ucltkMitkExt)
INCLUDE_DIRECTORIES(${ALL_INCLUDE_DIRECTORIES})

if(APPLE)
   set( OSX_ICON_FILES ${CMAKE_CURRENT_SOURCE_DIR}/icon.icns)
   set_source_files_properties( ${OSX_ICON_FILES} PROPERTIES 
MACOSX_PACKAGE_LOCATION Resources)
   set( OSX_LOGO_FILES ${CMAKE_SOURCE_DIR}/Doc/Images/Blank.png)
   set_source_files_properties( ${OSX_LOGO_FILES} PROPERTIES 
MACOSX_PACKAGE_LOCATION MacOS)
endif(APPLE)

set(app_sources ${MY_APP_NAME}.cpp ${OSX_ICON_FILES} ${OSX_LOGO_FILES})

set(app_options )
if(${MY_PROJECT_NAME}_SHOW_CONSOLE_WINDOW)
   list(APPEND app_options "SHOW_CONSOLE")
endif()
  
FunctionCreateBlueBerryApplication(
   NAME ${MY_APP_NAME}
   SOURCES ${app_sources}
   ${app_options}
)

if(APPLE)
   set_target_properties( ${MY_APP_NAME} PROPERTIES
     MACOSX_BUNDLE_EXECUTABLE_NAME "${MY_APP_NAME}"
     MACOSX_BUNDLE_GUI_IDENTIFIER "${MY_APP_NAME}"
     MACOSX_BUNDLE_BUNDLE_NAME "${MY_APP_NAME}"
     MACOSX_BUNDLE_LONG_VERSION_STRING "${UCLTK_VERSION_STRING}"
     MACOSX_BUNDLE_SHORT_VERSION_STRING 
"${UCLTK_VERSION_MAJOR}.${UCLTK_VERSION_MINOR}"
     MACOSX_BUNDLE_ICON_FILE "icon.icns"
     MACOSX_BUNDLE_COPYRIGHT "${UCLTK_COPYRIGHT}"
     )
endif(APPLE)



Best,

Sascha

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to