Commits (14)
......@@ -45,12 +45,12 @@ mark_as_advanced(superbuild_download_location)
superbuild_setup_flags()
# merge in default/user-specified CMake flags.
set(superbuild_ldflags "${CMAKE_SHARED_LINKER_FLAGS} ${superbuild_ldflags}")
set(superbuild_ld_flags "${CMAKE_SHARED_LINKER_FLAGS} ${superbuild_ld_flags}")
set(superbuild_cpp_flags "${CMAKE_CXX_FLAGS} ${superbuild_cpp_flags}")
set(superbuild_cxx_flags "${CMAKE_CXX_FLAGS} ${superbuild_cxx_flags}")
set(superbuild_c_flags "${CMAKE_C_FLAGS} ${superbuild_c_flags}")
foreach (var ldflags cpp_flags cxx_flags c_flags)
foreach (var ld_flags cpp_flags cxx_flags c_flags)
string(STRIP "${superbuild_${var}}" "superbuild_${var}")
endforeach ()
......
......@@ -292,7 +292,7 @@ function (superbuild_windows_install_plugin name destination paths)
if (EXISTS "${superbuild_install_location}/${path}/${name}")
install(
FILES "${superbuild_install_location}/${path}/${name}"
DESTINATION "bin"
DESTINATION "${destination}"
COMPONENT superbuild)
break ()
endif ()
......
......@@ -246,11 +246,19 @@ endfunction ()
# those to use to build any dependencies. The default is the latter. For former,
# pass in an optional argument PROJECT_ONLY.
function (superbuild_append_flags key value)
if (NOT "x${key}" STREQUAL "xCMAKE_CXX_FLAGS" AND
NOT "x${key}" STREQUAL "xCMAKE_C_FLAGS" AND
NOT "x${key}" STREQUAL "xLDFLAGS")
if (NOT superbuild_build_phase)
return ()
endif ()
_superbuild_check_current_project("superbuild_append_flags")
if (NOT "x${key}" STREQUAL "xcxx_flags" AND
NOT "x${key}" STREQUAL "xc_flags" AND
NOT "x${key}" STREQUAL "xcpp_flags" AND
NOT "x${key}" STREQUAL "xld_flags")
message(AUTHOR_WARNING
"Currently, only CMAKE_CXX_FLAGS, CMAKE_C_FLAGS, and LDFLAGS are supported.")
"Currently, only cxx_flags, c_flags, cpp_flags, and ld_flags are supported.")
return ()
endif ()
set(project_only FALSE)
......@@ -262,18 +270,14 @@ function (superbuild_append_flags key value)
endif ()
endforeach ()
if (build-projects)
_superbuild_check_current_project("superbuild_append_flags")
set(property "${current_project}_append_flags_${key}")
if (project_only)
set(property "${current_project}_append_project_only_flags_${key}")
endif ()
set_property(GLOBAL APPEND
PROPERTY
"${property}" "${value}")
set(property "${current_project}_append_flags_cmake_${key}")
if (project_only)
set(property "${current_project}_append_project_only_flags_cmake_${key}")
endif ()
set_property(GLOBAL APPEND
PROPERTY
"${property}" "${value}")
endfunction ()
#------------------------------------------------------------------------------
......@@ -546,7 +550,8 @@ function (_superbuild_add_project_internal name)
set(extra_vars
c_flags
cxx_flags
ldflags)
cpp_flags
ld_flags)
foreach (extra_var IN LISTS extra_vars)
set("extra_${extra_var}")
......@@ -554,20 +559,19 @@ function (_superbuild_add_project_internal name)
# Scan project flags.
foreach (var IN LISTS extra_vars)
string(TOUPPER "${var}" upper_var)
get_property(extra_flags GLOBAL
PROPERTY "${name}_append_project_only_flags_cmake_${upper_var}")
PROPERTY "${name}_append_project_only_flags_cmake_${var}")
list(APPEND "extra_${var}"
${extra_flags})
endforeach ()
# Scan dependency flags.
superbuild_get_project_depends("${name}" arg)
foreach (dep IN LISTS arg_depends)
foreach (var IN LISTS extra_vars)
string(TOUPPER "${var}" upper_var)
get_property(extra_flags GLOBAL
PROPERTY "${dep}_append_flags_cmake_${upper_var}")
PROPERTY "${dep}_append_flags_cmake_${var}")
list(APPEND "extra_${var}"
${extra_flags})
......@@ -602,7 +606,7 @@ function (_superbuild_add_project_internal name)
PROCESS_ENVIRONMENT
LDFLAGS "${project_ld_flags}"
CPPFLAGS "${superbuild_cppflags}"
CPPFLAGS "${project_cpp_flags}"
CXXFLAGS "${project_cxx_flags}"
CFLAGS "${project_c_flags}"
# disabling this since it fails when building numpy.
......@@ -708,7 +712,7 @@ endfunction ()
function (_superbuild_check_current_project func)
if (NOT current_project)
message(AUTHOR_WARNING "${func} called an incorrect stage.")
message(AUTHOR_WARNING "${func} called at an incorrect stage.")
return ()
endif ()
endfunction ()
......
......@@ -39,7 +39,7 @@ function (superbuild_setup_flags)
endif ()
# FIXME: currently, if any of these are empty, we have build issues on Unix.
set(superbuild_ldflags "$ENV{LDFLAGS} -L${superbuild_install_location}/lib"
set(superbuild_ld_flags "$ENV{LDFLAGS} -L${superbuild_install_location}/lib"
PARENT_SCOPE)
set(superbuild_ld_library_path "${superbuild_install_location}/lib:$ENV{LD_LIBRARY_PATH}"
PARENT_SCOPE)
......
......@@ -45,6 +45,11 @@ foreach (link IN LISTS prerequisites)
PATHS ${library_paths}
NO_DEFAULT_PATH)
if (NOT full_path)
string(REPLACE ";" ", " paths "${library_paths}")
message(FATAL_ERROR "Failed to find the ${linkname} library. Searched paths: ${paths}.")
endif ()
message(STATUS "Resolving ${linkname} to path ${full_path}...")
if (IS_SYMLINK "${full_path}")
......
cmake_minimum_required(VERSION 3.0)
project("cpack-@name@" NONE)
# We need to explicitly state so form of language support. That is how CMake
# detects what compilers are being used, and therefore what
# InstallRequiredSystemLibraries should properly do. If we state NONE for
# languages we will fail to install any of the system libraries.
project("cpack-@name@")
set(CMAKE_BUILD_TYPE "@CMAKE_BUILD_TYPE@")
set(CMAKE_MODULE_PATH "@CMAKE_MODULE_PATH@")
set(CMAKE_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
set(superbuild_source_directory "@CMAKE_SOURCE_DIR@")
......
......@@ -20,8 +20,8 @@ superbuild_add_project(ffmpeg
--disable-yasm
${ffmpeg_shared_args}
--cc=${CMAKE_C_COMPILER}
\"--extra-cflags=${superbuild_cflags}\"
\"--extra-ldflags=${superbuild_ldflags}\"
\"--extra-cflags=${superbuild_c_flags}\"
\"--extra-ldflags=${superbuild_ld_flags}\"
${extra_commands}"
BUILD_COMMAND
$(MAKE)
......
......@@ -6,8 +6,13 @@ set(qt4_extra_options)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND
CMAKE_OSX_DEPLOYMENT_TARGET AND
CMAKE_OSX_DEPLOYMENT_TARGET VERSION_GREATER "10.6")
list(APPEND qt4_extra_options
-platform unsupported/macx-clang)
if (cxx11_enabled)
list(APPEND qt4_extra_options
-platform unsupported/macx-clang-libc++)
else ()
list(APPEND qt4_extra_options
-platform unsupported/macx-clang)
endif ()
endif ()
list(APPEND qt4_extra_options
......
......@@ -45,6 +45,7 @@ superbuild_add_project(boost
CAN_USE_SYSTEM
BUILD_IN_SOURCE 1
DEPENDS zlib
DEPENDS_OPTIONAL cxx11
"${boost_build_commands}"
${boost_extra_arguments})
......
superbuild_add_dummy_project(cxx11)
superbuild_add_extra_cmake_args(
-DCMAKE_CXX_STANDARD:STRING=11
-DCMAKE_CXX_STANDARD_REQUIRED:STRING=11)
superbuild_append_flags(cxx_flags "${CMAKE_CXX11_STANDARD_COMPILE_OPTION}")
......@@ -46,6 +46,7 @@ endif ()
superbuild_add_project(qt4
CAN_USE_SYSTEM
DEPENDS zlib ${qt4_extra_depends}
DEPENDS_OPTIONAL cxx11
${qt4_extra_arguments}
CONFIGURE_COMMAND
<SOURCE_DIR>/configure${qt4_configure_ext}
......
......@@ -35,6 +35,7 @@ endif ()
superbuild_add_project(qt5
DEPENDS ${qt5_depends} ${qt5_extra_depends}
DEPENDS_OPTIONAL cxx11
CONFIGURE_COMMAND
<SOURCE_DIR>/configure${qt5_configure_ext}
-opensource
......
......@@ -21,7 +21,7 @@ if (NOT CMAKE_CROSSCOMPILING)
# Pass the -rpath flag when building python to avoid issues running the
# executable we built.
superbuild_append_flags(
LDFLAGS "-Wl,-rpath,${superbuild_install_location}/lib"
ld_flags "-Wl,-rpath,${superbuild_install_location}/lib"
PROJECT_ONLY)
endif ()
......
......@@ -6,6 +6,7 @@ function (superbuild_find_projects var)
set(projects
boost
bzip2
cxx11
freetype
hdf5
lapack
......