# - find PTKPrivate libraries
#

# PTK_PRIVATE_SOURCE_FOUND
# PTK_PRIVATE_BINARY_FOUND
#
# PTK_PRIVATE_SOURCE_DIRECTORY
# PTK_PRIVATE_BINARY_DIRECTORY
#
# PTK_PRIVATE_INCLUDE_DIRECTORY
# PTK_PRIVATE_LIBRARY_DIRECTORY
#
# PTK_COMMUNICATION_LIBRARY
# PTK_CORE_LIBRARY
#
# PTK_PRIVATE_LIBRARIES
# PTK_PRIVATE_INCLUDES


SET( PTK_PRIVATE_SOURCE_FOUND "NO" )
SET( PTK_PRIVATE_BINARY_FOUND "NO" )
SET( PTK_PRIVATE_FOUND "NO" )


SET( PTK_PRIVATE_SOURCE_DIRECTORY  "$ENV{PTK_SVN}/ptk-$ENV{PTK_USER_CLASS}/ptk-private" )

IF( IS_DIRECTORY ${PTK_PRIVATE_SOURCE_DIRECTORY} )

  SET( PTK_PRIVATE_SOURCE_FOUND "YES" )
  SET( PTK_PRIVATE_FOUND "YES" )
  message( "found ptk-private source directory:" "${PTK_PRIVATE_SOURCE_DIRECTORY}" )

ELSE( IS_DIRECTORY ${PTK_PRIVATE_SOURCE_DIRECTORY} )

  SET( PTK_PRIVATE_BINARY_DIRECTORY  "$ENV{PTK_SVN}/ptk-$ENV{PTK_USER_CLASS}/ptk-private-binary" )
  SET( PTK_PRIVATE_INCLUDE_DIRECTORY  "${PTK_PRIVATE_BINARY_DIRECTORY}/include" )
  SET( PTK_PRIVATE_LIBRARY_DIRECTORY  "${PTK_PRIVATE_BINARY_DIRECTORY}/$ENV{PTK_OS}/lib" )

  #message( "PTK_PRIVATE_INCLUDE_DIRECTORY:" "${PTK_PRIVATE_INCLUDE_DIRECTORY}" )
  #message( "PTK_PRIVATE_LIBRARY_DIRECTORY:" "${PTK_PRIVATE_LIBRARY_DIRECTORY}" )

  FIND_LIBRARY( PTK_COMMUNICATION_LIBRARY
                ptk-communication libptk-communication
                HINTS  ${PTK_PRIVATE_LIBRARY_DIRECTORY} )

  FIND_LIBRARY( PTK_CORE_LIBRARY
                ptk-core libptk-core
                HINTS  ${PTK_PRIVATE_LIBRARY_DIRECTORY} )

  SET( PTK_PRIVATE_LIBRARIES ${PTK_CORE_LIBRARY} ${PTK_COMMUNICATION_LIBRARY} )
  SET( PTK_PRIVATE_INCLUDES ${PTK_PRIVATE_INCLUDE_DIRECTORY} )


  IF(PTK_PRIVATE_LIBRARIES)

    IF(PTK_PRIVATE_INCLUDES)

      SET( PTK_PRIVATE_BINARY_FOUND "YES" )
      SET( PTK_PRIVATE_FOUND "YES" )
    
    ENDIF(PTK_PRIVATE_INCLUDES)

  ENDIF(PTK_PRIVATE_LIBRARIES)

  message( "PTK_PRIVATE_BINARY_FOUND:" "${PTK_PRIVATE_BINARY_FOUND}" )
  message( "PTK_PRIVATE_LIBRARIES:" "${PTK_PRIVATE_LIBRARIES}" )
  message( "PTK_PRIVATE_INCLUDES:" "${PTK_PRIVATE_INCLUDES}" )


ENDIF( IS_DIRECTORY ${PTK_PRIVATE_SOURCE_DIRECTORY} )
