[CCPPETMR/SIRF-SuperBuild] Add the possibility of passing CAKE flag to external projects (#348)

1 view
Skip to first unread message

Biguri

unread,
Mar 9, 2020, 8:03:44 AM3/9/20
to CCPPETMR/SIRF-SuperBuild, Subscribed

Resolves #342. Allows to add particular project CMAKE args to the main call, together with any other flag.

e.g.

cmake ./SIRF-SuperBuild -DUSE_SYSTEM_BOOST -DNIFTYPET_EXTRA_CMAKE_ARGS:STRING="-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON" -DSTIR_EXTRA_CMAKE_ARGS:STRING="-DBUILD_SWIG_MATLAB:BOOL=OFF -DDISABLE_ITK:BOOL=ON -DBUILD_MATLAB_WRAPPER:BOOL=ON"


You can view, comment on, or merge this pull request online at:

  https://github.com/CCPPETMR/SIRF-SuperBuild/pull/348

Commit Summary

  • make possible to disable NIFTYREG checkouts
  • remove CMAKE_POSITION_INDEPENDENT_CODE
  • Add variable to pass to NiftyReg for position independent librearies
  • Merge branch 'nifty_reg_link'
  • Revert "Merge branch 'nifty_reg_link'"
  • Initial tests on passing CMAKE vars to External CMAKE
  • Merge branch 'fix_337' into fix_342
  • Merge remote-tracking branch 'AnderBiguri/master' into fix_342
  • Add flags passing to Gadgetron and STIR
  • Merge branch 'fix_343' into fix_342
  • Add NIFTYREG and STIR CMAKE flag passing
  • Add NIFTYPET CMAKE flag passing
  • ADD SIRF CMAKE flag passing
  • Add TomoPhantom CNAKE flag passing

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Kris Thielemans

unread,
Mar 10, 2020, 6:21:02 AM3/10/20
to CCPPETMR/SIRF-SuperBuild, Subscribed

@KrisThielemans requested changes on this pull request.

let's use semi-colons (although confusing) for passing multiple arguments to avoid problems with spaces in filenames etc.

Add example to README.md

Add a line to CHANGES.md

Add yourself to NOTICE.txt


In CMake/SetExternalProjectFlags.cmake:

> @@ -0,0 +1,30 @@

+#========================================================================

+# Author: Ander Biguri

+# Copyright 2019 University College London

⬇️ Suggested change
-# Copyright 2019 University College London

+# Copyright 2020 University College London


In SuperBuild/External_Gadgetron.cmake:

> @@ -35,6 +35,10 @@ set(externalProjName ${proj})

 

 SetCanonicalDirectoryNames(${proj})

 

+# Get any flag from the superbuild call that may be particular to this projects CMAKE_ARGS

+SetExternalProjectFlags(${proj})

+

+#message(FATAL_ERROR "${proj}_EXTRA_CMAKE_ARGS = \"${${proj}_EXTRA_CMAKE_ARGS}\"")

⬇️ Suggested change
-#message(FATAL_ERROR "${proj}_EXTRA_CMAKE_ARGS = \"${${proj}_EXTRA_CMAKE_ARGS}\"")


In CMake/SetExternalProjectFlags.cmake:

> +# Unless required by applicable law or agreed to in writing, software

+# distributed under the License is distributed on an "AS IS" BASIS,

+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+# See the License for the specific language governing permissions and

+# limitations under the License.

+#

+#=========================================================================

+

+# This defines a macro that gets flags passed to the superbuild to modify particular project cmake flags and marks them as advanced.

+# Allows passing cmake flags to the superbuild to be reused by particular projects.

+

+macro(SetExternalProjectFlags proj)

+

+	set(${proj}_EXTRA_CMAKE_ARGS "" CACHE STRING "Optional extra CMake arguments to be appended to the flags set by the SuperBuild")

+	mark_as_advanced(${proj}_EXTRA_CMAKE_ARGS)

+	string(REPLACE " " ";" ${proj}_EXTRA_CMAKE_ARGS_LIST "${${proj}_EXTRA_CMAKE_ARGS}")

⬇️ Suggested change
-	string(REPLACE " " ";" ${proj}_EXTRA_CMAKE_ARGS_LIST "${${proj}_EXTRA_CMAKE_ARGS}")

+	#string(REPLACE " " ";" ${proj}_EXTRA_CMAKE_ARGS_LIST "${${proj}_EXTRA_CMAKE_ARGS}")


In CMake/SetExternalProjectFlags.cmake:

> +#         http://www.apache.org/licenses/LICENSE-2.0.txt

+#

+# Unless required by applicable law or agreed to in writing, software

+# distributed under the License is distributed on an "AS IS" BASIS,

+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+# See the License for the specific language governing permissions and

+# limitations under the License.

+#

+#=========================================================================

+

+# This defines a macro that gets flags passed to the superbuild to modify particular project cmake flags and marks them as advanced.

+# Allows passing cmake flags to the superbuild to be reused by particular projects.

+

+macro(SetExternalProjectFlags proj)

+

+	set(${proj}_EXTRA_CMAKE_ARGS "" CACHE STRING "Optional extra CMake arguments to be appended to the flags set by the SuperBuild")

⬇️ Suggested change
-	set(${proj}_EXTRA_CMAKE_ARGS "" CACHE STRING "Optional extra CMake arguments to be appended to the flags set by the SuperBuild")

+	set(${proj}_EXTRA_CMAKE_ARGS "" CACHE STRING "Optional extra CMake arguments to be appended to the flags set by the SuperBuild (use semi-colons for multiple arguments)")

Biguri

unread,
Mar 10, 2020, 7:19:57 AM3/10/20
to CCPPETMR/SIRF-SuperBuild, Push

@AnderBiguri pushed 1 commit.

  • 230f620 Add facility to pass extra CMAKE vars to External CMAKE


You are receiving this because you are subscribed to this thread.

View it on GitHub or unsubscribe.

Biguri

unread,
Mar 10, 2020, 7:23:13 AM3/10/20
to CCPPETMR/SIRF-SuperBuild, Push

@AnderBiguri pushed 1 commit.

  • 5bb5cab Apply suggestions from code review


You are receiving this because you are subscribed to this thread.

Biguri

unread,
Mar 10, 2020, 9:51:47 AM3/10/20
to CCPPETMR/SIRF-SuperBuild, Push

@AnderBiguri pushed 3 commits.

  • 3ef3504 Only accept semicolon-separated EXTRA_CMAKE_ARGS
  • 8edb824 Add EXTRA_CMAKE_ARGS to Changes.md
  • 1a2bbb3 Add description on how to pass CMAKE_EXTRA_ARGS to README


You are receiving this because you are subscribed to this thread.

Biguri

unread,
Mar 10, 2020, 9:53:37 AM3/10/20
to CCPPETMR/SIRF-SuperBuild, Subscribed

Kris Thielemans

unread,
Mar 10, 2020, 10:33:09 AM3/10/20
to CCPPETMR/SIRF-SuperBuild, Subscribed

Closed #348.

Biguri

unread,
Mar 10, 2020, 10:54:08 AM3/10/20
to CCPPETMR/SIRF-SuperBuild, Subscribed

@KrisThielemans I can not reopen this myself.

Kris Thielemans

unread,
Mar 10, 2020, 12:21:54 PM3/10/20
to CCPPETMR/SIRF-SuperBuild, Subscribed

Reopened #348.

Kris Thielemans

unread,
Mar 10, 2020, 12:24:14 PM3/10/20
to CCPPETMR/SIRF-SuperBuild, Subscribed

Merged #348 into master.

Reply all
Reply to author
Forward
0 new messages