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

Brad King brad.king at kitware.com
Thu Jun 30 09:43:20 EDT 2005


wedekind wrote:
> 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?

Set the target property AFTER adding the target.

-Brad


More information about the CMake mailing list