IRC Log Viewer » #firebreath » 2014-04-03

IRC Nick Time (GMT-7) Message
ceterumnet 12:04 howdy all, I'm trying to figure out why FBLOG_* macros aren't working for me. I've implemented the getLoggingMethods as outlined on SO and Wiki...but that method doesn't appear to be getting called (at least from what I can see in my debugger) - I've added the add_firebreath_library(log4cplus) to my pluginconfig.cmake and regenerated project files etc...
taxilian 12:04 have you tried debugging?
ceterumnet 12:04 taxilian: I've got the debugger attached and the getLoggingMethods never gets called.
taxilian 12:04 so find where it is supposed to be called and set the breakpoint there =]
so find where it is supposed to be called and set the breakpoint there =]
track it backwards
track it backwards
I dont' know offhand
I dont' know offhand
ceterumnet 12:04 taxilian: I searched the solution for getLoggingMethods - and I didn't find any references...but I'll keep looking
taxilian: I searched the solution for getLoggingMethods - and I didn't find any references...but I'll keep looking
grrr...stupid visualstudio
I found it with grep
taxilian 12:04 hehe
it's possible that you need to delete the build dir and reprep
if it didn't get the log4cplus stuff then it won't have included that file, which would explain why visual studio doesn't know about it
ceterumnet 12:04 that makes sense - it looks like the NullLogger was in place...I'll delete and start over
taxilian 12:04 could be worse… you could be working with DirectShow, like I am now
ceterumnet 12:04 taxilian: lol
taxilian: no thanks.
taxilian 12:04 we have a customer that has like 100 computers all having the same issue, and as far as I can tell the issue is primarily in the driver for the usb capture
and I get to try to fix it from my side
ceterumnet 13:04 ugh
ugh
so:
set(LogKey "${PLUGIN_NAME}_log4cplus")
if (${LogKey})
file (GLOB LOGGER RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
log4cplus/*.cpp
log4cplus/*.h
log4cplus/*.h
)
SOURCE_GROUP(log4cplus ${LOGGER})
elseif(NOT CUSTOM_LOGGING)
file (GLOB LOGGER RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
file (GLOB LOGGER RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
null/*.cpp
null/*.h
)
endif()
the if(${LogKey}) evaluates to false in CMake - therefore the log4cplus stuff doesn't get added. I wonder if this is a CMake version issue...
Do you recall what the original intent of this code was? Because it reads like:
Do you recall what the original intent of this code was? Because it reads like:
1. Set LogKey
2. if LogKey - include log4cplus stuff
...
sorry for multiline...
sorry for multiline...
taxilian 13:04 that doesn't sound right
let me look
let me look
try changing that to if (TARGET ${LogKey})
on the other hand, it is working fine for me
ceterumnet 13:04 it should work with just the if...I'll figure it out. According to cmake if(<variable>) evaluates to true for any value that is not set to the false constant...
this works -
if (LogKey)
taxilian 13:04 but if that were the case, it would always include log4cplus
and it obviously doesn't
so I'm a bit confused
ceterumnet 13:04 I'm confused what the original intent is...it seems like a variable is being defined and then checked for truthy-ness...
taxilian 13:04 the original intent is to check to see if that target exists
ceterumnet 13:04 ahh
taxilian 13:04 hmm. my project won't build… it always has before
I am suspecting a cmake change, but unsure
keep getting "/MACHINE not specified; defaulting to X86" and "failure during conversion to COFF: file invalid or corrupt"
ceterumnet 13:04 I can't find where {PROJECT}_log4cplus gets defined as a target
taxilian 13:04 oh….
oh….
wait a sec
wait a sec
no, I know what that if statement is doing
it's checking the value of {PROJECT}_log4cplus
if it's set, then it's there
sorry, it's just been too long since I wrote this
sorry, it's just been too long since I wrote this
ceterumnet 13:04 no worries...
so it sets the value and then checks if the value is set? sorry if I am dense...
taxilian 13:04 https://github.com/firebreath/FireBreath/blob/master/cmake/common.cmake#L153
if ("fdsafdsa") is not valid
but if (MyPlugin_log4cplus) checks to see if the variable MyPlugin_log4cplus is set
that variable is set when you do add_firebreath_library(log4cplus) as seen on the line I just showed you
that variable is set when you do add_firebreath_library(log4cplus) as seen on the line I just showed you
so it isn't checking the value it just set
ceterumnet 13:04 that makes sense
taxilian 13:04 it's checking the value of the variable whose name it just calculated
ceterumnet 13:04 almost like reflection ;-)
almost like reflection ;-)
got it
got it
taxilian 13:04 cmake is kinda a different sort of language
ceterumnet 13:04 yea...we use it for all of our C/C++ projects...definitely has some interesting things, but it is better than the alternatives :)
taxilian 13:04 yeah
it's a horribly annoying system, in fact
almost as bad as not having it
but not quite
ceterumnet 13:04 AHA! - I was calling add_firebreath_library BEFORE I was setting my PLUGIN_NAME...doh!
taxilian 13:04 lol
ahh
yeah, put those at the bottom of your pluginconfig file