[CMake] Shipped modules that use -l
Orion Poplawski
orion at cora.nwra.com
Mon May 12 17:09:36 EDT 2008
It seems that there are still a lot of shipped cmake modules that use -l
and so trigger the CMP0003 warning. For example, FindThreads.cmake uses
"-lpthread".
CMake Warning (dev) at src/osg/CMakeLists.txt:173 (ADD_LIBRARY):
Policy CMP0003 should be set before this line. Add code such as
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
as early as possible but after the most recent call to
cmake_minimum_required or cmake_policy(VERSION). This warning appears
because target "osg" links to some libraries for which the linker must
search:
-lpthread
and other libraries with known full path:
/builddir/build/BUILD/OpenSceneGraph-2.4.0/BUILD/lib/libOpenThreads.so.2.2.1
CMake is adding directories in the second list to the linker search
path in
case they are needed to find libraries from the first list (for backwards
compatibility with CMake 2.4). Set policy CMP0003 to OLD or NEW to
enable
or disable this behavior explicitly. Run "cmake --help-policy
CMP0003" for
more information.
This warning is for project developers. Use -Wno-dev to suppress it.
Some more:
cmake-2.6.0/Modules/FindThreads.cmake: SET(CMAKE_THREAD_LIBS_INIT
"-lpthreads")
cmake-2.6.0/Modules/FindThreads.cmake: SET(CMAKE_THREAD_LIBS_INIT
"-lpthread")
cmake-2.6.0/Modules/FindThreads.cmake:
SET(CMAKE_THREAD_LIBS_INIT "-lthread")
cmake-2.6.0/Modules/FindThreads.cmake: SET(CMAKE_THREAD_LIBS_INIT
"-lcma")
cmake-2.6.0/Modules/Platform/AIX.cmake:SET(CMAKE_DL_LIBS "-lld")
cmake-2.6.0/Modules/Platform/BlueGeneL.cmake: "<CMAKE_C_COMPILER>
-Wl,-relax<FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o
<TARGET> <LINK_LIBRARIES> -Wl,-lgcc,-lc -lnss_files -lnss_dns -lresolv")
cmake-2.6.0/Modules/Platform/BlueGeneL.cmake: "<CMAKE_C_COMPILER>
-Wl,-relax<FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o
<TARGET> <LINK_LIBRARIES> -Wl,-lc -lnss_files -lnss_dns -lresolv")
cmake-2.6.0/Modules/Platform/BlueGeneL.cmake: "<CMAKE_CXX_COMPILER>
-Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o
<TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lgcc,-lc -lnss_files -lnss_dns
-lresolv")
cmake-2.6.0/Modules/Platform/BlueGeneL.cmake: "<CMAKE_CXX_COMPILER>
-Wl,-relax <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o
<TARGET> <LINK_LIBRARIES> -Wl,-lstdc++,-lc -lnss_files -lnss_dns -lresolv")
cmake-2.6.0/Modules/Platform/Windows-bcc32.cmake:SET
(CMAKE_EXE_LINKER_FLAGS_INIT "-tWM -lS:10000000 -lSc:10000000 ")
cmake-2.6.0/Modules/Platform/CYGWIN.cmake:SET(CMAKE_DL_LIBS "-lgdi32" )
cmake-2.6.0/Modules/FindX11.cmake: SET(X11_X_EXTRA_LIBS -lnsl_s -linet)
cmake-2.6.0/Modules/FindX11.cmake: SET (X11_X_EXTRA_LIBS
${X11_X_EXTRA_LIBS} -ldnet)
cmake-2.6.0/Modules/FindX11.cmake: SET (X11_X_EXTRA_LIBS
${X11_X_EXTRA_LIBS} -ldnet_stub)
cmake-2.6.0/Modules/FindX11.cmake: SET (X11_X_EXTRA_LIBS
${X11_X_EXTRA_LIBS} -lnsl)
cmake-2.6.0/Modules/FindX11.cmake: SET (X11_X_EXTRA_LIBS
${X11_X_EXTRA_LIBS} -lbsd)
cmake-2.6.0/Modules/FindX11.cmake: SET (X11_X_EXTRA_LIBS
-lsocket ${X11_X_EXTRA_LIBS})
cmake-2.6.0/Modules/FindX11.cmake: SET (X11_X_EXTRA_LIBS
${X11_X_EXTRA_LIBS} -lposix)
cmake-2.6.0/Modules/FindX11.cmake: SET (X11_X_EXTRA_LIBS
${X11_X_EXTRA_LIBS} -lipc)
cmake-2.6.0/Modules/FindFLTK.cmake: SET( FLTK_PLATFORM_DEPENDENT_LIBS
${X11_LIBRARIES} -lm)
cmake-2.6.0/Modules/FindFLTK.cmake: SET( FLTK_PLATFORM_DEPENDENT_LIBS
"-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
cmake-2.6.0/Modules/FindFLTK.cmake: SET( FLTK_PLATFORM_DEPENDENT_LIBS
ole32 uuid comctl32 wsock32 supc++ -lm -lgdi32)
cmake-2.6.0/Modules/FindFLTK.cmake: SET(FLTK_LIBS_EXTRACT_REGEX
".*-lfltk_images (.*) -lfltk.*")
cmake-2.6.0/Modules/FindFLTK2.cmake: SET( FLTK2_PLATFORM_DEPENDENT_LIBS
${X11_LIBRARIES} -lm)
cmake-2.6.0/Modules/FindFLTK2.cmake: SET( FLTK2_PLATFORM_DEPENDENT_LIBS
"-framework Carbon -framework Cocoa -framework ApplicationServices -lz")
cmake-2.6.0/Modules/FindFLTK2.cmake: SET( FLTK2_PLATFORM_DEPENDENT_LIBS
ole32 uuid comctl32 wsock32 supc++ -lm -lgdi32)
cmake-2.6.0/Modules/FindFLTK2.cmake: SET(FLTK2_LIBS_EXTRACT_REGEX
".*-lfltk2_images (.*) -lfltk2.*")
cmake-2.6.0/Utilities/Release/dashsun1_release.cmake:CMAKE_EXE_LINKER_FLAGS:STRING=-Bdynamic
-ldl -Bstatic
cmake-2.6.0/Utilities/Release/dashsun1_release.cmake:
"SET(CMAKE_DL_LIBS \\\"-Bdynamic -ldl -Bstatic\\\")")
--
Orion Poplawski
Technical Manager 303-415-9701 x222
NWRA/CoRA Division FAX: 303-415-9702
3380 Mitchell Lane orion at cora.nwra.com
Boulder, CO 80301 http://www.cora.nwra.com
More information about the CMake
mailing list