[CMake] [cmake] windows dll and TARGET_LINK_LIBRARIES
Sören Freudiger
muffmolch at gmx.de
Fri Oct 10 03:21:12 EDT 2008
Hi
How to handle windows dll dependences in CMake.
CMakeList.txt
=============
ADD_LIBRARY(MY_DLL MODULE ${ALL_SOURCES} ) #--> MSVC generates MY_DLL.dll
and one
# small MY_DLL.lib that has to
be linked
# to projects using MY_DLL.dll
ADD_EXECUTABLE(test main.cpp)
TARGET_LINK_LIBRARIES(test.exe MY_DLL) #--> CMake error. module linking not
possible
# HACK:
IF(WIN32)
TARGET_LINK_LIBRARIES(test.exe
"$(SolutionDir)$(ConfigurationName)\\${LIB_NAME}.lib")
ENDIF()
=============
Question:
How do I avoid the hack??
Regards,
SirAnn
More information about the CMake
mailing list