ExternalProject and Visual studio solutions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ExternalProject and Visual studio solutions

ycollette.nospam
Hello,

I use cmake 3.8.2 with visual studio 2013 64 bits.
I wanted to compile a thirdparty library using ExternalProject

When I do this, I meet errors: cmake is trying to read the download timestamp in the wrong directory:

the thirdparty library id build in

${CMAKE_BINARY_DIR}/_dep/CoinMP-1.8.3/Debug

But in the directory, I also see a

${CMAKE_BINARY_DIR}/_dep/CoinMP-1.8.3/$(Configuration)

And cmake is looking at the download timestamp in the debug directory, but it's in the $(Configuration).


How can I manage correctly the value of CMAKE_CFG_INTDIR in an ExternalProject ?


I put here the part of code I use to compile this thirdparty lib:

# #################################################
# ===>    CoinMP
# #################################################

if (KL_ENABLE_DOWNLOAD_COINMP)
  set(COINMP_VERSION "1.8.3")
  set(COINMP_URL "http://www.coin-or.org/download/source/CoinMP/CoinMP-${COINMP_VERSION}.zip")

  set(COINMP_COMPILATION_OPTIONS " -fPIC -DCOIN_COMPILE_STATIC=${KL_COMPILE_STATIC}")
  set(COINMP_COMPILATION_OPTIONS "${COINMP_COMPILATION_OPTIONS} -DCOIN_COMPILE_COVERAGE=${KL_COMPILE_COVERAGE}")
  set(COINMP_COMPILATION_OPTIONS "${COINMP_COMPILATION_OPTIONS} -DCOIN_COMPILE_PROFILE=${KL_COMPILE_PROFILE}")
  set(COINMP_COMPILATION_OPTIONS "${COINMP_COMPILATION_OPTIONS} -DCOIN_COMPILE_PROFILE_VALGRIND=${KL_COMPILE_PROFILE_VALGRIND}")
  set(COINMP_COMPILATION_OPTIONS "${COINMP_COMPILATION_OPTIONS} -DCOIN_COMPILE_LTO=${KL_COMPILE_LTO}")
  set(COINMP_COMPILATION_OPTIONS "${COINMP_COMPILATION_OPTIONS} -DCOIN_COMPILE_WHOPR=${KL_COMPILE_WHOPR}")
  if (WIN32)
    set(COINMP_COMPILATION_OPTIONS "${COINMP_COMPILATION_OPTIONS} -DCOIN_ENABLE_DOWNLOAD_PTHREAD_WIN32=ON")
  endif ()
 
  set(COINMP_InstallDir "${EP_InstallDir}/CoinMP-${COINMP_VERSION}/${CMAKE_CFG_INTDIR}/")

  if (WIN32)
    ExternalProject_Add(EP_CoinMP
                        PREFIX            ${COINMP_InstallDir}
                        DEPENDS           ${COINMP_LAPACK_DEPENDS}
                        URL               ${COINMP_URL}
                        UPDATE_COMMAND    ""
                        PATCH_COMMAND     ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/deps/Coin/CoinMP/ ${COINMP_InstallDir}/src/EP_CoinMP/ &&
                                          ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/deps/Coin/CoinMP.h ${COINMP_InstallDir}/src/EP_CoinMP/CoinMP/src/ &&
                                          ${CMAKE_COMMAND} -E make_directory ${COINMP_InstallDir}/src/EP_CoinMP/build/
                        CONFIGURE_COMMAND ${CMAKE_COMMAND} -E chdir ${COINMP_InstallDir}/src/EP_CoinMP/build ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${EP_InstallDir}/install/ -DCOIN_HAS_ABC=${KL_USE_ABC} -DCOIN_ABC_LEVEL=${KL_ABC_LEVEL} ${COINMP_COMPILATION_OPTIONS} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} ${EP_COMPILER} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -G ${CMAKE_GENERATOR} ..
                        BUILD_COMMAND     ${CMAKE_COMMAND} -E chdir ${COINMP_InstallDir}/src/EP_CoinMP/build ${CMAKE_COMMAND} --build . --config ${CMAKE_CFG_INTDIR}
                        INSTALL_COMMAND   ${CMAKE_COMMAND} -E chdir ${COINMP_InstallDir}/src/EP_CoinMP/build ${CMAKE_COMMAND} --build . --config ${CMAKE_CFG_INTDIR} --target install
                       )
  else ()
    ExternalProject_Add(EP_CoinMP
                        PREFIX            ${COINMP_InstallDir}
                        DEPENDS           ${COINMP_LAPACK_DEPENDS}
                        URL               ${COINMP_URL}
                        UPDATE_COMMAND    ""
                        PATCH_COMMAND     ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/deps/Coin/CoinMP/ ${COINMP_InstallDir}/src/EP_CoinMP/ &&
                                          ${CMAKE_COMMAND} -E make_directory ${COINMP_InstallDir}/src/EP_CoinMP/build/
                        CONFIGURE_COMMAND ${CMAKE_COMMAND} -E chdir ${COINMP_InstallDir}/src/EP_CoinMP/build ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${EP_InstallDir}/install/ -DCOIN_HAS_ABC=${KL_USE_ABC} -DCOIN_ABC_LEVEL=${KL_ABC_LEVEL} ${COINMP_COMPILATION_OPTIONS} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} ${EP_COMPILER} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -G ${CMAKE_GENERATOR} ..
                        BUILD_COMMAND     ${CMAKE_COMMAND} -E chdir ${COINMP_InstallDir}/src/EP_CoinMP/build ${CMAKE_MAKE_PROGRAM}
                        INSTALL_COMMAND   ${CMAKE_COMMAND} -E chdir ${COINMP_InstallDir}/src/EP_CoinMP/build ${CMAKE_MAKE_PROGRAM} install
                       )
  endif ()
endif ()

# #################################################
# <===    CoinMP
# #################################################

Best regards,

YC
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake