[vtkusers] Interacting with VTK under Mac OS X

Brad King brad.king at kitware.com
Fri Mar 16 19:27:35 EDT 2007


Mike Jackson wrote:
> So  I have tried all sorts of variations of SET_TARGET_PROPERTIES with
>> CMAKE_INSTALL_RPATH
>> CMAKE_INSTALL_NAME_DIR
> and I am not getting what I want. Here is part of my CMakeLists.txt file.
> 
> ADD_LIBRARY(CTMDCore SHARED ${SOURCES})
> 
> SET_TARGET_PROPERTIES(CTMDCore
>   PROPERTIES
>   CMAKE_BUILD_WITH_INSTALL_RPATH ON
>   SKIP_BUILD_RPATH ON
>   INSTALL_RPATH /usr/local
>   #CMAKE_INSTALL_NAME_DIR "@executable_path/../PlugIns"
>   )
> 
> INSTALL(TARGETS CTMDCore
>   LIBRARY DESTINATION lib
>   )
> 
> So either I am misunderstanding what I am supposed to do or this doesn't
> work on OS X. I am leaning more towards the second.. ;-)

You have not read the docs carefully enough...the PROPERTIES are called
just BUILD_WITH_INSTALL_RPATH and INSTALL_NAME_DIR.  They are
*initialized* by variables called CMAKE_<property-name>.  Try this:

SET_TARGET_PROPERTIES(CTMDCore PROPERTIES
  INSTALL_NAME_DIR "@executable_path/../PlugIns"
  )

INSTALL(TARGETS CTMDCore
  LIBRARY DESTINATION lib
  )

-Brad



More information about the vtkusers mailing list