diff options
-rw-r--r-- | Source/cmUnixMakefileGenerator.cxx | 12 | ||||
-rw-r--r-- | Templates/CXXCMakeSystemConfig.cmake.in | 12 | ||||
-rwxr-xr-x | Templates/cxxconfigure | 16 | ||||
-rw-r--r-- | Templates/cxxconfigure.in | 16 |
4 files changed, 33 insertions, 23 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index f427bdf..789789b 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -692,7 +692,15 @@ void cmUnixMakefileGenerator::OutputStaticLibraryRule(std::ostream& fout, target = this->ConvertToOutputPath(target.c_str()); std::string depend = "$("; depend += this->CreateMakeVariable(name, "_SRC_OBJS") + ")"; - std::string command = "$(CMAKE_AR) $(CMAKE_AR_ARGS) "; + std::string command; + if(t.HasCxx()) + { + command = "$(CMAKE_CXX_AR) $(CMAKE_CXX_AR_ARGS) "; + } + else + { + command = "$(CMAKE_AR) $(CMAKE_AR_ARGS) "; + } command += target; command += " $("; command += this->CreateMakeVariable(name, "_SRC_OBJS") + ")"; @@ -1499,6 +1507,8 @@ void cmUnixMakefileGenerator::OutputMakeVariables(std::ostream& fout) "CMAKE_RANLIB = @CMAKE_RANLIB@\n" "CMAKE_AR = @CMAKE_AR@\n" "CMAKE_AR_ARGS = @CMAKE_AR_ARGS@\n" + "CMAKE_CXX_AR = @CMAKE_CXX_AR@\n" + "CMAKE_CXX_AR_ARGS = @CMAKE_CXX_AR_ARGS@\n" "CMAKE_C_COMPILER = @CMAKE_C_COMPILER@\n" "CMAKE_C_FLAGS = @CMAKE_C_FLAGS@\n" "CMAKE_SHLIB_CFLAGS = @CMAKE_SHLIB_CFLAGS@\n" diff --git a/Templates/CXXCMakeSystemConfig.cmake.in b/Templates/CXXCMakeSystemConfig.cmake.in index 2c8056d..5b867fb 100644 --- a/Templates/CXXCMakeSystemConfig.cmake.in +++ b/Templates/CXXCMakeSystemConfig.cmake.in @@ -2,11 +2,11 @@ # CMakeLocal.make.in should be in the directory where you run configure # in, which need not be the source directory # -SET (CMAKE_AR "@CMAKE_AR@" CACHE FILEPATH - "Archive program used to make archive libraries.") +SET (CMAKE_CXX_AR "@CMAKE_CXX_AR@" CACHE FILEPATH + "Archive program used to make archive libraries of c++ object files.") -SET (CMAKE_AR_ARGS "@CMAKE_AR_ARGS@" CACHE STRING - "Arguments for CMAKE_AR program to create an archive library.") +SET (CMAKE_CXX_AR_ARGS "@CMAKE_CXX_AR_ARGS@" CACHE STRING + "Arguments for CMAKE_CXX_AR program to create an archive library.") SET (CMAKE_CXX_COMPILER "@CXX@" CACHE FILEPATH "Name of C++ compiler used.") @@ -39,8 +39,8 @@ SET (CMAKE_NO_EXPLICIT_TEMPLATE_INSTANTIATION @CMAKE_NO_EXPLICIT_TEMPLATE_ MARK_AS_ADVANCED( CMAKE_CXX_COMPILER -CMAKE_AR -CMAKE_AR_ARGS +CMAKE_CXX_AR +CMAKE_CXX_AR_ARGS CMAKE_TEMPLATE_FLAGS CMAKE_NO_ANSI_STREAM_HEADERS CMAKE_NO_ANSI_FOR_SCOPE diff --git a/Templates/cxxconfigure b/Templates/cxxconfigure index b56135c..06e707d 100755 --- a/Templates/cxxconfigure +++ b/Templates/cxxconfigure @@ -855,8 +855,8 @@ fi test -n "$CMAKE_AR_TMP" && break done -CMAKE_AR="$CMAKE_AR_TMP" -CMAKE_AR_ARGS="cr" +CMAKE_CXX_AR="$CMAKE_AR_TMP" +CMAKE_CXX_AR_ARGS="cr" # if on SunOS and not using gXX then use the compiler to make .a libs case $system in SunOS-5*) @@ -864,8 +864,8 @@ case $system in : else echo "Using $CXX -xar -o for creating .a libraries" - CMAKE_AR="$CXX" - CMAKE_AR_ARGS="-xar -o" + CMAKE_CXX_AR="$CXX" + CMAKE_CXX_AR_ARGS="-xar -o" fi ;; IRIX*) @@ -873,8 +873,8 @@ case $system in : else echo "Using $CXX -xar -o for creating .a libraries" - CMAKE_AR="$CXX" - CMAKE_AR_ARGS="-ar -o" + CMAKE_CXX_AR="$CXX" + CMAKE_CXX_AR_ARGS="-ar -o" fi ;; esac @@ -1042,8 +1042,8 @@ s%@CMAKE_NO_ANSI_STREAM_HEADERS@%$CMAKE_NO_ANSI_STREAM_HEADERS%g s%@CMAKE_NO_STD_NAMESPACE@%$CMAKE_NO_STD_NAMESPACE%g s%@CMAKE_NO_ANSI_FOR_SCOPE@%$CMAKE_NO_ANSI_FOR_SCOPE%g s%@CMAKE_AR_TMP@%$CMAKE_AR_TMP%g -s%@CMAKE_AR@%$CMAKE_AR%g -s%@CMAKE_AR_ARGS@%$CMAKE_AR_ARGS%g +s%@CMAKE_CXX_AR@%$CMAKE_CXX_AR%g +s%@CMAKE_CXX_AR_ARGS@%$CMAKE_CXX_AR_ARGS%g s%@CMAKE_COMPILER_IS_GNUCXX@%$CMAKE_COMPILER_IS_GNUCXX%g CEOF diff --git a/Templates/cxxconfigure.in b/Templates/cxxconfigure.in index d1a891e..b591237 100644 --- a/Templates/cxxconfigure.in +++ b/Templates/cxxconfigure.in @@ -149,8 +149,8 @@ AC_SUBST(CMAKE_NO_ANSI_FOR_SCOPE) # find make to use to build cmake, prefer gmake AC_PATH_PROGS(CMAKE_AR_TMP, ar) -CMAKE_AR="$CMAKE_AR_TMP" -CMAKE_AR_ARGS="cr" +CMAKE_CXX_AR="$CMAKE_AR_TMP" +CMAKE_CXX_AR_ARGS="cr" # if on SunOS and not using gXX then use the compiler to make .a libs case $system in SunOS-5*) @@ -158,8 +158,8 @@ case $system in : else echo "Using $CXX -xar -o for creating .a libraries" - CMAKE_AR="$CXX" - CMAKE_AR_ARGS="-xar -o" + CMAKE_CXX_AR="$CXX" + CMAKE_CXX_AR_ARGS="-xar -o" fi ;; IRIX*) @@ -167,13 +167,13 @@ case $system in : else echo "Using $CXX -xar -o for creating .a libraries" - CMAKE_AR="$CXX" - CMAKE_AR_ARGS="-ar -o" + CMAKE_CXX_AR="$CXX" + CMAKE_CXX_AR_ARGS="-ar -o" fi ;; esac -AC_SUBST(CMAKE_AR) -AC_SUBST(CMAKE_AR_ARGS) +AC_SUBST(CMAKE_CXX_AR) +AC_SUBST(CMAKE_CXX_AR_ARGS) CMAKE_COMPILER_IS_GNUGXX=0 if test $ac_cv_prog_gxx = yes; then |