Hi,
is there a way to "join" an the OBJECT library with a SHARED library it creates?
The abclib and its component abc_tmp, all .c file have #include "foo.h":
add_library(abc_tmp OBJECT z1. z2.c)
# generate...
add_library(abclib SHARED $ generated.c)
Then adding the library foo, whi
> The documentation is intriguing about REQUIRED COMPONENTS interaction
That's... one way to put it.
> "A package-specific list of required components may be listed after the
> ``COMPONENTS`` option (or after the ``REQUIRED`` option if present).
> Additional optional components may be listed
Hi,
once COMPONENTS is added to a find_package statement, any REQUIRED statement
ceases to have an effect:
cmake_minimum_required(VERSION 3.12)
# find_package(FailsCorrectly REQUIRED)
find_package(Qt REQUIRED COMPONENTS REQUIRED Qt5XYZ REQUIRED)
find_package(Qt REQUIRED COM
> I cc the list because I think you drop it inadvertently.
Ah, thanks. I'll pay more attention to that now.
> Le mar. 28 août 2018 à 16:18, George PF a écrit :
>
> > > Because generator expressions are not handled in every cmake construct:
> > >
> > htt
Hello,
how can e.g. $ be iterated over in cmake?
This builds the lib, but the loop is never run:
add_library(objlib12 OBJECT lib1.c lib2.c)
foreach(o IN LISTS $)
message("obj ${o}")
endforeach()
But the $ variable is set correctly, as this builds a
shared library:
add_
>> foreach(x IN LISTS mysrcs)
>> message("at ${x}")
>> set_property(SOURCE x APPEND PROPERTY COMPILE_DEFINITIONS
>> "TEST1;TEST2;")
>
> almost there but you forgot to take value of 'x'
>
> set_property(SOURCE ${x} APPEND PROPERTY COMPILE_DEFINITIONS "TEST1;TEST2;")
>
> works fo
> > However, whatever I write into 'set_property()' - no APPEND, single entry,
> > not quoted - does not end up
> > on the compiler command line. Is there a type mismatch which is silently
> > ignored?
> >
>
> Or you are doing this in a directory which is not the one where the target
> is defined
match which is silently
ignored?
As to __FILE__ or similar, the define is used as a variable, i.e. the .c suffix
would have to be removed
via the c processor. The current directory is also used. I think replacing .c
and appending the name of
the current directory will be easier in cmake.
> Le je
Hello,
following "modern cmake" conventions I want to create a library where every
single file is compiled with an individual define (-D_fileX_, required for a
macro which integrates code into every translation unit).
So following this
add_library(mylib SHARED file1.c file2.c)
target_l