[CMake] Advice on how to remove duplicated code for object and interface library setup

2018-03-15 Thread Stephen McDowell
I am trying to obey modern CMake target-based practices, with a twist that everything is available as an OBJECT library if desired. I have this working and can explain why if desired, but I feel it is extraneous for this question. What I create: - mylib <- the main library - mylib_obj <-

Re: [CMake] Link-Time Dependency Injection for Unit Tests

2018-03-15 Thread Eric Noulard
2018-03-15 14:52 GMT+01:00 Joshua Baergen : > Thanks Eric! That worked perfectly. > > I had looked at generator expressions yesterday, but didn't understand at > which point during makefile generation they were evaluated, and had falsely > assumed that they were evaluated too early. Happy to learn

Re: [CMake] Link-Time Dependency Injection for Unit Tests

2018-03-15 Thread Joshua Baergen
Thanks Eric! That worked perfectly. I had looked at generator expressions yesterday, but didn't understand at which point during makefile generation they were evaluated, and had falsely assumed that they were evaluated too early. Happy to learn new tricks! :) Josh On Thu, Mar 15, 2018 at 2:56 AM

[CMake] managed targeted code requires a '/clr' option cmake fix

2018-03-15 Thread Shreyas Ravishankar
Hey Guys, Just wanted to find out if there is a way to fix the "*managed targeted code requires a '/clr' option*" error while compiling. The problem is ,this projects has C# dependency. It uses #using(.dll). In VS configuration project settings this can be given but how do you do it using CMake

[CMake] Incremental builds with ExternalProject_Add

2018-03-15 Thread Attila Krasznahorkay
Dear All, I ran into an issue with incremental builds that use ExternalProject_Add(...), which I'm very surprised isn't a more widely advertised issue. So I thought I'd ask here if people are aware of this behaviour... For our software projects we build a good number of externals using separate

Re: [CMake] Link-Time Dependency Injection for Unit Tests

2018-03-15 Thread Eric Noulard
Hi Joshua, 2018-03-15 4:18 GMT+01:00 Joshua Baergen : > Hello, > > I'm attempting to implement link-time dependency injection. In brief, what > this means is that, for a library A that depends on B, we would normally > have: > > target_link_libraries(A B) > > However, when building unittests f