CMAKE_MINIMUM_REQUIRED(VERSION 2.4.3 FATAL_ERROR)

set(PACKAGE_NAME Utils)

MESSAGE("cmake installation for package: " ${PACKAGE_NAME})


set(INCLUDE_DIRECTORIES
${TOP_DIR}
)

include_directories( ${INCLUDE_DIRECTORIES})


AUX_SOURCE_DIRECTORY("." SRC)
Set(CCSRC "")

FOREACH (THEFILE ${SRC})
 IF (NOT ${THEFILE} MATCHES "(.*)App(.*)")
  SET (CCSRC ${CCSRC} ${THEFILE})
 ENDIF()
ENDFOREACH(THEFILE)

# BUILD_SHARED_LIBS controls the behavior of ADD_LIBRARY if STATIC/SHARED omitted
IF( PAWIAN_STATIC )
        ADD_LIBRARY ( ${PACKAGE_NAME} STATIC ${CCSRC} )
ELSE()
        ADD_LIBRARY ( ${PACKAGE_NAME} SHARED ${CCSRC} )
ENDIF( PAWIAN_STATIC )


INSTALL (TARGETS ${PACKAGE_NAME} DESTINATION ${CMAKE_BINARY_DIR}/lib)

if(COMMAND cmake_policy)
   cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)

# SET (EXECUTABLENAME PdtTestApp)
# ADD_EXECUTABLE( ${EXECUTABLENAME}
#   PdtTestApp.cc
# )

target_link_libraries(${EXECUTABLENAME} Utils)

INSTALL ( TARGETS ${EXECUTABLENAME} DESTINATION bin/${EXECUTABLENAME})

