[CMake] aggregate targets and adding a library as resource
Mattias Holm
mattias.holm at contra.nu
Tue Mar 24 02:54:16 EDT 2009
Hi,
I am trying to use CMake to install resources with the
set_source_files_properties and then specifying the
MACOSX_PACKAGE_LOCATION. This works fine for files like PNGs and so
on, but how do I do this for a dynamic library built with CMake.
Simply put, I am trying to do something like:
add_library(examplePlugin SHARED "example-plugin.c")
get_target_property(ORBIT_PLUGINS examplePlugin LOCATION)
set_source_files_properties(${ORBIT_PLUGINS}
PROPERTIES
GENERATED true
MACOSX_PACKAGE_LOCATION Resources/plugins/)
add_executable(openorbit MACOSX_BUNDLE ${ORBIT_SRC} ${ORBIT_PLUGINS})
make[2]: *** No rule to make target `src/plugins/example/
libexamplePlugin.dylib', needed by `src/Open Orbit Debug.app/Contents/
Resources/plugins/libexamplePlugin.dylib'. Stop.
make[1]: *** [src/CMakeFiles/openorbit.dir/all] Error 2
make: *** [all] Error 2
Is there a way to say that the files in ORBIT_PLUGINS are generated by
a specific target so that cmake will not complain about something like
this? Preferably, there should be an aggregate target for all plugins
as well, is it possible to specify umbrella/aggregate targets in some
easy way?
Kind regards,
Mattias
More information about the CMake
mailing list