ENH: add support for X11

This commit is contained in:
Bill Hoffman 2001-05-18 16:45:53 -04:00
parent 05d4b9aafd
commit 8798d52790
2 changed files with 22 additions and 18 deletions

View File

@ -6,20 +6,24 @@ SET (CMAKE_WORDS_BIGENDIAN @CMAKE_WORDS_BIGENDIAN@ )
SET (CMAKE_USE_SPROC @CMAKE_USE_SPROC@ CACHE_NO_REPLACE BOOL) SET (CMAKE_USE_SPROC @CMAKE_USE_SPROC@ CACHE_NO_REPLACE BOOL)
SET (CMAKE_USE_PTHREADS @CMAKE_USE_PTHREADS@ CACHE_NO_REPLACE BOOL) SET (CMAKE_USE_PTHREADS @CMAKE_USE_PTHREADS@ CACHE_NO_REPLACE BOOL)
SET (CMAKE_HP_PTHREADS @CMAKE_HP_PTHREADS@ CACHE_NO_REPLACE BOOL) SET (CMAKE_HP_PTHREADS @CMAKE_HP_PTHREADS@ CACHE_NO_REPLACE BOOL)
SET (CMAKE_LIB_EXT @CMAKE_LIB_EXT@ CACHE_NO_REPLACE STRING) SET (CMAKE_LIB_EXT @CMAKE_LIB_EXT@ CACHE_NO_REPLACE )
SET (CMAKE_RANLIB "@RANLIB@" CACHE_NO_REPLACE STRING) SET (CMAKE_RANLIB "@RANLIB@" CACHE_NO_REPLACE )
SET (CMAKE_AR "@CMAKE_AR@" CACHE_NO_REPLACE STRING) SET (CMAKE_AR "@CMAKE_AR@" CACHE_NO_REPLACE )
SET (CMAKE_CXX_COMPILER "@CXX@" CACHE_NO_REPLACE FILEPATH) SET (CMAKE_CXX_COMPILER "@CXX@" CACHE_NO_REPLACE FILEPATH)
SET (CMAKE_CXX_FLAGS "@CXXFLAGS@" CACHE_NO_REPLACE STRING) SET (CMAKE_CXX_FLAGS "@CXXFLAGS@" CACHE_NO_REPLACE )
SET (CMAKE_TEMPLATE_FLAGS "@CMAKE_TEMPLATE_FLAGS@" CACHE_NO_REPLACE STRING) SET (CMAKE_TEMPLATE_FLAGS "@CMAKE_TEMPLATE_FLAGS@" CACHE_NO_REPLACE )
SET (CMAKE_C_COMPILER "@CC@" CACHE_NO_REPLACE FILEPATH) SET (CMAKE_C_COMPILER "@CC@" CACHE_NO_REPLACE FILEPATH)
SET (CMAKE_C_FLAGS "@CFLAGS@" CACHE_NO_REPLACE STRING) SET (CMAKE_C_FLAGS "@CFLAGS@" CACHE_NO_REPLACE )
SET (CMAKE_SHLIB_CFLAGS "@CMAKE_SHLIB_CFLAGS@" CACHE_NO_REPLACE STRING) SET (CMAKE_SHLIB_CFLAGS "@CMAKE_SHLIB_CFLAGS@" CACHE_NO_REPLACE )
SET (CMAKE_SHLIB_BUILD_FLAGS "@CMAKE_SHLIB_BUILD_FLAGS@" CACHE_NO_REPLACE STRING) SET (CMAKE_SHLIB_BUILD_FLAGS "@CMAKE_SHLIB_BUILD_FLAGS@" CACHE_NO_REPLACE )
SET (CMAKE_SHLIB_SUFFIX @CMAKE_SHLIB_SUFFIX@ CACHE_NO_REPLACE STRING) SET (CMAKE_SHLIB_SUFFIX @CMAKE_SHLIB_SUFFIX@ CACHE_NO_REPLACE )
SET (CMAKE_THREAD_LIBS "@CMAKE_THREAD_LIBS@" CACHE_NO_REPLACE STRING) SET (CMAKE_THREAD_LIBS "@CMAKE_THREAD_LIBS@" CACHE_NO_REPLACE )
SET (CMAKE_DL_LIBS "@CMAKE_DL_LIBS@" CACHE_NO_REPLACE STRING) SET (CMAKE_DL_LIBS "@CMAKE_DL_LIBS@" CACHE_NO_REPLACE )
SET (CMAKE_SHLIB_LINK_FLAGS "@CMAKE_SHLIB_LINK_FLAGS@" CACHE_NO_REPLACE STRING) SET (CMAKE_SHLIB_LINK_FLAGS "@CMAKE_SHLIB_LINK_FLAGS@" CACHE_NO_REPLACE )
SET (CMAKE_SHLIB_LD_LIBS "@CMAKE_SHLIB_LD_LIBS@" CACHE_NO_REPLACE STRING) SET (CMAKE_SHLIB_LD_LIBS "@CMAKE_SHLIB_LD_LIBS@" CACHE_NO_REPLACE )
SET (CMAKE_SHLIB_LD_LIBS "@CMAKE_SHLIB_LD_LIBS@" CACHE_NO_REPLACE_NO_REPLACE STRING) SET (CMAKE_SHLIB_LD_LIBS "@CMAKE_SHLIB_LD_LIBS@" CACHE_NO_REPLACE_NO_REPLACE )
# support for X11
SET (CMAKE_X_LIBS "@X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@" CACHE_NO_REPLACE )
SET (CMAKE_X_CFLAGS "@X_CFLAGS@" CACHE_NO_REPLACE)
SET (CMAKE_HAS_X "@CMAKE_HAS_X@" CACHE_NO_REPLACE)

View File

@ -267,7 +267,9 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
// if a variable expands to nothing. // if a variable expands to nothing.
if (lib->first.size() == 0) continue; if (lib->first.size() == 0) continue;
// if it is a full path break it into -L and -l // if it is a full path break it into -L and -l
if(lib->first.find('/') != std::string::npos) cmRegularExpression reg("(^[ \t]*\\-l)|(\\${)");
if(lib->first.find('/') != std::string::npos
&& !reg.find(lib->first))
{ {
std::string dir, file; std::string dir, file;
cmSystemTools::SplitProgramPath(lib->first.c_str(), cmSystemTools::SplitProgramPath(lib->first.c_str(),
@ -286,9 +288,7 @@ void cmUnixMakefileGenerator::OutputLinkLibraries(std::ostream& fout,
// not a full path, so add -l name // not a full path, so add -l name
else else
{ {
std::string::size_type pos = lib->first.find("-l"); if(!reg.find(lib->first))
if((pos == std::string::npos || pos > 0)
&& lib->first.find("${") == std::string::npos)
{ {
librariesLinked += "-l"; librariesLinked += "-l";
} }