Skip to content

Commit

Permalink
Create bundle only on OS X
Browse files Browse the repository at this point in the history
  • Loading branch information
lamyj committed Mar 28, 2016
1 parent a7dd19d commit a5095ae
Showing 1 changed file with 32 additions and 35 deletions.
67 changes: 32 additions & 35 deletions src/appli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,49 +28,46 @@ target_link_libraries(
dicomifier
libdicomifier libdicomifiergui ${Boost_LIBRARIES} ${QT_LIBRARIES})

SET(APPS "\${CMAKE_INSTALL_PREFIX}/bin/dicomifier")
SET(qtconf_dest_dir bin)
if(APPLE)
set(APPS "\${CMAKE_INSTALL_PREFIX}/dicomifier.app")
set(qtconf_dest_dir dicomifier.app/Contents/Resources)
endif()

# We need an empty qt.conf in order to override the hard-coded paths that are
# compiled into the Qt library.
install(CODE "
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"\")
")

set(LIBRARIES )

install(
TARGETS bruker2dicom dicom2nifti dicomifier
BUNDLE DESTINATION .
RUNTIME DESTINATION bin)

SET(APPS "\${CMAKE_INSTALL_PREFIX}/bin/dicomifier")
SET(qtconf_dest_dir bin)
if(APPLE)
set(APPS "\${CMAKE_INSTALL_PREFIX}/dicomifier.app")
set(qtconf_dest_dir dicomifier.app/Contents/Resources)
# We need an empty qt.conf in order to override the hard-coded paths that are
# compiled into the Qt library.
install(CODE "
file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"\")
")

set(LIBRARIES )
install(
TARGETS bruker2dicom dicom2nifti
RUNTIME DESTINATION dicomifier.app/Contents/MacOS)
endif()

install(CODE "
macro(gp_resolve_item_override context item exepath dirs resolved_item_var resolved_var)
if(NOT \${resolved_var})
# Context is sometimes wrong: look in dirs
if(item MATCHES \"^@loader_path\")
string(REPLACE \"@loader_path/\" \"\" noprefix_item \"\${item}\")
set(ri \"ri-NOTFOUND\")
find_file(ri \"\${noprefix_item}\" \${dirs} NO_DEFAULT_PATH)
find_file(ri \"\${noprefix_item}\" \${dirs} /usr/lib)
if(EXISTS \"\${ri}\")
set(\${resolved_var} 1)
set(\${resolved_item_var} \"\${ri}\")

install(CODE "
macro(gp_resolve_item_override context item exepath dirs resolved_item_var resolved_var)
if(NOT \${resolved_var})
# Context is sometimes wrong: look in dirs
if(item MATCHES \"^@loader_path\")
string(REPLACE \"@loader_path/\" \"\" noprefix_item \"\${item}\")
set(ri \"ri-NOTFOUND\")
find_file(ri \"\${noprefix_item}\" \${dirs} NO_DEFAULT_PATH)
find_file(ri \"\${noprefix_item}\" \${dirs} /usr/lib)
if(EXISTS \"\${ri}\")
set(\${resolved_var} 1)
set(\${resolved_item_var} \"\${ri}\")
set(ri \"ri-NOTFOUND\")
endif()
endif()
endif()
endif()
endmacro()
set(BU_CHMOD_BUNDLE_ITEMS ON)
include(BundleUtilities)
fixup_bundle(\"${APPS}\" \"${LIBRARIES}\" \"${EXTRA_BUNDLE_DIRS}\")
")
endmacro()
set(BU_CHMOD_BUNDLE_ITEMS ON)
include(BundleUtilities)
fixup_bundle(\"${APPS}\" \"${LIBRARIES}\" \"${EXTRA_BUNDLE_DIRS}\")
")
endif()

0 comments on commit a5095ae

Please sign in to comment.