[Cmake] What if I _don't_ want link libraries propgated to SUBDIRS?
Terry Lorber
tlorber at atlantiscomp.com
Thu, 15 Jan 2004 13:15:54 -0500
I'm developing with MS VS 6 and Cmake 1.8 patch 3.
Generally my project tree should link against the multithreaded using
dll libraries (msvcrt, msvcrtd). However, in one subdirectory I'd like
to link against the single-threaded library (libc, libcd). I've used
the SET command to set the compiler flags correctly, but I haven't been
able to get rid of the default libraries.
Here's what I'm doing at my top-level make:
IF(WIN32)
IF(NOT CYGWIN)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Zi /Zl /O2")
SET(CMAKE_CXX_FLAGS_RELEASE "/MD /Zl /O2")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MD /Zl /O1")
SET(CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Zl /Od /GZ")
LINK_LIBRARIES(
debug mfcs42d debug msvcrtd
optimized mfcs42 optimized msvcrt
)
ENDIF(NOT CYGWIN)
ENDIF(WIN32)
And here's the sub-directory in question:
SET(CMAKE_CXX_FLAGS "/W3 /GX" )
SET(CMAKE_CXX_FLAGS_RELEASE "/ML" )
SET(CMAKE_CXX_FLAGS_DEBUG "/MLd" )
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/ML" )
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MLd" )
SET(CMAKE_EXE_LINKER_FLAGS "")
ADD_EXECUTABLE(foo foo.cpp)
TARGET_LINK_LIBRARIES(foo
optimized libc debug libcd
)
Thanks.
tgl
--
Atlantis Components Inc 270 Third St
617.661.9799x248 Cambridge MA 02142