From a3f30b5d8fb8a596feb5f295d88a0915b9d27c37 Mon Sep 17 00:00:00 2001 From: LAVAUX Guilhem Date: Fri, 3 Apr 2020 19:17:27 +0200 Subject: [PATCH] Fixes to support ninja --- external/external_build.cmake | 17 +++++++++-------- src/CMakeLists.txt | 2 ++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/external/external_build.cmake b/external/external_build.cmake index c8fedcf..53037ed 100644 --- a/external/external_build.cmake +++ b/external/external_build.cmake @@ -56,19 +56,19 @@ if (ENABLE_SHARP) IF(NOT ENABLE_OPENMP) SET(SHARP_OPENMP --disable-openmp) ENDIF() - ExternalProject_Add(sharp - URL ${CMAKE_SOURCE_DIR}/external/libsharp-6077806.tar.gz - PREFIX ${BUILD_PREFIX}/sharp-prefix - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND autoconf && ./configure "CC=${CMAKE_C_COMPILER}" "CXX=${CMAKE_CXX_COMPILER}" --prefix=${DEP_BUILD} ${SHARP_OPENMP} - BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} - INSTALL_COMMAND echo "No install" - ) SET(CUTILS_LIBRARY ${DEP_BUILD}/lib/libc_utils.a) SET(FFTPACK_LIBRARY ${DEP_BUILD}/lib/libfftpack.a) SET(SHARP_LIBRARY ${DEP_BUILD}/lib/libsharp.a) SET(SHARP_LIBRARIES ${SHARP_LIBRARY} ${FFTPACK_LIBRARY} ${CUTILS_LIBRARY}) SET(SHARP_INCLUDE_PATH ${DEP_BUILD}/include) + ExternalProject_Add(sharp + URL ${CMAKE_SOURCE_DIR}/external/libsharp-6077806.tar.gz + PREFIX ${BUILD_PREFIX}/sharp-prefix + BUILD_IN_SOURCE 1 + CONFIGURE_COMMAND autoconf && ./configure "CC=${CMAKE_C_COMPILER}" "CXX=${CMAKE_CXX_COMPILER}" --prefix=${DEP_BUILD} ${SHARP_OPENMP} + INSTALL_COMMAND echo "No install" + BUILD_BYPRODUCTS ${SHARP_LIBRARIES} + ) endif (ENABLE_SHARP) @@ -375,6 +375,7 @@ ExternalProject_Add(omptl BUILD_COMMAND echo "No build" PATCH_COMMAND patch -p1 -t -N < ${CMAKE_SOURCE_DIR}/external/patch-omptl INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${OMPTL_BUILD_DIR} ${EXT_INSTALL}/include/omptl + BUILD_BYPRODUCTS ${EXT_INSTALL}/include/omptl ) include_directories(${EXT_INSTALL}/include) ##include_directories(${OMPTL_BUILD_DIR}/src/) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a4c81e8..2cc4b29 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -92,11 +92,13 @@ if (BUILD_SHARED_LIBS) add_library(CosmoTool_static STATIC ${CosmoTool_SRCS} $) target_link_libraries(CosmoTool_static) set_property(TARGET CosmoTool_static PROPERTY POSITION_INDEPENDENT_CODE ON) + add_dependencies(CosmoTool_static ${cosmotool_DEPS}) endif(BUILD_STATIC_LIBS) else (BUILD_SHARED_LIBS) add_library(CosmoTool STATIC ${CosmoTool_SRCS} $) target_link_libraries(CosmoTool) set_property(TARGET CosmoTool PROPERTY POSITION_INDEPENDENT_CODE ON) + add_dependencies(CosmoTool ${cosmotool_DEPS}) endif (BUILD_SHARED_LIBS) IF(NOT COSMOTOOL_PYTHON_PACKAGING)