Skip to content
Snippets Groups Projects
Commit f3759f20 authored by Henry Fredrick Schreiner's avatar Henry Fredrick Schreiner Committed by Lorenzo Moneta
Browse files

Using Minuit2_SOURCE_DIR, standalone and travis fixes

parent 916ddfff
No related branches found
No related tags found
No related merge requests found
......@@ -68,12 +68,11 @@ matrix:
apt:
sources: *sources
packages: ['clang-3.9', 'libstdc++-6-dev']
compiler: clang
compiler: clang
script:
- export CC=clang-3.9
- export CXX=clang++-3.9
- cd math/minuit2
- .ci/build_and_test.sh
- cd math/minuit2 && .ci/make_and_test.sh
allow_failures:
# clang-tidy-modernize is still experimental
......
# This is run by the CI system from the main Minuit2 directory
mkdir build
cd build
cmake .. -Dminuit2-standalone=OFF -DCMAKE_INSTALL_PREFIX=install
make -j2
make test
make install
make clean
cmake .. -Dminuit2-standalone=ON -DCMAKE_INSTALL_PREFIX=install
make -j2
make test
make purge
......@@ -62,21 +62,25 @@ function(COPY_STANDALONE)
if(NOT COPY_STANDALONE_FILES)
message(FATAL_ERROR "copy_standalone requires files to work on")
endif()
# Get and normalize path to new directory
set(NEW_DIR_FULL "${CMAKE_CURRENT_SOURCE_DIR}/${COPY_STANDALONE_DESTINATION}")
get_filename_component(NEW_DIR_FULL "${NEW_DIR_FULL}" ABSOLUTE)
# Keep track of all files listed
set(FILENAMES "")
# Loop over all filenames given
foreach(FILENAME ${COPY_STANDALONE_FILES})
if(minuit2-inroot)
# All paths are relative to master directory
set(ORIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${COPY_STANDALONE_SOURCE}/${FILENAME}")
set(NEW_DIR_FULL "${CMAKE_CURRENT_SOURCE_DIR}/${COPY_STANDALONE_DESTINATION}")
set(NEW_FILE "${NEW_DIR_FULL}/${FILENAME}")
# All paths are relative to master directory
set(ORIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${COPY_STANDALONE_SOURCE}/${FILENAME}")
set(NEW_FILE "${NEW_DIR_FULL}/${FILENAME}")
# Normalize paths
get_filename_component(ORIG_FILE "${ORIG_FILE}" ABSOLUTE)
get_filename_component(NEW_DIR_FULL "${NEW_DIR_FULL}" ABSOLUTE)
get_filename_component(NEW_FILE "${NEW_FILE}" ABSOLUTE)
# Normalize paths
get_filename_component(ORIG_FILE "${ORIG_FILE}" ABSOLUTE)
get_filename_component(NEW_FILE "${NEW_FILE}" ABSOLUTE)
if(minuit2-inroot)
# Error if file to copy is missing
if(NOT EXISTS "${ORIG_FILE}")
message(FATAL_ERROR "The file ${ORIG_FILE} does not exist and minuit2-inroot was set to ON")
......
......@@ -190,7 +190,7 @@ set(MINUIT2_SOURCES
mnxerbla.cxx
)
prepend_path(MINUIT2_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/../inc/Minuit2" ${MINUIT2_HEADERS})
prepend_path(MINUIT2_HEADERS "${Minuit2_SOURCE_DIR}/inc/Minuit2" ${MINUIT2_HEADERS})
prepend_path(MINUIT2_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}" ${MINUIT2_SOURCES})
add_library(Minuit2
......@@ -204,7 +204,7 @@ add_library(Minuit2::Minuit2 ALIAS Minuit2)
target_include_directories(
Minuit2
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../inc>
$<BUILD_INTERFACE:${Minuit2_SOURCE_DIR}/inc>
$<INSTALL_INTERFACE:include/Minuit2>
)
......
......@@ -23,13 +23,13 @@ set(MATH_SOURCES
MinimizerOptions.cxx
)
copy_standalone(SOURCE ../../../../math/mathcore/inc/Fit DESTINATION ../../inc/Fit
copy_standalone(SOURCE ../../../mathcore/inc/Fit DESTINATION ../../inc/Fit
OUTPUT FIT_HEADERS
FILES ${FIT_HEADERS})
copy_standalone(SOURCE ../../../../math/mathcore/inc/Math DESTINATION ../../inc/Math
copy_standalone(SOURCE ../../../mathcore/inc/Math DESTINATION ../../inc/Math
OUTPUT MATH_HEADERS
FILES ${MATH_HEADERS})
copy_standalone(SOURCE ../../../../math/mathcore/src DESTINATION .
copy_standalone(SOURCE ../../../mathcore/src DESTINATION .
OUTPUT MATH_SOURCES
FILES ${MATH_SOURCES})
......@@ -47,7 +47,7 @@ add_library(Minuit2::Math ALIAS Math)
target_include_directories(
Math
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../inc>
$<BUILD_INTERFACE:${Minuit2_SOURCE_DIR}/inc>
$<INSTALL_INTERFACE:include/Minuit2>
)
......@@ -56,7 +56,7 @@ if(minuit2-inroot AND NOT minuit2-standalone)
target_include_directories(
Math
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../../../math/mathcore/inc>
$<BUILD_INTERFACE:${Minuit2_SOURCE_DIR}/../mathcore/inc>
)
endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment