From 303048d3dce5044b14220af742bf3156b484a882 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 19 Feb 2007 13:26:38 -0500 Subject: ENH: add test for conv libraries --- Source/CMakeLists.txt | 10 ++++++++++ Tests/ConvLibrary/CMakeLists.txt | 38 +++++++++++++++++++------------------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index a41add3..a754b0e 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -697,6 +697,16 @@ IF(BUILD_TESTING) -DCMAKE_TEST_SYSTEM_LIBRARIES:BOOL=${CMAKE_TEST_SYSTEM_LIBRARIES} --test-command complex) + ADD_TEST(ConvLibrary ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/ConvLibrary" + "${CMake_BINARY_DIR}/Tests/ConvLibrary/Step4" + --build-two-config + --build-generator ${CMAKE_TEST_GENERATOR} + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-project ConvLibrary + --test-command bartest) + # ADD_TEST(complexRelativePaths ${CMAKE_CTEST_COMMAND} # --build-and-test # "${CMake_SOURCE_DIR}/Tests/ComplexRelativePaths" diff --git a/Tests/ConvLibrary/CMakeLists.txt b/Tests/ConvLibrary/CMakeLists.txt index 0f4eede..bf1ab83 100644 --- a/Tests/ConvLibrary/CMakeLists.txt +++ b/Tests/ConvLibrary/CMakeLists.txt @@ -1,19 +1,19 @@ -project(foo) - -# create a source list -set(foo_sources foo.cxx bar.c sub1/car.cxx) -# create a library foo from the sources -add_library(foo ${foo_sources}) -# get the object files from the target -get_target_property(OBJECT_FILES foo OBJECT_FILES) -message("${OBJECT_FILES}") -# set the object files as generated -set_source_files_properties(${OBJECT_FILES} PROPERTIES GENERATED true) -# create a library bar that contains the object files from foo -add_library(bar ${OBJECT_FILES}) -# set the linker language since bar only has .obj -set_target_properties(bar PROPERTIES LINKER_LANGUAGE CXX) -# make sure foo is built before bar -add_dependencies(bar foo) -add_executable(bartest bartest.cxx) -target_link_libraries(bartest bar) +project(ConvLibrary) + +# create a source list +set(foo_sources foo.cxx bar.c sub1/car.cxx) +# create a library foo from the sources +add_library(foo ${foo_sources}) +# get the object files from the target +get_target_property(OBJECT_FILES foo OBJECT_FILES) +message("${OBJECT_FILES}") +# set the object files as generated +set_source_files_properties(${OBJECT_FILES} PROPERTIES GENERATED true) +# create a library bar that contains the object files from foo +add_library(bar ${OBJECT_FILES}) +# set the linker language since bar only has .obj +set_target_properties(bar PROPERTIES LINKER_LANGUAGE CXX) +# make sure foo is built before bar +add_dependencies(bar foo) +add_executable(bartest bartest.cxx) +target_link_libraries(bartest bar) -- cgit v0.12