Skip to content
Snippets Groups Projects
Commit 0df8f67a authored by Pere Mato Vila's avatar Pere Mato Vila
Browse files

Fix for ROOT-8231 - _GLIBCXX_USE_CXX11_ABI=0 should be propagated into root-config --cflags

parent ea736a07
No related branches found
No related tags found
No related merge requests found
#
# Try to capture the initial set of cmake command line args passed by
# the user for configuration.
# Original Recipe taken from http://stackoverflow.com/questions/10205986/how-to-capture-cmake-command-line-arguments
#
# Note: The entries will live on CMakeCache.txt, so re-configuring with
# a command line that doesn't include an option won't remove it. You need
# to remove the CMakeCache.txt file, or override the value via the command line.
#
#
GET_CMAKE_PROPERTY(CACHE_VARS CACHE_VARIABLES)
FOREACH(CACHE_VAR ${CACHE_VARS})
GET_PROPERTY(CACHE_VAR_HELPSTRING CACHE ${CACHE_VAR} PROPERTY HELPSTRING)
IF(CACHE_VAR_HELPSTRING STREQUAL "No help, variable specified on the command line.")
GET_PROPERTY(CACHE_VAR_TYPE CACHE ${CACHE_VAR} PROPERTY TYPE)
IF(CACHE_VAR_TYPE STREQUAL "UNINITIALIZED")
SET(CACHE_VAR_TYPE)
ELSE(CACHE_VAR_TYPE STREQUAL "UNINITIALIZED")
SET(CACHE_VAR_TYPE :${CACHE_VAR_TYPE})
ENDIF()
SET(CMAKE_INVOKE_ARGS "${CMAKE_INVOKE_ARGS} -D${CACHE_VAR}${CACHE_VAR_TYPE}=\"${${CACHE_VAR}}\"")
ENDIF()
ENDFOREACH(CACHE_VAR ${CACHE_VARS})
# Record the full command line invocation.
SET(CMAKE_INVOKE "${CMAKE_COMMAND} ${CMAKE_INVOKE_ARGS} ${CMAKE_CURRENT_SOURCE_DIR}" CACHE STRING "Command used to invoke cmake" FORCE)
# Create a simple shell script that allows us to reinvoke cmake with the captured command line.
IF (NOT WIN32)
if (NOT ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
set(RECMAKE_GENERATOR "-G ${CMAKE_GENERATOR}")
endif()
SET(RECMAKE_REPLAY_FILE ${CMAKE_BINARY_DIR}/recmake_replay.sh)
SET(RECMAKE_INITIAL_FILE ${CMAKE_BINARY_DIR}/recmake_initial.sh)
if (NOT EXISTS ${RECMAKE_INITIAL_FILE})
FILE(WRITE ${RECMAKE_INITIAL_FILE} "#!/bin/sh\n"
"rm -f CMakeCache.txt\n"
"${CMAKE_INVOKE} ${RECMAKE_GENERATOR}\n")
endif()
if (EXISTS ${RECMAKE_REPLAY_FILE})
FILE(APPEND ${RECMAKE_REPLAY_FILE} "${CMAKE_INVOKE}\n")
else()
FILE(WRITE ${RECMAKE_REPLAY_FILE} "#!/bin/sh\n"
"rm -f CMakeCache.txt\n"
"${CMAKE_INVOKE} ${RECMAKE_GENERATOR}\n")
endif()
ENDIF (NOT WIN32)
#---Check if cmake has the required version----------------------------------------------------- #---Check if cmake has the required version-----------------------------------------------------
cmake_minimum_required(VERSION 3.4.3 FATAL_ERROR) cmake_minimum_required(VERSION 3.4.3 FATAL_ERROR)
cmake_policy(SET CMP0005 NEW) cmake_policy(SET CMP0005 NEW)
include(cmake/modules/CaptureCommandLine.cmake)
#---Set name of the project to "ROOT". Has to be done after check of cmake version-------------- #---Set name of the project to "ROOT". Has to be done after check of cmake version--------------
project(ROOT) project(ROOT)
set(IntegratedBuild ON) set(IntegratedBuild ON)
......
#
# Try to capture the initial set of cmake command line args passed by
# the user for configuration.
# Original Recipe taken from http://stackoverflow.com/questions/10205986/how-to-capture-cmake-command-line-arguments
#
# Note: The entries will live on CMakeCache.txt, so re-configuring with
# a command line that doesn't include an option won't remove it. You need
# to remove the CMakeCache.txt file, or override the value via the command line.
#
get_cmake_property(CACHE_VARS CACHE_VARIABLES)
foreach(CACHE_VAR ${CACHE_VARS})
get_property(CACHE_VAR_HELPSTRING CACHE ${CACHE_VAR} PROPERTY HELPSTRING)
if(CACHE_VAR_HELPSTRING STREQUAL "No help, variable specified on the command line.")
get_property(CACHE_VAR_TYPE CACHE ${CACHE_VAR} PROPERTY TYPE)
if(CACHE_VAR_TYPE STREQUAL UNINITIALIZED)
set(CACHE_VAR_TYPE)
else()
set(CACHE_VAR_TYPE :${CACHE_VAR_TYPE})
endif()
set(CMAKE_INVOKE_ARGS "${CMAKE_INVOKE_ARGS} -D${CACHE_VAR}${CACHE_VAR_TYPE}=\"${${CACHE_VAR}}\"")
# Record the variable also in the cache
set(${CACHE_VAR}-CACHED "${${CACHE_VAR}}" CACHE STRING "" FORCE)
endif()
endforeach()
# Record the full command line invocation.
set(CMAKE_INVOKE "${CMAKE_COMMAND} ${CMAKE_INVOKE_ARGS} ${CMAKE_CURRENT_SOURCE_DIR}" CACHE STRING "Command used to invoke cmake" FORCE)
# Create a simple shell script that allows us to reinvoke cmake with the captured command line.
if(NOT WIN32)
if (NOT ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
set(RECMAKE_GENERATOR "-G ${CMAKE_GENERATOR}")
endif()
set(RECMAKE_REPLAY_FILE ${CMAKE_BINARY_DIR}/recmake_replay.sh)
set(RECMAKE_INITIAL_FILE ${CMAKE_BINARY_DIR}/recmake_initial.sh)
if (NOT EXISTS ${RECMAKE_INITIAL_FILE})
FILE(WRITE ${RECMAKE_INITIAL_FILE} "#!/bin/sh\n"
"rm -f CMakeCache.txt\n"
"${CMAKE_INVOKE} ${RECMAKE_GENERATOR}\n")
endif()
if (EXISTS ${RECMAKE_REPLAY_FILE})
FILE(APPEND ${RECMAKE_REPLAY_FILE} "${CMAKE_INVOKE}\n")
else()
FILE(WRITE ${RECMAKE_REPLAY_FILE} "#!/bin/sh\n"
"rm -f CMakeCache.txt\n"
"${CMAKE_INVOKE} ${RECMAKE_GENERATOR}\n")
endif()
endif()
...@@ -641,6 +641,9 @@ else() ...@@ -641,6 +641,9 @@ else()
"${libdir}" "-lCore" "-lRint" "${incdir}" "" "" "${ROOT_ARCHITECTURE}" "" "${explicitlink}" ) "${libdir}" "-lCore" "-lRint" "${incdir}" "" "" "${ROOT_ARCHITECTURE}" "" "${explicitlink}" )
endif() endif()
#---Get the value of CMAKE_CXX_FLAGS provided by the user in the command line
set(usercflags ${CMAKE_CXX_FLAGS-CACHED})
configure_file(${CMAKE_SOURCE_DIR}/config/root-config.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config @ONLY NEWLINE_STYLE UNIX) configure_file(${CMAKE_SOURCE_DIR}/config/root-config.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config @ONLY NEWLINE_STYLE UNIX)
configure_file(${CMAKE_SOURCE_DIR}/config/memprobe.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe @ONLY NEWLINE_STYLE UNIX) configure_file(${CMAKE_SOURCE_DIR}/config/memprobe.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe @ONLY NEWLINE_STYLE UNIX)
configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh @ONLY NEWLINE_STYLE UNIX) configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh @ONLY NEWLINE_STYLE UNIX)
......
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