changeset 71:6ebe7043702c

fix generated source at usr commands
author anatofuz
date Wed, 31 Jul 2019 18:50:53 +0900
parents 1e1c6feb7d83
children 4051ad3e0958
files src/usr/CMakeLists.txt
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/usr/CMakeLists.txt	Tue Jul 30 18:00:52 2019 +0900
+++ b/src/usr/CMakeLists.txt	Wed Jul 31 18:50:53 2019 +0900
@@ -43,16 +43,17 @@
             list(APPEND _Gears_CBC_SOURCES ${j})
         else()
             set(j ${i})
+            file(COPY "${CMAKE_SOURCE_DIR}/context.h" DESTINATION "${CMAKE_BINARY_DIR}/usr/${_Gears_TARGET}.dir")
             list(APPEND _Gears_CSOURCES ${j})
         endif()
     endforeach(i)
 
     add_custom_command (
-          OUTPUT    c/${_Gears_TARGET}-context.c
+          OUTPUT    ${_Gears_TARGET}.dir/c/${_Gears_TARGET}-context.c
           DEPENDS   ${_Gears_CBC_SOURCES}
-          COMMAND  "perl" "${CMAKE_SOURCE_DIR}/gearsTools/generate_context.pl" "-o" ${_Gears_TARGET} ${_Gears_CBC_SOURCES}
+          COMMAND  "cd" "${_Gears_TARGET}.dir" ";" "perl" "${CMAKE_SOURCE_DIR}/gearsTools/generate_context.pl" "-o" ${_Gears_TARGET} ${CMAKE_SOURCE_DIR}/usr/${_Gears_CSOURCES}
     )
-    add_executable(${_Gears_TARGET} ${_Gears_CBC_SOURCES} ${_Gears_CSOURCES} c/${_Gears_TARGET}-context.c )
+    add_executable(${_Gears_TARGET} ${_Gears_CBC_SOURCES} ${_Gears_CSOURCES} ${_Gears_TARGET}.dir/c/${_Gears_TARGET}-context.c )
     target_link_libraries(${_Gears_TARGET} ulib)
 endmacro()