KWSys: Build tests after libraries

The TestSharedForward executable and TestDynload module do not actually
link to a KWSys library, but it is nice to build them after the
libraries just like all other test binaries.

This also works around a universal binary bug in Xcode 2.x.  It forgets
to create the output directory for the executable before linking it.  We
avoid the problem by putting the library in the directory first.
This commit is contained in:
Brad King 2009-12-15 14:15:27 -05:00
parent 1ac1058272
commit 357096d35a
1 changed files with 2 additions and 0 deletions

View File

@ -1020,6 +1020,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
# If kwsys contains the DynamicLoader, need extra library
ADD_LIBRARY(${KWSYS_NAMESPACE}TestDynload MODULE testDynload.c)
KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestDynload PROPERTY LABELS ${KWSYS_LABELS_LIB})
ADD_DEPENDENCIES(${KWSYS_NAMESPACE}TestDynload ${KWSYS_NAMESPACE})
ENDIF(KWSYS_USE_DynamicLoader)
CREATE_TEST_SOURCELIST(
KWSYS_CXX_TEST_SRCS ${KWSYS_NAMESPACE}TestsCxx.cxx
@ -1099,6 +1100,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestSharedForward
${PROJECT_BINARY_DIR}/testSharedForward.c)
KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestSharedForward PROPERTY LABELS ${KWSYS_LABELS_EXE})
ADD_DEPENDENCIES(${KWSYS_NAMESPACE}TestSharedForward ${KWSYS_NAMESPACE}_c)
ADD_TEST(kwsys.testSharedForward ${EXEC_DIR}/${KWSYS_NAMESPACE}TestSharedForward 1)
KWSYS_SET_PROPERTY(TEST kwsys.testSharedForward PROPERTY LABELS ${KWSYS_LABELS_TEST})