Commits (8)
include (MSVCMacros)
include (VCIPaths)
if (EXISTS ${CMAKE_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.cmake)
include (${CMAKE_SOURCE_DIR}/${CMAKE_PROJECT_NAME}.cmake)
endif ()
......
......@@ -152,52 +152,61 @@ if (UNIX)
# Process the additional flags:
################################################################################
# Add the debug flags
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_DEBUG_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_DEBUG} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
# Add the release flags
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_RELEASE_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_RELEASE} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
# Add the debug flags
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_DEBUG_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_DEBUG} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
cmake_policy(SET CMP0057 NEW)
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
IF ( "CXX" IN_LIST languages )
# Add the debug flags
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_DEBUG_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_DEBUG} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
# Add the release flags
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_RELEASE_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_RELEASE} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_CXX_FLAGS} ${ADDITIONAL_CXX_RELWITHDEBINFO_FLAGS} )
list (FIND ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
ENDIF()
# Add the release flags
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_RELEASE_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_RELEASE} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_RELWITHDEBINFO_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
IF ( "C" IN_LIST languages )
# Add the debug flags
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_DEBUG_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_DEBUG} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${flag} ")
endif()
endforeach()
# Add the release flags
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_RELEASE_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_RELEASE} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${flag} ")
endif()
endforeach()
# Add the release with debug info flags
foreach( flag ${ADDITIONAL_C_FLAGS} ${ADDITIONAL_C_RELWITHDEBINFO_FLAGS} )
list (FIND ${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} _index)
if (${_index} EQUAL -1)
set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${flag} ")
endif()
endforeach()
endif()
endif ()
......@@ -23,7 +23,11 @@ endfunction ()
# info header
function (vci_print_configure_header _id _name)
vci_format_string ("${_name}" 40 _project)
vci_format_string ("${${_id}_VERSION}" 40 _version)
if ( ${_id}_VERSION )
vci_format_string ("${${_id}_VERSION}" 40 _version)
else()
vci_format_string ("${PROJECT_VERSION}" 40 _version)
endif()
vci_color_message ("\n${_escape}[40;37m************************************************************${_escape}[0m")
vci_color_message ("${_escape}[40;37m* ${_escape}[1;31mVCI ${_escape}[0;40;34mBuildsystem${_escape}[0m${_escape}[40;37m *${_escape}[0m")
vci_color_message ("${_escape}[40;37m* *${_escape}[0m")
......
################################################################################
# Custom search paths for libraries
################################################################################
if ( WIN32 )
find_path(VCI_WINDOWS_LIBS_DIR general/README.md
DOC "Default library search dir for on windows."
HINTS "C:/libs/"
"D:/libs/"
"E:/libs/"
"R:/libs/")
if (VCI_WINDOWS_LIBS_DIR)
# add path to general libs
list(APPEND CMAKE_PREFIX_PATH "${VCI_WINDOWS_LIBS_DIR}/general/")
# add path for Visual Studio specific libraries
# TODO: remove VS_SEARCH_PATH when the finders do not depend on it anymore
if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*Win64" )
list(APPEND CMAKE_PREFIX_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2012/x64/")
SET(VS_SEARCH_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2012/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
list(APPEND CMAKE_PREFIX_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2012/x32/")
SET(VS_SEARCH_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2012/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*Win64" )
list(APPEND CMAKE_PREFIX_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2013/x64/")
SET(VS_SEARCH_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2013/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*" )
list(APPEND CMAKE_PREFIX_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2013/x32/")
SET(VS_SEARCH_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2013/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*Win64" )
list(APPEND CMAKE_PREFIX_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2015/x64/")
SET(VS_SEARCH_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2015/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*" )
list(APPEND CMAKE_PREFIX_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2015/x32/")
SET(VS_SEARCH_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2015/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*Win64" )
list(APPEND CMAKE_PREFIX_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2017/x64/")
SET(VS_SEARCH_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2017/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
list(APPEND CMAKE_PREFIX_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2017/x32/")
SET(VS_SEARCH_PATH "${VCI_WINDOWS_LIBS_DIR}/vs2017/x32/")
endif()
endif()
endif( WIN32 )