Last week I added the following lines of source code:
FB::DOM::WindowPtr domWindowPtr = [self host]->getDOMWindow() ;
FB::detail::VariantListInserter variant_list = FB::variant_list_of([jsonText UTF8String]) ;
domWindowPtr->callMethod<void>("receiveChanges", variant_list);
In order for this to compile, in my project's plugin target, I needed to add the following Header Search path to declare that callMethod template function…
$(PROJECT_DIR)/../firebreath/src/NPAPIHost
But I now appreciate that touching Xcode Build Settings is not acceptable in The CMake Way; I need to add this to a cmake file. Obviously this is do-able because prepmac adds a dozen Header Search Paths when it creates the project. I looked at cmake's "Properties on Targets" here:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#section_PropertiesonTargets
but can't find a property which seems to be equivalent to Header Search Paths.
How does one add a Header Search Path via CMake?
Thanks,
Jerry Krinock
FB::VariantList variant_list = FB::variant_list_of([jsonText UTF8String]) ;
> I'm not sure if I'm really fully following what you're doing there...
This code is in a method which listens for an interprocess message from my app. These three lines of code forward the message to JavaScript in my browser extension.
>> FB::DOM::WindowPtr domWindowPtr = [self host]->getDOMWindow() ;
>> FB::detail::VariantListInserter variant_list = FB::variant_list_of([jsonText UTF8String]) ;
>> domWindowPtr->callMethod<void>("receiveChanges", variant_list);
> I would expect the second line to read more like this:
>
>>
> FB::VariantList variant_list = FB::variant_list_of([jsonText UTF8String]) ;
OK. I don't remember where I got that type.
> Where did you get the idea that callMethod was in NPAPIHost?
Same thing I always do whenever the Xcode complains of an undeclared method. Doubleclick it to search the project and find the declaration or definition.
> All you should need to include is "DOM.h" which will include the other needed headers: https://github.com/firebreath/FireBreath/blob/master/src/ScriptingCore/DOM.h
Oh, OK. That's what I call an "handy umbrella header".
> Anyway, back to your original question (though I don't think it is the solution to what you were aiming for):
Indeed it is not, but now I need to do this for some of my own headers…
> http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:include_directories
OK, I was thinking that one might work.
> Somewhere before the add_library call (which occurs in the projectDef.cmake platform-specific file, in some cases inside another macro that would look like add_mac_plugin or add_x11_plugin you need to put an include_directories(....) command with the list of directories to add to the header search path.
Thank you. I added this and it produces "Header Search Paths" in Xcode as desired…
set (MY_HEADERS
# Add any "Header Search Paths" needed by your plugin target here.
# Enter each as a full path on a line by itself, double-quoted, no comma.
"/Users/jk/Documents/Programming/Projects/MyApp/"
"/Users/jk/Documents/Programming/CategoriesObjC/"
"/Users/jk/Documents/Programming/ClassesObjC/"
"/Users/jk/Documents/Programming/ProtocolsObjC/"
)
include_directories(
${MY_HEADERS}
)