AW: AW: [CMake] Weird DLL_EXPORT disables creation of .lib-files withVisual C++ .NET 2003

wedekind wedekind at caesar.de
Thu Jun 30 04:05:09 EDT 2005


Hello Brad, hello all,

you are right Brad, I forgot an important piece of information from my
CMakeLists.txt. So here is the library definition:

== Begin CMakeLists.txt ==

PROJECT(JCore)

SET_TARGET_PROPERTIES(JCore PROPERTIES DEFINE_SYMBOL JCORE_DLL_EXPORT)

SET (JCore_SRCS
...
)

QT_WRAP_CPP(
	JCore
	GENERATED_MOC_FILES
...
)

ADD_LIBRARY(
	JCore
	SHARED
	${GENERATED_MOC_FILES}
	${JCore_SRCS}
)

TARGET_LINK_LIBRARIES(
	JCore
	...
)

== End CMakeLists.txt ==

I have also tried to add a preprocessor definition with 

ADD_DEFINITIONS(-DJCORE_DLL_EXPORT)

which has worked. Although there is this preprocessor definition
automatically generated by cmake (in my case JCore_EXPORTS) which I cannot
control and which is always there, even if I do not need it (or worse: even
if I have redefined this definition to something different than a dll-export
definition)...

JCORE_DLL_EXPORT defined with SET_TARGET_PROPERTIES does not appear in my
vcproj-file. Did I mistype something or do I have to change the order of
instructions in my CMakeLists.txt?

Thanks

Marco

-----Ursprüngliche Nachricht-----
Von: Brad King [mailto:brad.king at kitware.com] 
Gesendet: Mittwoch, 29. Juni 2005 18:12
An: wedekind
Cc: cmake at cmake.org
Betreff: Re: AW: [CMake] Weird DLL_EXPORT disables creation of .lib-files
with Visual C++ .NET 2003

wedekind wrote:
> Hello Brad,
> 
> thanks for your quick response! I have checked the sources and you are
> right: there are (some) export definitions  that do not fit the cmake 
> "target-name_EXPORTS"-pattern for export definitions.
> 
> Changing the source code might be an option, but it is good to know 
> how to redefine cmakes export-macro definition... But I have some 
> problems with this redefinition, here is an example of the beginnig of 
> a
> CMakeLists.txt-file:
> 
> PROJECT(JCore)
> 
> SET_TARGET_PROPERTIES(JCore PROPERTIES DEFINE_SYMBOL JCORE_DLL_EXPORT)
> 
> ...
> 
> In this case JCORE_DLL_EXPORT is my own export-macro definition. Is 
> the snippet above correct? This preprocessor definition defined by 
> SET_TARGET_PROPERTIES simply does not appear in my generated project 
> files...

Are you sure CMake knows JCore is a shared library?  What code do you use to
add the library?

-Brad




More information about the CMake mailing list