use a custom target for python extension
authorDiane Trout <diane@caltech.edu>
Wed, 12 Apr 2006 23:24:24 +0000 (23:24 +0000)
committerDiane Trout <diane@caltech.edu>
Wed, 12 Apr 2006 23:24:24 +0000 (23:24 +0000)
the custom command to make the properly names python extension sometimes
failes, so lets see if a custom target (which has better dependency checking)
works

py/CMakeLists.txt

index c890cfa868c9f6e402aad74dd73fea0a0b1f312f..2c45fa8ad9beff2c322be9a23a5d04774658ec0c 100644 (file)
@@ -17,8 +17,9 @@ FIND_PACKAGE(PythonInterp)
   #SET_SOURCE_FILES_PROPERTIES(${SOURCES} COM
 
   ADD_LIBRARY(mussa MODULE ${SOURCES})
-  ADD_CUSTOM_COMMAND(TARGET mussa 
-                     COMMAND cp libmussa.so mussa.so)
+  ADD_CUSTOM_TARGET(mussa.so ALL
+                     COMMAND cp libmussa.so mussa.so
+                     DEPENDS mussa)
   LINK_DIRECTORIES(${MUSSA_BINARY_DIR}/alg)
   TARGET_LINK_LIBRARIES(mussa 
                           mussa_core