Commit 87eb8cdf authored by jcfr's avatar jcfr
Browse files

ENH: Add ADDITIONAL_{C,CXX}_FLAGS options

These options allow to pass flags that will be appended to the ones
internally determined.

The variable CMAKE_{C,CXX}_FLAGS will then be set using:
 - the list of internal flags: Slicer_{C,CXX}_FLAGS
 - the additional flags passed at configuration time: ADDITIONAL_{C,CXX}_FLAGS

git-svn-id: http://svn.slicer.org/Slicer4/trunk@15175 3bd1e089-480b-0410-8dfb-8563597acbee
parent 594f9326
......@@ -155,6 +155,21 @@ SET(CMAKE_MODULE_PATH
SET(Slicer_CMAKE_DIR "${Slicer_SOURCE_DIR}/CMake" CACHE INTERNAL "")
#-----------------------------------------------------------------------------
# Additional CXX/C Flags
#-----------------------------------------------------------------------------
SET(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C Flags")
MARK_AS_ADVANCED(ADDITIONAL_C_FLAGS)
SET(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags")
MARK_AS_ADVANCED(ADDITIONAL_CXX_FLAGS)
#-----------------------------------------------------------------------------
# Slicer C/CXX Flags
#-----------------------------------------------------------------------------
SET(Slicer_C_FLAGS "${ADDITIONAL_C_FLAGS}")
SET(Slicer_CXX_FLAGS "${ADDITIONAL_CXX_FLAGS}")
ENDIF()
# Superbuild script
#-----------------------------------------------------------------------------
......@@ -654,7 +669,13 @@ INSTALL(FILES
"${CMAKE_CURRENT_BINARY_DIR}/vtkSlicerVersionConfigure.h"
DESTINATION ${Slicer_INSTALL_INCLUDE_DIR} COMPONENT Development
)
#-----------------------------------------------------------------------------
# Set C/CXX Flags
#-----------------------------------------------------------------------------
SET(CMAKE_CXX_FLAGS ${Slicer_CXX_FLAGS} CACHE STRING "CMake C Flags" FORCE)
SET(CMAKE_C_FLAGS ${Slicer_C_FLAGS} CACHE STRING "CMake CXX Flags" FORCE)
#-----------------------------------------------------------------------------
# Generate SlicerVersion.txt
#-----------------------------------------------------------------------------
......
......@@ -256,6 +256,8 @@ ExternalProject_Add(${proj}
-DSubversion_SVN_EXECUTABLE:FILEPATH=${Subversion_SVN_EXECUTABLE}
-DGIT_EXECUTABLE:FILEPATH=${GIT_EXECUTABLE}
-DSlicer_SUPERBUILD:BOOL=OFF
-DSlicer_C_FLAGS:STRING=${Slicer_C_FLAGS}
-DSlicer_CXX_FLAGS:STRING=${Slicer_CXX_FLAGS}
# ITK
-DITK_DIR:PATH=${ITK_DIR}
# Teem
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment