diff options
author | Brad King <brad.king@kitware.com> | 2006-07-21 15:53:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-07-21 15:53:23 (GMT) |
commit | d56e6a9241df2244732e23b7dd88b94e8bef3a33 (patch) | |
tree | 49f66984758a8b3f50dac488326008f7cc8f0136 | |
parent | 673e3f8964f124d65731a93fb5fdc8d6fa760ec4 (diff) | |
download | CMake-d56e6a9241df2244732e23b7dd88b94e8bef3a33.zip CMake-d56e6a9241df2244732e23b7dd88b94e8bef3a33.tar.gz CMake-d56e6a9241df2244732e23b7dd88b94e8bef3a33.tar.bz2 |
BUG: Fixed building of C++-only projects and added a test.
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 10 | ||||
-rw-r--r-- | Source/CMakeLists.txt | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 35197eb..e24aaa9 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -42,6 +42,16 @@ IF(NOT CMAKE_CXX_COMPILER) ENDIF(NOT CMAKE_CXX_COMPILER) MARK_AS_ADVANCED(CMAKE_CXX_COMPILER) +GET_FILENAME_COMPONENT(COMPILER_LOCATION "${CMAKE_CXX_COMPILER}" PATH) + +FIND_PROGRAM(CMAKE_AR NAMES ar PATHS ${COMPILER_LOCATION}) + +FIND_PROGRAM(CMAKE_RANLIB NAMES ranlib) +IF(NOT CMAKE_RANLIB) + SET(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib") +ENDIF(NOT CMAKE_RANLIB) +MARK_AS_ADVANCED(CMAKE_RANLIB) + # do not test for GNU if the generator is visual studio IF(${CMAKE_GENERATOR} MATCHES "Visual Studio") SET(CMAKE_COMPILER_IS_GNUCXX_RUN 1) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index ff49466..271f5f9 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -504,6 +504,16 @@ IF(BUILD_TESTING) --build-two-config --test-command conly) + ADD_TEST(CxxOnly ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/CxxOnly" + "${CMake_BINARY_DIR}/Tests/CxxOnly" + --build-generator ${CMAKE_TEST_GENERATOR} + --build-project cxxonly + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-two-config + --test-command cxxonly) + ADD_TEST(MacroTest ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/MacroTest" |