build: remove Swift search paths for host

Remove the Swift library search path for the host paths which are C/C++
only.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -548,10 +548,6 @@
     message(FATAL_ERROR "Either SHARED or STATIC must be specified")
   endif()

-  # Determine the subdirectory where this library will be installed.
-  set(ASHLS_SUBDIR
-    "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}/${SWIFT_HOST_VARIANT_ARCH}")
-
   # Include LLVM Bitcode slices for iOS, Watch OS, and Apple TV OS device libraries.
   set(embed_bitcode_arg)
   if(SWIFT_EMBED_BITCODE_SECTION)
@@ -656,19 +652,7 @@
   set(c_compile_flags ${ASHLS_C_COMPILE_FLAGS})
   set(link_flags)

-  set(library_search_subdir "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
-  set(library_search_directories
-    "${SWIFTLIB_DIR}/${ASHLS_SUBDIR}"
-    "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${ASHLS_SUBDIR}"
-    "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
-
-  # In certain cases when building, the environment variable SDKROOT is set to override
-  # where the sdk root is located in the system. If that environment variable has been
-  # set by the user, respect it and add the specified SDKROOT directory to the
-  # library_search_directories so we are able to link against those libraries
-  if(DEFINED ENV{SDKROOT} AND EXISTS "$ENV{SDKROOT}/usr/lib/swift")
-      list(APPEND library_search_directories "$ENV{SDKROOT}/usr/lib/swift")
-  endif()
+  set(library_search_directories)

   _add_variant_c_compile_flags(
     SDK "${SWIFT_HOST_VARIANT_SDK}"


Fix finding static libraries on windows (mingw)

--- cmake/modules/FindGLEW.cmake
+++ cmake/modules/FindGLEW.cmake
@@ -104,7 +104,7 @@
   elseif(WIN32 AND "${shared_or_static}" MATCHES "SHARED")
     set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" PARENT_SCOPE)
   elseif(WIN32 AND "${shared_or_static}" MATCHES "STATIC")
-    set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.dll.a" PARENT_SCOPE)
+    set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib;.a;.dll.a" PARENT_SCOPE)
   endif()

   if(GLEW_VERBOSE)


Added compile flags to conda osx64 build due for mac>=10.9

https://mathematica.stackexchange.com/questions/34692/mathlink-linking-error-after-os-x-10-9-mavericks-upgrade

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -61,7 +61,7 @@
     set ( CMAKE_C_FLAGS_RELEASE        "-O3 -DNDEBUG" )
     set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g" )

-    set ( CMAKE_CXX_FLAGS                "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11" )
+    set ( CMAKE_CXX_FLAGS                "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -stdlib=libstdc++ -lstdc++" )
     set ( CMAKE_CXX_FLAGS_DEBUG          "-g" )
     set ( CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG" )
     set ( CMAKE_CXX_FLAGS_RELEASE        "-O3 -DNDEBUG" )


Disable Clang's warning about global destructors.

--- cmake/SetFlags.cmake
+++ cmake/SetFlags.cmake
@@ -22,6 +22,7 @@
 		set(F_WARN "${F_WARN} -Wno-c++98-compat -Wno-padded")
 		set(F_WARN "${F_WARN} -Wno-exit-time-destructors")
 		set(F_WARN "${F_WARN} -Wno-c++98-compat-pedantic")
+		set(F_WARN "${F_WARN} -Wno-global-constructors")

 		set(F_DBG "${F_WARN} -std=c++1y -g -O0 -fno-omit-frame-pointer")
 		set(F_DBG "${F_DBG} -fsanitize=address -fsanitize=undefined")


minor cleanup

minor cleanup

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@8556 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/gsConfig.cmake
+++ cmake/gsConfig.cmake
@@ -104,14 +104,12 @@
       message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
     endif()
   endif()
-#else()#if gcc ver >= 6.1
 endif()
 endif()

 # Smart pointers (depending on CMAKE_CXX_STANDARD)
 if( (NOT CMAKE_CXX_STANDARD EQUAL 98 AND NOT STD_UNIQUE_PTR_FOUND ) OR
     (CMAKE_CXX_STANDARD EQUAL     98 AND STD_UNIQUE_PTR_FOUND)    ) #xor
-message("11111111111111")
   unset(TR1_SHARED_PTR_FOUND CACHE)
   unset(TR1_SHARED_PTR_USE_TR1_MEMORY CACHE)
   unset(TR1_SHARED_PTR_USE_MEMORY CACHE)


fficonfig: Add HAVE_AS_STRING_PSEUDO_OP test

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -1063,8 +1063,19 @@
   )

 # libffi specific: Check whether assembler supports .string.
-# TODO
-set(HAVE_AS_STRING_PSEUDO_OP 1)
+set(check_src ${PROJECT_BINARY_DIR}/CMakeFiles/have_as_string_pseudo_op.c)
+file(WRITE ${check_src} "
+int main () {
+asm (\".string \\\"string\\\"\");
+return 0;
+}
+")
+python_platform_test(
+  HAVE_AS_STRING_PSEUDO_OP
+  "Checking whether assembler supports .string"
+  ${check_src}
+  DIRECT
+  )

 # libffi specific: Check whether assembler supports unwind section type.
 # TODO


Added glew to configs/default.cmake

Added glew to configs/default.cmake

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -104,6 +104,7 @@
 hunter_config(fmt VERSION 3.0.0)
 hunter_config(freetype VERSION 2.6.2)
 hunter_config(geos VERSION 3.4.2)
+hunter_config(glew VERSION 2.0.0)
 hunter_config(glog VERSION 0.3.4-p1)
 hunter_config(glfw VERSION 3.2-p0)
 hunter_config(glm VERSION 0.9.7.6)


make spdlog 0.13 available on VC++ 2013 as well

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -197,7 +197,7 @@
 hunter_config(sm VERSION 1.2.1)
 hunter_config(sse2neon VERSION 1.0.0-p0)
 hunter_config(sparsehash VERSION 2.0.2)
-if(MSVC_VERSION LESS 1900)
+if(MSVC_VERSION LESS 1800)
     # for VS12 - version without support C++11
   hunter_config(spdlog VERSION 1.0.0-p0)
 else()


Add more output when required python package fails to install

--- scripts/PythonPackageLookup.cmake
+++ scripts/PythonPackageLookup.cmake
@@ -85,8 +85,16 @@
         ERROR_VARIABLE error
         OUTPUT_VARIABLE output
     )
-    if(lpp_REQUIRED)
-        set(arguments "${arguments} REQUIRED")
+    if(result EQUAL 0)
+        if(lpp_REQUIRED)
+            set(arguments "${arguments} REQUIRED")
+        endif()
+        find_python_package(${package} ${arguments} ${lpp_UNPARSED_ARGUMENTS})
+    elseif(lpp_REQUIRED)
+        message("output: ${output}\n")
+        message("error: ${error}\n")
+        message(FATAL_ERROR "Could not install ${package}")
+    else()
+        message(WARNING "Could not install ${package}")
     endif()
-    find_python_package(${package} REQUIRED ${lpp_UNPARSED_ARGUMENTS})
 endfunction()


Maybe ed8ade558037 now works

Maybe ed8ade558037 now works

--- scripts/PythonPackageLookup.cmake
+++ scripts/PythonPackageLookup.cmake
@@ -38,7 +38,7 @@
     if(NOT lpp_PIPNAME)
       set(lpp_PIPNAME ${package})
     endif()
-    set(package_install_name "${package}")
+    set(package_install_name "${lpp_PIPNAME}")
     if(lpp_VERSION)
         list(APPEND arguments VERSION ${lpp_VERSION})
         set(package_install_name "${lpp_PACKAGE}==${lpp_VERSION}")
@@ -70,7 +70,7 @@
         file(MAKE_DIRECTORY "${lpp_PATH}")
     endif()
     _lpp_check_is_syspath("${LOCALPYTHON}" "${lpp_PATH}")
-    file(WRITE "${EXTERNAL_ROOT}/install_${lpp_PIPNAME}.py"
+    file(WRITE "${EXTERNAL_ROOT}/install_${package}.py"
         "from os import environ\n"
         "if 'PYTHONPATH' not in environ:\n"
         "    environ['PYTHONPATH'] = '${lpp_PATH}'\n"


Added APR search paths for recent homebrew

--- cmake/FindAPR.cmake
+++ cmake/FindAPR.cmake
@@ -27,6 +27,7 @@
 # APR first.

 FIND_PATH(APR_INCLUDE_DIR apr.h
+  /usr/local/opt/apr/libexec/include/apr-1
   /opt/homebrew/opt/apr/include/apr-1
   /usr/local/include/apr-1
   /usr/local/include/apr-1.0
@@ -39,6 +40,7 @@
 FIND_LIBRARY(APR_LIBRARY
   NAMES ${APR_NAMES}
   HINTS
+    /usr/local/opt/apr/libexec/lib
     /opt/homebrew/opt/apr/lib
   PATHS
     /usr/lib
@@ -77,6 +79,7 @@
 # Next, APRUTIL.

 FIND_PATH(APRUTIL_INCLUDE_DIR apu.h
+  /usr/local/opt/apr-util/libexec/include/apr-1
   /opt/homebrew/opt/apr-util/include/apr-1
   /usr/local/include/apr-1
   /usr/local/include/apr-1.0
@@ -89,6 +92,7 @@
 FIND_LIBRARY(APRUTIL_LIBRARY
   NAMES ${APRUTIL_NAMES}
   HINTS
+    /usr/local/opt/apr-util/libexec/lib
     /opt/homebrew/opt/apr-util/lib
   PATHS
     /usr/lib


added option HIP_BUILD_VERBOSE to enable verbosity in HIP build

--- cmake/FindHIP.cmake
+++ cmake/FindHIP.cmake
@@ -20,6 +20,7 @@
     mark_as_advanced(HIP_HIPCC_FLAGS_${config_upper} HIP_HCC_FLAGS_${config_upper} HIP_NVCC_FLAGS_${config_upper})
 endforeach()
 option(HIP_HOST_COMPILATION_CPP "Host code compilation mode" ON)
+option(HIP_VERBOSE_BUILD "Print out the commands run while compiling the HIP source file.  With the Makefile generator this defaults to VERBOSE variable specified on the command line, but can be forced on with this option." OFF)
 mark_as_advanced(HIP_HOST_COMPILATION_CPP)

 ###############################################################################


cmake has FindPNG

cmake has FindPNG

--- cmake/FindPNG.cmake
+++ cmake/FindPNG.cmake
@@ -1,70 +0,0 @@
-include(FindPackageHandleStandardArgs)
-
-set(hints
-  $ENV{EXTERNLIBS}/libpng
-  $ENV{LIB_BASE_PATH}/
-  $ENV{LIB_BASE_PATH}/libpng/
-)
-
-set(paths
-  /usr
-  /usr/local
-)
-
-find_path(PNG_INCLUDE_DIR
-  NAMES
-    png.h
-  HINTS
-    ${hints}
-  PATHS
-    ${paths}
-  PATH_SUFFIXES
-    include
-    include/libpng
-    include/libpng16
-)
-
-find_library(PNG_LIBRARY
-  NAMES
-    png
-    libpng
-    libpng16
-    libpng_static
-    libpng16_static
-  HINTS
-    ${hints}
-  PATHS
-    ${paths}
-  PATH_SUFFIXES
-    lib64
-    lib
-    lib/x86_64-linux-gnu
-)
-
-find_library(PNG_LIBRARY_DEBUG
-  NAMES
-    pngd
-    libpngd
-    libpng16d
-    libpng_staticd
-    libpng16_staticd
-  HINTS
-    ${hints}
-  PATHS
-    ${paths}
-  PATH_SUFFIXES
-    lib64
-    lib
-    lib/x86_64-linux-gnu
-)
-
-if(PNG_LIBRARY_DEBUG)
-  set(PNG_LIBRARIES optimized ${PNG_LIBRARY} debug ${PNG_LIBRARY_DEBUG})
-else()
-  set(PNG_LIBRARIES ${PNG_LIBRARY})
-endif()
-
-find_package_handle_standard_args(PNG DEFAULT_MSG
-  PNG_INCLUDE_DIR
-  PNG_LIBRARY
-)


replaced tabs by spaces

replaced tabs by spaces

--- cmake/Utility.cmake
+++ cmake/Utility.cmake
@@ -11,29 +11,29 @@
 #
 # -----------------------------------------------------------------------------
 function(get_processor_count OUTPUT_PROCESSOR_COUNT)
-	set(PROCESSOR_COUNT 1) # default
-	if(UNIX)
-		set(CPUINFO_FILE "/proc/cpuinfo")
-		if(EXISTS "${CPUINFO_FILE}")
-			file(STRINGS "${CPUINFO_FILE}" PROCESSOR_STRINGS REGEX "^processor.: [0-9]+$")
-			list(LENGTH PROCESSOR_STRINGS PROCESSOR_COUNT)
-		endif()
-	elseif(APPLE)
-		find_program(SystemProfiler "system_profiler")
-		if(SystemProfiler)
-			execute_process(COMMAND ${SystemProfiler} OUTPUT_VARIABLE SYSTEM_INFORMATION)
-			string(REGEX REPLACE
-				"^.*Total Number Of Cores: ([0-9]+).*$"
-				"\\1"
-				PROCESSOR_COUNT
-				"${SYSTEM_INFORMATION}"
-			)
-		endif()
-	elseif(WIN32)
-		set(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}")
-	endif()
+  set(PROCESSOR_COUNT 1) # default
+  if(UNIX)
+    set(CPUINFO_FILE "/proc/cpuinfo")
+    if(EXISTS "${CPUINFO_FILE}")
+      file(STRINGS "${CPUINFO_FILE}" PROCESSOR_STRINGS REGEX "^processor.: [0-9]+$")
+      list(LENGTH PROCESSOR_STRINGS PROCESSOR_COUNT)
+    endif()
+  elseif(APPLE)
+    find_program(SystemProfiler "system_profiler")
+    if(SystemProfiler)
+      execute_process(COMMAND ${SystemProfiler} OUTPUT_VARIABLE SYSTEM_INFORMATION)
+      string(REGEX REPLACE
+        "^.*Total Number Of Cores: ([0-9]+).*$"
+        "\\1"
+        PROCESSOR_COUNT
+        "${SYSTEM_INFORMATION}"
+      )
+    endif()
+  elseif(WIN32)
+    set(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}")
+  endif()
   message(STATUS "Available Thread(s): ${PROCESSOR_COUNT}")
-	set(${OUTPUT_PROCESSOR_COUNT} "${PROCESSOR_COUNT}" PARENT_SCOPE)
+  set(${OUTPUT_PROCESSOR_COUNT} "${PROCESSOR_COUNT}" PARENT_SCOPE)
 endfunction()

 # -----------------------------------------------------------------------------


Version 0.1.2

Version 0.1.2

--- cmake/version.cmake
+++ cmake/version.cmake
@@ -1 +1 @@
-set(HUNTER_VERSION "0.1.1")
+set(HUNTER_VERSION "0.1.2")


Use a special branch for swig-js under OSX.

This does not need to have automake installed.

--- config/SwigJS.cmake
+++ config/SwigJS.cmake
@@ -1,16 +1,26 @@
 set(DOWNLOAD_DIR ${EXTERNALS_DIR}/swig)
+
+if(APPLE)
+  # HACK: switch for OSX version
+  set(SWIGJS_GIT_TAG js_mountain_lion)
+  set(SWIGJS_AUTOGEN)
+elseif()
+  set(SWIGJS_GIT_TAG devel)
+  set(SWIGJS_AUTOGEN ${DOWNLOAD_DIR}/swig/autogen.sh)
+endif()
+

 if (DOWNLOAD_EXTERNALS)

   ExternalProject_Add(swig_js
     GIT_REPOSITORY https://github.com/oliver----/swig-v8.git
-    GIT_TAG devel
+    GIT_TAG ${SWIGJS_GIT_TAG}
     PREFIX ${DOWNLOAD_DIR}
     DOWNLOAD_DIR ${DOWNLOAD_DIR}
     STAMP_DIR ${DOWNLOAD_DIR}/stamp
     SOURCE_DIR ${DOWNLOAD_DIR}/swig
     BINARY_DIR ${DOWNLOAD_DIR}/swig
-    UPDATE_COMMAND ${DOWNLOAD_DIR}/swig/autogen.sh
+    UPDATE_COMMAND ${SWIGJS_AUTOGEN}
     CONFIGURE_COMMAND /bin/sh ${DOWNLOAD_DIR}/swig/configure
     BUILD_COMMAND make
     INSTALL_COMMAND "" # skip install


Defaults to static build on windows

Defaults to static build on windows

--- config/config.cmake
+++ config/config.cmake
@@ -57,8 +57,11 @@
 ENDIF(WIN32)

 # Change this to "SHARED" to create shared libraries
-#set(SHAREDSTATIC "STATIC")
+if(WIN32)
+set(SHAREDSTATIC "STATIC")
+else(WIN32)
 set(SHAREDSTATIC "SHARED")
+endif(WIN32)

 # Add the definitions for OS and PLATFORM
 add_definitions(-D${BUILD_OS} -D${BUILD_PLATFORM} -D${WORDSIZE} -DOF_${SHAREDSTATIC}_BUILD)


Attempting to silence verbose output.

Attempting to silence verbose output.

--- CPM.cmake
+++ CPM.cmake
@@ -492,6 +492,7 @@
         COMMAND "${GIT_EXECUTABLE}" checkout ${_CPM_GIT_TAG}
         WORKING_DIRECTORY "${__CPM_MODULE_SOURCE_DIR}"
         RESULT_VARIABLE error_code
+        OUTPUT_QUIET TRUE
         )
       if(error_code)
         message(FATAL_ERROR "Failed to checkout tag: '${_CPM_GIT_TAG}'")


Include directory should be the root of the cloned out dir.

--- CPM.cmake
+++ CPM.cmake
@@ -811,7 +811,7 @@

     # Append target to pre-existing libraries.
     set(CPM_LIBRARIES ${CPM_LIBRARIES} "${CPM_TARGET_NAME}" PARENT_SCOPE)
-    set(CPM_INCLUDE_DIRS ${CPM_INCLUDE_DIRS} "${__CPM_MODULE_SOURCE_DIR}/include" PARENT_SCOPE)
+    set(CPM_INCLUDE_DIRS ${CPM_INCLUDE_DIRS} "${__CPM_MODULE_SOURCE_DIR}" PARENT_SCOPE)

   else()
     _cpm_check_and_add_preproc(${name} ${CPM_KV_SOURCE_ADDED_MAP_${__CPM_FULL_UNID}} ${__CPM_FULL_UNID})


Enable the non-optional MITK_USE_Boost for mitkDiffusion configuration

--- CMake/mitkBuildConfigurationmitkDiffusion.cmake
+++ CMake/mitkBuildConfigurationmitkDiffusion.cmake
@@ -1,4 +1,7 @@
 message(STATUS "Configuring MITK Diffusion Release Build")
+
+# Enable Boost which is a necessary configuration
+set(MITK_USE_Boost ON CACHE BOOL "MITK Use Boost Library" FORCE)

 # Disable all apps but MITK Diffusion
 set(MITK_BUILD_ALL_APPS OFF CACHE BOOL "Build all MITK applications" FORCE)


ENH: Update LSTK version.

ENH: Update LSTK version.

To sync up with VTK 6.0.

--- Modules/Remote/LesionSizingToolkit.remote.cmake
+++ Modules/Remote/LesionSizingToolkit.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(LesionSizingToolkit
   "Framework for determining the sizes of lesions in medical images."
   GIT_REPOSITORY http://public.kitware.com/LesionSizingToolkit.git
-  GIT_TAG 32c415ebb36
+  GIT_TAG ac2b1a02e
   )


cmake build system tweak for LC

cmake build system tweak for LC

--- config/cmake/modules/FindMKLCPARDISO.cmake
+++ config/cmake/modules/FindMKLCPARDISO.cmake
@@ -18,13 +18,18 @@
   message(FATAL_ERROR "MKL CPardiso enabled but no MKL MPI Wrapper lib specified")
 endif()

+if(NOT MKL_LIBRARY_DIR)
+  message(WARNING "Using default MKL library path. Double check the variable MKL_LIBRARY_DIR")
+  set(MKL_LIBRARY_DIR "lib")
+endif()
+
 include(MfemCmakeUtilities)
 mfem_find_package(MKLCPARDISO MKLCPARDISO
-    MKLCPARDISO_DIR "include" mkl_cluster_sparse_solver.h "lib" mkl_core
+    MKLCPARDISO_DIR "include" mkl_cluster_sparse_solver.h ${MKL_LIBRARY_DIR} mkl_core
   "Paths to headers required by MKL CPardiso." "Libraries required by MKL CPARDISO."
-  ADD_COMPONENT MKL_LP64 "include" "" "lib" mkl_intel_lp64
-  ADD_COMPONENT MKL_SEQUENTIAL "include" "" "lib" mkl_sequential
-  ADD_COMPONENT MKL_MPI_WRAPPER "include" "" "lib" ${MKL_MPI_WRAPPER_LIB}
+  ADD_COMPONENT MKL_LP64 "include" "" ${MKL_LIBRARY_DIR} mkl_intel_lp64
+  ADD_COMPONENT MKL_SEQUENTIAL "include" "" ${MKL_LIBRARY_DIR} mkl_sequential
+  ADD_COMPONENT MKL_MPI_WRAPPER "include" "" ${MKL_LIBRARY_DIR} ${MKL_MPI_WRAPPER_LIB}
   CHECK_BUILD MKLCPARDISO_VERSION_OK TRUE
   "
 #include <mpi.h>


COMP: fix linking on OpenBSD

COMP: fix linking on OpenBSD

Change-Id: Ie01f41607d106ccebefddbd9381f08202e975951

--- CMake/ITKModuleMacros.cmake
+++ CMake/ITKModuleMacros.cmake
@@ -387,8 +387,10 @@
 endmacro()

 macro(itk_module_target_name _name)
-  set_property(TARGET ${_name} PROPERTY VERSION 1)
-  set_property(TARGET ${_name} PROPERTY SOVERSION 1)
+  if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
+    set_property(TARGET ${_name} PROPERTY VERSION 1)
+    set_property(TARGET ${_name} PROPERTY SOVERSION 1)
+  endif()
   if("${_name}" MATCHES "^[Ii][Tt][Kk]")
     set(_itk "")
   else()


Do not assume a specific Qt5 install structure.

--- CMake/ctkMacroSetupQt.cmake
+++ CMake/ctkMacroSetupQt.cmake
@@ -33,10 +33,7 @@
   if(CTK_QT_VERSION VERSION_GREATER "4")
     cmake_minimum_required(VERSION 2.8.12)
     set(QT5_INSTALL_PREFIX "" CACHE PATH "The install location of Qt5")
-    if(NOT QT5_INSTALL_PREFIX OR NOT EXISTS ${QT5_INSTALL_PREFIX}/bin/qmake)
-      message(FATAL_ERROR "You must specify the install location of Qt5")
-    endif()
-    set(CMAKE_PREFIX_PATH ${QT5_INSTALL_PREFIX})
+    set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT5_INSTALL_PREFIX})
     set(CTK_QT5_COMPONENTS Core Xml XmlPatterns Concurrent Sql Test)
     if(CTK_LIB_Widgets OR CTK_LIB_CommandLineModules/Frontend/QtGui)
       list(APPEND CTK_QT5_COMPONENTS Widgets OpenGL UiTools)