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
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
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.
#/*================================================================================
#
# UCLToolkit: An image processing toolkit jointly developed by the
# Dementia Research Centre, and the Centre For Medical Image
Computing
# at University College London.
#
# See: http://dementia.ion.ucl.ac.uk/
# http://cmic.cs.ucl.ac.uk/
# http://www.ucl.ac.uk/
#
# Copyright (c) UCL : See LICENSE.txt in the top level directory for details.
#
# Last Changed : $LastChangedDate: 2011-12-01 10:26:53 +0000 (Thu, 01 Dec
2011) $
# Revision : $Revision: 7899 $
# Last modified by : $Author: mjc $
#
# Original author : [email protected]
#
# This software is distributed WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the above copyright notices for more information.
#
#=================================================================================*/
set(MY_APP_NAME NiftyView2)
include_directories(
${org_blueberry_osgi_INCLUDE_DIRS}
${Poco_INCLUDE_DIRS}
${mbilog_INCLUDE_DIRS}
${ALL_INCLUDE_DIRECTORIES}
)
MITK_USE_MODULE(ucltkMitkExt)
INCLUDE_DIRECTORIES(${ALL_INCLUDE_DIRECTORIES})
#-----------------------------------------------------------------------------
# Executable
#-----------------------------------------------------------------------------
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)
if(${MY_PROJECT_NAME}_SHOW_CONSOLE_WINDOW)
add_executable(${MY_APP_NAME} MACOSX_BUNDLE ${MY_APP_NAME}.cpp
${OSX_ICON_FILES} ${OSX_LOGO_FILES} )
else()
add_executable(${MY_APP_NAME} MACOSX_BUNDLE WIN32 ${MY_APP_NAME}.cpp
${OSX_ICON_FILES} ${OSX_LOGO_FILES} )
endif()
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)
if(WIN32)
target_link_libraries(${MY_APP_NAME}
optimized PocoFoundation debug PocoFoundationd
optimized PocoUtil debug PocoUtild
optimized PocoXml debug PocoXmld
org_blueberry_osgi
${ALL_LIBRARIES}
${QT_QTCORE_LIBRARY}
${QT_QTMAIN_LIBRARY}
)
else(WIN32)
target_link_libraries(${MY_APP_NAME}
org_blueberry_osgi
${ALL_LIBRARIES}
)
endif(WIN32)
# Make sure all enabled plug-ins are up to date when building the application
ctkFunctionExtractPluginTargets("${PROJECT_PLUGINS}" ON PROJECT_ENABLED_PLUGINS)
if(PROJECT_ENABLED_PLUGINS)
add_dependencies(${MY_APP_NAME} ${PROJECT_ENABLED_PLUGINS})
endif()
#-----------------------------------------------------------------------------
# Additional files needed for the executable
#-----------------------------------------------------------------------------
# Create a provisioning file, listing all enabled plug-ins
set(PROJECT_PROVISIONING_FILE
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MY_APP_NAME}.provisioning")
FunctionCreateProvisioningFile(
FILE ${PROJECT_PROVISIONING_FILE}
INCLUDE "${MITK_PLUGIN_PROVISIONING_FILE}"
PLUGINS ${PROJECT_PLUGINS}
)
# Create a .ini file for initial parameters
configure_file(${MY_APP_NAME}.ini
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${MY_APP_NAME}.ini)
# Create batch files for Windows platforms
if(WIN32)
foreach(BUILD_TYPE debug release)
mitkFunctionCreateWindowsBatchScript(start${MY_APP_NAME}.bat.in
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/start${MY_APP_NAME}_${BUILD_TYPE}.bat
${BUILD_TYPE})
endforeach()
endif()
#-----------------------------------------------------------------------------
# Install support
#-----------------------------------------------------------------------------
# This installs all enabled CTK plug-ins
FunctionInstallThirdPartyCTKPlugins(${CTK_PLUGIN_LIBRARIES})
# Install the executable
MITK_INSTALL_TARGETS(EXECUTABLES ${MY_APP_NAME} LIBRARY_DIRS
${Boost_LIBRARY_DIRS} ${MITK_LIBRARY_DIRS} GLOB_PLUGINS)
# Note: Here we install Qt Assistant as a helper app.
# In a project where MITK is used as an external dependency you would
ordinarily use
# the MITK-Project-Template https://github.com/MITK/MITK-ProjectTemplate.
# Our project was written before this template was available, but broadly
speaking
# the CMake stuff is similar, just in different places. So, in the standard
MITK project
# template there is a line 'include(mitkInstallRules)' after the top-level
'include(CPack)'
# line in the top level CMakeLists.txt. This mitkInstallRules contains the line
# below to install the helper app. So rather than call mitkInstallRules to do
that,
# we are doing it here. If you call mitkInstallRules just before (or after)
# 'include(CPack)' which for our project is in the very top level
CMakeLists.txt file,
# then the Mac build breaks. Also you get additional files installed that we
simply don't need.
MITK_INSTALL_HELPER_APP(EXECUTABLES ${QT_ASSISTANT_EXECUTABLE} )
# Install the Provisioning file.
mitkFunctionInstallProvisioningFiles(${MITK_PROVISIONING_FILES}
${PROJECT_PROVISIONING_FILE})
# On Linux, create a shell script to start a relocatable application
if(UNIX AND NOT APPLE)
install(PROGRAMS "${MITK_SOURCE_DIR}/CMake/RunInstalledApp.sh" DESTINATION
"." RENAME ${MY_APP_NAME}.sh)
endif()
# Tell cpack the executables that you want in the start menu as links
set(MITK_CPACK_PACKAGE_EXECUTABLES "${MITK_CPACK_PACKAGE_EXECUTABLES}"
"${MY_APP_NAME};UCLTK - ${MY_APP_NAME} Application" CACHE INTERNAL "Collecting
windows shortcuts to executables")
Thanks ever so much
Matt
On 9 Dec 2011, at 17:16, Sascha Zelzer wrote:
> Hi MITK users,
>
> We recently updated the CTK version used in MITK and also made some
> build system improvements.
>
> IMPORTANT: After a git update of MITK, you need to remove the
> CTK_PLUGIN_LIBRARIES entry in your MITK-build/CMakeCache.txt file. You
> probably also have to delete the MITK-build/MITK-ProjectTemplate* and
> MITK-build/GeneratedTestProject* directories. This should avoid having
> to do a complete clean rebuild of MITK. If you have your own projects
> using CTK plug-ins, you will also have to remove the
> CTK_PLUGIN_LIBRARIES from your CMakeCache.txt file(s).
>
> For users of the MITK applications (like ExtApp and CoreApp):
>
> - There are now dedicated CMake build options to enable them. Look for
> MITK_BUILD_APP_ExtApp etc.
> - Enabling one of the build options automatically enables the minimum
> dependencies
> - You can enable any other plug-in to have it show up in the application
>
>
> The information below is only relevant for people using MITK as an
> external project in their own BlueBerry or pure CTK based applications:
>
> Here is a short list of important changes:
>
> - The CTK macro ctkMacroSetupExternalPlugins was renamed to
> ctkMacroSetupPlugins. You have to adapt your calls to this macro.
> - Creating executables which use BlueBerry got much easier. There is one
> magic macro, called FunctionCreateBlueBerryApplication(). See for
> example
> https://github.com/MITK/MITK-ProjectTemplate/blob/master/Apps/AwesomeApp/CMakeLists.txt
>
> for how it is used.
>
> - The CTK macros now allow to validate the plug-in build options against
> the plug-in requirements of your applications (these can be runtime
> dependencies, not only link-time dependencies). See the
> https://github.com/MITK/MITK-ProjectTemplate for how it is done, or the
> actual commit here:
> https://github.com/MITK/MITK-ProjectTemplate/commit/a7f0fb90af26030a042e37cf54f1248556fdce7d
>
> .
>
> - The MITK Plugin Generator has been updated to work with the above
> changes and to generate compatible project stubs. You can use the new
> binary from your MITK-build tree or wait a little bit for the release
> package.
>
> That's it for now. Ask questions or report any problems you encounter.
>
> Thanks,
>
> Sascha
>
> ------------------------------------------------------------------------------
> Cloud Services Checklist: Pricing and Packaging Optimization
> This white paper is intended to serve as a reference, checklist and point of
> discussion for anyone considering optimizing the pricing and packaging model
> of a cloud services business. Read Now!
> http://www.accelacomm.com/jaw/sfnl/114/51491232/
> _______________________________________________
> mitk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mitk-users
>
------------------------------------------------------------------------------
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