diff --git a/Applications/PluginGenerator/CMakeLists.txt b/Applications/PluginGenerator/CMakeLists.txt index 1a082835e4..0106f4fdcb 100644 --- a/Applications/PluginGenerator/CMakeLists.txt +++ b/Applications/PluginGenerator/CMakeLists.txt @@ -1,69 +1,70 @@ cmake_minimum_required(VERSION 2.8.4) project(MITKPluginGenerator) set(VERSION_MAJOR 1) set(VERSION_MINOR 0) set(VERSION_PATCH 0) if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) set(standalone_build 1) else() set(standalone_build 0) endif() #----------------------------------------------------------------------------- # Prerequesites #----------------------------------------------------------------------------- set(QT_DONT_USE_QTGUI 1) find_package(Qt 4.6.2 REQUIRED) include(${QT_USE_FILE}) #----------------------------------------------------------------------------- # Executable #----------------------------------------------------------------------------- set(src_files PluginGenerator.cpp ctkCommandLineParser.cpp ) qt4_wrap_cpp(src_files ctkCommandLineParser.h) qt4_add_resources(src_files plugin_template.qrc project_template.qrc) -add_executable(PluginGenerator ${src_files}) -target_link_libraries(PluginGenerator ${QT_LIBRARIES}) +set(exec_target ${PROJECT_NAME}) +add_executable(${exec_target} ${src_files}) +target_link_libraries(${exec_target} ${QT_LIBRARIES}) if(NOT standalone_build) # subproject support - add_dependencies(MITK-CoreUI PluginGenerator) + add_dependencies(MITK-CoreUI ${exec_target}) endif() #----------------------------------------------------------------------------- # Win32 Convenience #----------------------------------------------------------------------------- if(WIN32 AND NOT standalone_build) file(TO_NATIVE_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}" native_runtime_dir) - add_custom_target(NewPlugin start "MITK PluginGenerator" /D "${native_runtime_dir}" cmd /K PluginGenerator.exe -h - DEPENDS PluginGenerator) + add_custom_target(NewPlugin start "MITK PluginGenerator" /D "${native_runtime_dir}" cmd /K ${exec_target}.exe -h + DEPENDS ${exec_target}) endif() #----------------------------------------------------------------------------- # Testing #----------------------------------------------------------------------------- if(NOT standalone_build) # Test the plugin generator include(mitkTestPluginGenerator) endif() #----------------------------------------------------------------------------- # Packaging support #----------------------------------------------------------------------------- if(standalone_build) include(SetupPackaging.cmake) endif() diff --git a/Applications/PluginGenerator/SetupPackaging.cmake b/Applications/PluginGenerator/SetupPackaging.cmake index 794d78f7b2..48cbf89818 100644 --- a/Applications/PluginGenerator/SetupPackaging.cmake +++ b/Applications/PluginGenerator/SetupPackaging.cmake @@ -1,50 +1,50 @@ #----------------------------------------------------------------------------- # Installation #----------------------------------------------------------------------------- -install(TARGETS PluginGenerator DESTINATION .) +install(TARGETS ${exec_target} DESTINATION .) install(CODE " set(DIRS ${QT_LIBRARY_DIR} ${QT_LIBRARY_DIR}/../bin ${CTK_LIBRARY_DIRS} ) include(BundleUtilities) - fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/PluginGenerator\" \"\" \"\${DIRS}\") + fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${exec_target}${CMAKE_EXECUTABLE_SUFFIX}\" \"\" \"\${DIRS}\") ") #----------------------------------------------------------------------------- # Packaging #----------------------------------------------------------------------------- # # First, set the generator variable # if(WIN32) set(CPACK_GENERATOR ZIP) elseif(APPLE) set(CPACK_GENERATOR DragNDrop) else() set(CPACK_GENERATOR TGZ) endif() # include required mfc libraries include(InstallRequiredSystemLibraries) set(CPACK_PACKAGE_NAME "MITKPluginGenerator") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MITK PluginGenerator bootstraps MITK-based projects") set(CPACK_PACKAGE_VENDOR "German Cancer Research Center (DKFZ)") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/MITKCopyright.txt") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/MITKCopyright.txt") set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}") set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}") set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}") # tell cpack to strip all debug symbols from all files set(CPACK_STRIP_FILES ON) include(CPack)