From 17676c6a6c5ddb43f52d245128ad3254010e9163 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 10 Apr 2018 13:22:01 +0000 Subject: [PATCH 01/17] PYTHON_DEST was always overwritten --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cefc36361..1cb77713b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,7 +75,10 @@ find_package(PythonInterp) find_package(PythonLibs) set (BUILD_PYTHON ${PYTHONLIBS_FOUND}) if (BUILD_PYTHON) - set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") + if (NOT ${PYTHON_DEST}) + set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") + endif() + message(STATUS "PYTHON_DEST ${PYTHON_DEST}") message(STATUS "Python libraries found") endif() From 1ec22f654e8c6e7ce56dfe1df77d4c315d865a61 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Wed, 11 Apr 2018 09:18:02 +0000 Subject: [PATCH 02/17] debug message --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cb77713b..7b91e4f3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,7 @@ find_package(PythonInterp) find_package(PythonLibs) set (BUILD_PYTHON ${PYTHONLIBS_FOUND}) if (BUILD_PYTHON) + message(STATUS "PYTHON_DEST ${PYTHON_DEST}") if (NOT ${PYTHON_DEST}) set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") endif() From ed63cb94cb72bc0720ef61f902e875219b04d2ea Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Wed, 11 Apr 2018 09:27:37 +0000 Subject: [PATCH 03/17] if NOT does not apply to variables --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b91e4f3b..2533a7bd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,7 +76,9 @@ find_package(PythonLibs) set (BUILD_PYTHON ${PYTHONLIBS_FOUND}) if (BUILD_PYTHON) message(STATUS "PYTHON_DEST ${PYTHON_DEST}") - if (NOT ${PYTHON_DEST}) + if (${PYTHON_DEST}) + message("SIRF CMAKELISTS PYTHON_DEST IS SET") + else() set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") endif() message(STATUS "PYTHON_DEST ${PYTHON_DEST}") From a4f7bd8676bb9c08dd6ba66a55e4ccbddce3bf5f Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Wed, 11 Apr 2018 09:45:04 +0000 Subject: [PATCH 04/17] CMake if does not want dereferencing --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2533a7bd0..8330293d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,7 +76,7 @@ find_package(PythonLibs) set (BUILD_PYTHON ${PYTHONLIBS_FOUND}) if (BUILD_PYTHON) message(STATUS "PYTHON_DEST ${PYTHON_DEST}") - if (${PYTHON_DEST}) + if (PYTHON_DEST) message("SIRF CMAKELISTS PYTHON_DEST IS SET") else() set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") From 403c7a81741ce4c5f8f358f7e0a5187597c89219 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Wed, 11 Apr 2018 10:48:07 +0000 Subject: [PATCH 05/17] removed messages --- CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8330293d9..a62c80ebc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,13 +75,10 @@ find_package(PythonInterp) find_package(PythonLibs) set (BUILD_PYTHON ${PYTHONLIBS_FOUND}) if (BUILD_PYTHON) - message(STATUS "PYTHON_DEST ${PYTHON_DEST}") if (PYTHON_DEST) - message("SIRF CMAKELISTS PYTHON_DEST IS SET") else() set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") endif() - message(STATUS "PYTHON_DEST ${PYTHON_DEST}") message(STATUS "Python libraries found") endif() From e463b9f7d306acc0d40d63e783ca41406c293ccf Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 17 Apr 2018 13:45:33 +0000 Subject: [PATCH 06/17] added message --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a62c80ebc..78ac2aa69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,7 @@ if (BUILD_PYTHON) set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") endif() message(STATUS "Python libraries found") + message(STATUS "Location of Python modules: " ${PYTHON_DEST}) endif() From 396bba71bc46f709fd65f1ce1c83c75cc5673e9a Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 17 Apr 2018 13:46:52 +0000 Subject: [PATCH 07/17] use if(NOT PYTHON_DEST) --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78ac2aa69..68cb2a730 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,8 +75,7 @@ find_package(PythonInterp) find_package(PythonLibs) set (BUILD_PYTHON ${PYTHONLIBS_FOUND}) if (BUILD_PYTHON) - if (PYTHON_DEST) - else() + if (NOT PYTHON_DEST) set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") endif() message(STATUS "Python libraries found") From ea68ad06b6deef96e9cb7aa43b03ce4f0d26b179 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Fri, 27 Apr 2018 15:27:18 +0000 Subject: [PATCH 08/17] added PYTHON_DEST_DIR and MATLAB_DEST_DIR cached vars https://github.com/CCPPETMR/SIRF/pull/160#issuecomment-381893762 https://github.com/CCPPETMR/SIRF/pull/160#issuecomment-384928229 --- CMakeLists.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68cb2a730..1d3e61d2e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,9 +75,11 @@ find_package(PythonInterp) find_package(PythonLibs) set (BUILD_PYTHON ${PYTHONLIBS_FOUND}) if (BUILD_PYTHON) - if (NOT PYTHON_DEST) + set(PYTHON_INSTALL_DIR "" CACHE "Directory of the SIRF Python modules") + if (PYTHON_INSTALL_DIR) + set(PYTHON_DEST "${PYTHON_INSTALL_DIR }") + else() set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") - endif() message(STATUS "Python libraries found") message(STATUS "Location of Python modules: " ${PYTHON_DEST}) endif() @@ -86,10 +88,16 @@ endif() message(STATUS "Attempting to find MATLAB (This might launch MATLAB so might take a while)") FIND_PACKAGE(Matlab COMPONENTS MAIN_PROGRAM) set (BUILD_MATLAB ${Matlab_FOUND}) + if (BUILD_MATLAB) matlab_get_mex_suffix("${Matlab_ROOT_DIR}" MATLAB_MEX_EXT) - set(MATLAB_DEST "${CMAKE_INSTALL_PREFIX}/matlab") - message(STATUS "MATLAB libraries found") + set(MATLAB_INSTALL_DIR "" CACHE "Directory of the SIRF Matlab libraries") + if (MATLAB_INSTALL_DIR) + set(MATLAB_DEST "${MATLAB_INSTALL_DIR }") + else() + set(MATLAB_DEST "${CMAKE_INSTALL_PREFIX}/matlab") + message(STATUS "Matlab libraries found") + message(STATUS "Location of Matlab libraries: " ${MATLAB_DEST}) endif() if (NOT BUILD_MATLAB AND NOT BUILD_PYTHON) From 0ed3bb6570f329bc88bc058f7ff1539b86f0baba Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Mon, 30 Apr 2018 18:46:06 +0100 Subject: [PATCH 09/17] make with one thread to see what goes wrong with travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 51b5baa15..cf0511add 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ env: global: - BUILD_FLAGS="-DCMAKE_BUILD_TYPE=Release" # don't use too many threads - may crash - - MAKEFLAGS="-j 2" + - MAKEFLAGS="-j 1" # Ubuntu 14.04 LTS dist: trusty From ef26a0cc75398cee244f28df627952383044948a Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 1 May 2018 05:27:46 +0000 Subject: [PATCH 10/17] closed if --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d3e61d2e..2b8f2b0fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,7 @@ if (BUILD_PYTHON) set(PYTHON_DEST "${PYTHON_INSTALL_DIR }") else() set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") + endif() message(STATUS "Python libraries found") message(STATUS "Location of Python modules: " ${PYTHON_DEST}) endif() From a0f4a5b773f7ac0aacb7036503aab302156b618c Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 1 May 2018 05:50:03 +0000 Subject: [PATCH 11/17] closed if for MATLAB_DEST --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b8f2b0fd..b54070121 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,7 @@ if (BUILD_MATLAB) set(MATLAB_DEST "${MATLAB_INSTALL_DIR }") else() set(MATLAB_DEST "${CMAKE_INSTALL_PREFIX}/matlab") + endif() message(STATUS "Matlab libraries found") message(STATUS "Location of Matlab libraries: " ${MATLAB_DEST}) endif() From 77b01afb4d5560b3bc0b737509ee1744352738a5 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 1 May 2018 05:58:41 +0000 Subject: [PATCH 12/17] fix cache variable set --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b54070121..5d47dff62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,7 +75,7 @@ find_package(PythonInterp) find_package(PythonLibs) set (BUILD_PYTHON ${PYTHONLIBS_FOUND}) if (BUILD_PYTHON) - set(PYTHON_INSTALL_DIR "" CACHE "Directory of the SIRF Python modules") + set(PYTHON_INSTALL_DIR "" CACHE PATH "Directory of the SIRF Python modules") if (PYTHON_INSTALL_DIR) set(PYTHON_DEST "${PYTHON_INSTALL_DIR }") else() @@ -92,7 +92,7 @@ set (BUILD_MATLAB ${Matlab_FOUND}) if (BUILD_MATLAB) matlab_get_mex_suffix("${Matlab_ROOT_DIR}" MATLAB_MEX_EXT) - set(MATLAB_INSTALL_DIR "" CACHE "Directory of the SIRF Matlab libraries") + set(MATLAB_INSTALL_DIR "" CACHE PATH "Directory of the SIRF Matlab libraries") if (MATLAB_INSTALL_DIR) set(MATLAB_DEST "${MATLAB_INSTALL_DIR }") else() From 3061ddc92c1968fe7496c6e076cfc0988e6ad2b4 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Thu, 3 May 2018 09:01:06 +0000 Subject: [PATCH 13/17] change PYTHON_INSTALL_DIR to PYTHON_DEST_DIR https://github.com/CCPPETMR/SIRF/pull/160#issuecomment-384928229 some clearer message to user build with 2 threads. --- .travis.yml | 2 +- CMakeLists.txt | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index cf0511add..51b5baa15 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,7 +63,7 @@ env: global: - BUILD_FLAGS="-DCMAKE_BUILD_TYPE=Release" # don't use too many threads - may crash - - MAKEFLAGS="-j 1" + - MAKEFLAGS="-j 2" # Ubuntu 14.04 LTS dist: trusty diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d47dff62..445d68b55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,14 +75,14 @@ find_package(PythonInterp) find_package(PythonLibs) set (BUILD_PYTHON ${PYTHONLIBS_FOUND}) if (BUILD_PYTHON) - set(PYTHON_INSTALL_DIR "" CACHE PATH "Directory of the SIRF Python modules") - if (PYTHON_INSTALL_DIR) - set(PYTHON_DEST "${PYTHON_INSTALL_DIR }") + set(PYTHON_DEST_DIR "" CACHE PATH "Directory of the SIRF Python modules") + if (PYTHON_DEST_DIR) + set(PYTHON_DEST "${PYTHON_DEST_DIR }") else() set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") endif() message(STATUS "Python libraries found") - message(STATUS "Location of Python modules: " ${PYTHON_DEST}) + message(STATUS "SIRF Python modules will be installed in " ${PYTHON_DEST}) endif() @@ -92,14 +92,14 @@ set (BUILD_MATLAB ${Matlab_FOUND}) if (BUILD_MATLAB) matlab_get_mex_suffix("${Matlab_ROOT_DIR}" MATLAB_MEX_EXT) - set(MATLAB_INSTALL_DIR "" CACHE PATH "Directory of the SIRF Matlab libraries") - if (MATLAB_INSTALL_DIR) - set(MATLAB_DEST "${MATLAB_INSTALL_DIR }") + set(MATLAB_DEST_DIR "" CACHE PATH "Directory of the SIRF Matlab libraries") + if (MATLAB_DEST_DIR) + set(MATLAB_DEST "${MATLAB_DEST_DIR }") else() set(MATLAB_DEST "${CMAKE_INSTALL_PREFIX}/matlab") endif() message(STATUS "Matlab libraries found") - message(STATUS "Location of Matlab libraries: " ${MATLAB_DEST}) + message(STATUS "SIRF Matlab libraries will be installed in " ${MATLAB_DEST}) endif() if (NOT BUILD_MATLAB AND NOT BUILD_PYTHON) From a9170557c0f883934033700c1dd312a3a74611d6 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Thu, 3 May 2018 09:05:01 +0000 Subject: [PATCH 14/17] add explanation on PYTHON_DEST_DIR --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 445d68b55..83c653fa9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,9 @@ find_package(PythonInterp) find_package(PythonLibs) set (BUILD_PYTHON ${PYTHONLIBS_FOUND}) if (BUILD_PYTHON) +# PYTHON_DEST_DIR allows the user to select the install destination of the +# SIRF python modules. PYTHON_DEST_DIR is a cached variable which can be +# updated on the GUI. set(PYTHON_DEST_DIR "" CACHE PATH "Directory of the SIRF Python modules") if (PYTHON_DEST_DIR) set(PYTHON_DEST "${PYTHON_DEST_DIR }") @@ -92,6 +95,9 @@ set (BUILD_MATLAB ${Matlab_FOUND}) if (BUILD_MATLAB) matlab_get_mex_suffix("${Matlab_ROOT_DIR}" MATLAB_MEX_EXT) +# MATLAB_DEST_DIR allows the user to select the install destination of the +# SIRF matlab modules. MATLAB_DEST_DIR is a cached variable which can be +# updated on the GUI. set(MATLAB_DEST_DIR "" CACHE PATH "Directory of the SIRF Matlab libraries") if (MATLAB_DEST_DIR) set(MATLAB_DEST "${MATLAB_DEST_DIR }") From 026160943cdd165e531793181d499b11e991adab Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Thu, 3 May 2018 13:18:36 +0000 Subject: [PATCH 15/17] fix typo --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 83c653fa9..17f2ea150 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,10 +77,11 @@ set (BUILD_PYTHON ${PYTHONLIBS_FOUND}) if (BUILD_PYTHON) # PYTHON_DEST_DIR allows the user to select the install destination of the # SIRF python modules. PYTHON_DEST_DIR is a cached variable which can be -# updated on the GUI. +# updated on the GUI. +# If PYTHON_DEST_DIR is not set, we will install in ${CMAKE_INSTALL_PREFIX}/python set(PYTHON_DEST_DIR "" CACHE PATH "Directory of the SIRF Python modules") if (PYTHON_DEST_DIR) - set(PYTHON_DEST "${PYTHON_DEST_DIR }") + set(PYTHON_DEST "${PYTHON_DEST_DIR}") else() set(PYTHON_DEST "${CMAKE_INSTALL_PREFIX}/python") endif() @@ -98,6 +99,7 @@ if (BUILD_MATLAB) # MATLAB_DEST_DIR allows the user to select the install destination of the # SIRF matlab modules. MATLAB_DEST_DIR is a cached variable which can be # updated on the GUI. +# If MATLAB_DEST_DIR is not set, we will install in ${CMAKE_INSTALL_PREFIX}/matlab set(MATLAB_DEST_DIR "" CACHE PATH "Directory of the SIRF Matlab libraries") if (MATLAB_DEST_DIR) set(MATLAB_DEST "${MATLAB_DEST_DIR }") From cc357d531fee10704610bfb57a9fdf2a50ae9291 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Thu, 3 May 2018 13:20:40 +0000 Subject: [PATCH 16/17] fix another typo --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17f2ea150..cab5999bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,7 +102,7 @@ if (BUILD_MATLAB) # If MATLAB_DEST_DIR is not set, we will install in ${CMAKE_INSTALL_PREFIX}/matlab set(MATLAB_DEST_DIR "" CACHE PATH "Directory of the SIRF Matlab libraries") if (MATLAB_DEST_DIR) - set(MATLAB_DEST "${MATLAB_DEST_DIR }") + set(MATLAB_DEST "${MATLAB_DEST_DIR}") else() set(MATLAB_DEST "${CMAKE_INSTALL_PREFIX}/matlab") endif() From 688adfa8d001fe50f56abd8cf1ab2d06f3eec04d Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Thu, 3 May 2018 13:33:52 +0000 Subject: [PATCH 17/17] added info on PYTHON_DEST_DIR and MATLAB_DEST_DIR --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 75cd52a58..3bc95d3d8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # ChangeLog +## v1.0.1 + +* Added PYTHON_DEST_DIR variable, which allows the user to select the install destination of the SIRF python modules. PYTHON_DEST_DIR is a cached variable which can be updated on the GUI. If PYTHON_DEST_DIR is not set, we will install in ${CMAKE_INSTALL_PREFIX}/python. Likewise for MATLAB_DEST_DIR. + ## v1.0.0 * Access to all MR images and acquisition parameters