View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008406CMakeCMakepublic2009-01-20 08:242009-01-20 15:51
ReporterNicolas Despres 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0008406: Wrong LOCATION_<CONFIG> property value with MACOSX_BUNDLE option set
DescriptionConsider a simple helloworld project with the following CMakeLists.txt:
===
cmake_minimum_required(VERSION 2.6.2)
#set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules")

project(helloworld)

add_executable(helloworld MACOSX_BUNDLE
  main.cc
  )
get_target_property(binary_loc helloworld LOCATION_${CMAKE_BUILD_TYPE})
get_target_property(binary_loc2 helloworld LOCATION)
get_target_property(pkg_loc helloworld MACOSX_PACKAGE_LOCATION)
get_target_property(output_name helloworld OUTPUT_NAME)
get_target_property(is_bundle helloworld MACOSX_BUNDLE)
get_target_property(bundle_info_plist helloworld MACOSX_BUNDLE_INFO_PLIST)
get_target_property(framework_info_plist helloworld MACOSX_FRAMEWORK_INFO_PLIST)
message("CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
message("binary_loc=${binary_loc}")
message("binary_loc2=${binary_loc2}")
message("pkg_loc=${pkg_loc}")
message("output_name=${output_name}")
message("is_budle=${is_bundle}")
message("bundle_info_plist=${bundle_info_plist}")
message("framework_info_plist=${framework_info_plist}")
===
Running: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
Produces the following output:
===
CMAKE_BUILD_TYPE=Release
binary_loc=/Users/polrop/src/helloworld/_build/helloworld
binary_loc2=/Users/polrop/src/helloworld/_build/helloworld
pkg_loc=/Users/polrop/src/helloworld/_build/helloworld
output_name=output_name-NOTFOUND
is_budle=ON
bundle_info_plist=bundle_info_plist-NOTFOUND
framework_info_plist=framework_info_plist-NOTFOUND
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/polrop/src/helloworld/_build
===

I would have expected `binary_loc' to be equal to /Users/polrop/src/helloworld/_build/helloworld.app/Contents/MacOS/helloworld

The attached patch fix it, but I'm not sure I did it the right way.
TagsNo tags attached.
Attached Filespatch file icon bundle_localtion.patch [^] (496 bytes) 2009-01-20 08:24 [Show Content]

 Relationships

  Notes
(0014646)
Brad King (manager)
2009-01-20 15:51

I've committed the complete fix.

/cvsroot/CMake/CMake/Source/cmExportBuildFileGenerator.cxx,v <-- Source/cmExportBuildFileGenerator.cxx
new revision: 1.7; previous revision: 1.6
/cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v <-- Source/cmGlobalXCodeGenerator.cxx
new revision: 1.204; previous revision: 1.203
/cvsroot/CMake/CMake/Source/cmTarget.cxx,v <-- Source/cmTarget.cxx
new revision: 1.232; previous revision: 1.231

This also fixes the case of a loadable module (plugin) which 'links' to an application bundle as its loader.

 Issue History
Date Modified Username Field Change
2009-01-20 08:24 Nicolas Despres New Issue
2009-01-20 08:24 Nicolas Despres File Added: bundle_localtion.patch
2009-01-20 09:58 Bill Hoffman Status new => assigned
2009-01-20 09:58 Bill Hoffman Assigned To => Brad King
2009-01-20 15:51 Brad King Note Added: 0014646
2009-01-20 15:51 Brad King Status assigned => closed
2009-01-20 15:51 Brad King Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team