[CMake] simple program, os x library archive error, linux no issues

Arne Pagel arne at pagelnet.de
Wed Nov 20 12:11:06 EST 2013


OK, thanks.

But somehow complicated. I wonder If I couldn't (miss)use the UPDATE_COMMAND for this.
Can I use a macro as UPDATE_COMMAND?

My CMakeLists.txt looks like that right now:


include(ExternalProject)

SET(subprojects  "core0" "core1" "core2")

foreach(MYPROJ ${subprojects})

  ExternalProject_Add(
    ${MYPROJ}
    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${MYPROJ}
    CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/MyToolChain.cmake
    UPDATE_COMMAND ""
    INSTALL_COMMAND ""
    )

  ExternalProject_Add_Step(${MYPROJ} rescan
    COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_SOURCE_DIR}/${MYPROJ}/CMakeLists.txt
    DEPENDEES forcebuild
    DEPENDERS build
    ALWAYS 1
    )

  ExternalProject_Add_Step(${MYPROJ} forcebuild
    COMMAND ${CMAKE_COMMAND} -E remove
    ${CMAKE_CURRENT_BUILD_DIR}/${MYPROJ}-prefix/src/${MYPROJ}-stamp/${MYPROJ}-build
    DEPENDEES configure
    DEPENDERS rescan
    ALWAYS 1
    )

endforeach(MYPROJ)


I tried to play a little bit around with the prefix dir to make this a little bit more sens full,
but not a real success so far. Any better Idea?

Next I need to link the Outputs of the three cores together.
Can I somehow automatically get the targets from each subproject?

I also like to improve the "touch" thing for my globbing procedure, but maybe I will discuss this
separately in an other thread.

thanks
  Arne


More information about the CMake mailing list