]> source.dussan.org Git - rspamd.git/commitdiff
Fix lua tests copying.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 27 Feb 2015 16:12:43 +0000 (16:12 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 27 Feb 2015 16:12:43 +0000 (16:12 +0000)
test/CMakeLists.txt

index 32d5334cbfc3ef52db108aa4e978acf07c5d24ac..fb0f7c891ef5f830a77a4a6ba58af162b474ddfd 100644 (file)
@@ -22,18 +22,21 @@ TARGET_LINK_LIBRARIES(rspamd-test rspamd-server)
 TARGET_LINK_LIBRARIES(rspamd-test ${RSPAMD_REQUIRED_LIBRARIES})
 TARGET_LINK_LIBRARIES(rspamd-test stemmer)
 
-IF(NOT ${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR}) 
+IF(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
        FILE(COPY "${CMAKE_CURRENT_SOURCE_DIR}/lua"
                          DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
 
        # Also add dependencies for convenience
        FILE(GLOB LUA_TESTS "${CMAKE_CURRENT_SOURCE_DIR}/lua/*")
-       FOREACH(_LF IN LISTS "${LUA_TESTS}")
-               GET_FILENAME_COMPONENT(_NM _LF NAME)
-               ADD_CUSTOM_COMMAND(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_NM}"
-                       "${CMAKE_COMMAND} -E copy_if_different ${_LF} ${CMAKE_CURRENT_BINARY_DIR}/${_NM}"
+       FOREACH(_LF IN LISTS LUA_TESTS)
+               GET_FILENAME_COMPONENT(_NM "${_LF}" NAME)
+               SET(_DS "${CMAKE_CURRENT_BINARY_DIR}/lua/${_NM}")
+               MESSAGE(STATUS "${_LF} -> ${_DS}")
+               ADD_CUSTOM_TARGET("${_NM}" COMMAND
+                       ${CMAKE_COMMAND} -E copy_if_different ${_LF} ${_DS}
+                       SOURCES "${_LF}"
                )
-               ADD_DEPENDENCIES(rspamd-test "${CMAKE_CURRENT_BINARY_DIR}/${_NM}")
+               ADD_DEPENDENCIES(rspamd-test "${_NM}")
        ENDFOREACH()
        
 ENDIF()
\ No newline at end of file