Commit b9652dc6 authored by ESTERIE Pierre's avatar ESTERIE Pierre
Browse files

cmake refinments

parent 0095646c
......@@ -35,6 +35,7 @@ if(NOT CMAKE_BUILD_TYPE)
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
#
# Creating main lib
# -----------------
......@@ -110,12 +111,6 @@ message(STATUS "${CMAKE_PROJECT_NAME} dependencies : ${FUSE_LIST}")
# ----------------
include(cmake/analysis.cmake)
#
# Export Library
# --------------
include(cmake/export.cmake)
#
# Set FUSE LIST
# -------------
......@@ -161,4 +156,10 @@ if(${CMAKE_PROJECT_NAME}_BUILD_DOC)
add_subdirectory(docs)
endif()
#
# Export Library
# --------------
include(cmake/export.cmake)
......@@ -13,7 +13,7 @@ install(DIRECTORY ${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/include
DESTINATION ${CMAKE_INSTALL_PREFIX}
PATTERN "scalfmm-config.hpp.cmake" EXCLUDE)
install(DIRECTORY ${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/cmake/morse/
install(DIRECTORY ${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/modules/internal/morse_cmake/modules/
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/${CMAKE_PROJECT_NAME})
install(DIRECTORY ${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/modules/internal/inria_tools/
......
......@@ -2,5 +2,6 @@
# Morse
# -----
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/morse/)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/modules/internal/morse_cmake/modules/)
include(MorseInit)
......@@ -21,5 +21,5 @@ foreach(exec ${source_tests_files})
endforeach(exec)
add_custom_target(tools ALL DEPENDS ${${CMAKE_PROJECT_NAME}_TOOLS_TARGETS})
set(TOOLS_TO_INSTALL ${${CMAKE_PROJECT_NAME}_TOOLS_TARGETS} CACHE INTERNAL "TOOLS_TO_INSTALL")
set(TOOLS_TO_INSTALL ${${CMAKE_PROJECT_NAME}_TOOLS_TARGETS} CACHE INTERNAL "" FORCE)
......@@ -19,6 +19,7 @@ configure_file(fmm/units_fmm.hpp.in units_fmm.hpp @ONLY)
# Add execs - 1 cpp = 1 exec
foreach(exec ${source_tests_files})
set(compile_exec TRUE)
set(add_mpi_run FALSE)
get_filename_component( execname ${exec} NAME_WE )
foreach(fuse_key ${FUSE_DEP_AVAILABLE})
......@@ -32,6 +33,9 @@ foreach(exec ${source_tests_files})
list(APPEND COMPILE_DEFINITIONS_TO_ADD ${${fuse_key}_COMPILE_DEFINITIONS})
endif()
endif()
if(lines_fuse EQUAL "MPI")
set(add_mpi_run TRUE)
endif()
endforeach()
# Dependency are OK
......@@ -43,10 +47,10 @@ foreach(exec ${source_tests_files})
target_compile_definitions( unit.${execname} PRIVATE ${COMPILE_DEFINITIONS_TO_ADD})
target_include_directories(unit.${execname} PRIVATE ${CMAKE_SOURCE_DIR}/modules/external/catch2/ ${CMAKE_CURRENT_BINARY_DIR})
if(MPI_TARGET)
add_test(NAME unit.${execname} COMMAND $<IF:${MPIEXEC_EXECUTABLE}, ${MPIEXEC_EXECUTABLE} -np 4 ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/unit.${execname}>)
if(add_mpi_run)
add_test(NAME unit.${execname} COMMAND $<IF:${MPIEXEC_EXECUTABLE}, ${MPIEXEC_EXECUTABLE} -np 4 ${CMAKE_CURRENT_BINARY_DIR}/unit.${execname}>)
else()
add_test(NAME unit.${execname} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/unit.${execname})
add_test(NAME unit.${execname} COMMAND ${CMAKE_CURRENT_BINARY_DIR}/unit.${execname})
endif()
endif()
endforeach(exec)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment