#.............................................................
#. snakeoil (c) Alexis Constantin Link
#. Distributed under the MIT license
#.............................................................

#
#
#

set( CMAKE_DEBUG_POSTFIX d )

if( CMAKE_RUNTIME_OUTPUT_DIRECTORY )
  message( "SNAKEOIL: Omiting output directories, which are set by the user" )
  message( "Runtime: " ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
  return()
endif()

if( SNAKEOIL_LIBRARY_BUILD_SHARED )
set( SNAKEOIL_LIB_OUTPUT_PATH ${SNAKEOIL_BINARY_DIR}/build/shared )
else()
set( SNAKEOIL_LIB_OUTPUT_PATH ${SNAKEOIL_BINARY_DIR}/build/static)
endif()

message( STATUS "output library path: " ${SNAKEOIL_LIB_OUTPUT_PATH}) 

set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SNAKEOIL_LIB_OUTPUT_PATH} )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SNAKEOIL_LIB_OUTPUT_PATH} )
set( CMAKE_PACKAGE_OUTPUT_DIRECTORY ${SNAKEOIL_LIB_OUTPUT_PATH} )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SNAKEOIL_LIB_OUTPUT_PATH} )
set( CMAKE_PDB_OUTPUT_DIRECTORY ${SNAKEOIL_LIB_OUTPUT_PATH} )

foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
    string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
    set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${SNAKEOIL_LIB_OUTPUT_PATH} )
    set( CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${SNAKEOIL_LIB_OUTPUT_PATH} )
    set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${SNAKEOIL_LIB_OUTPUT_PATH} )
    set( CMAKE_PACKAGE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${SNAKEOIL_LIB_OUTPUT_PATH} )
    set( CMAKE_PDB_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${SNAKEOIL_LIB_OUTPUT_PATH} )
endforeach()




