#this is just a basic CMakeLists.txt, for more information see the cmake manpage

#add definitions, compiler switches, etc.
#ADD_DEFINITIONS(-Wall -O2)

INCLUDE_DIRECTORIES(..)

#build a shared library
#ADD_LIBRARY(irfpacso SHARED generalpacket.cpp packetbytearr.cpp packetint32arr.cpp PacketIntArr.cpp ByteSpectrum.cpp)
#TARGET_LINK_LIBRARIES(irfpacso crypto)
#build a static library
ADD_LIBRARY(irfpac STATIC generalpacket.cpp packetbytearr.cpp packetint32arr.cpp PacketIntArr.cpp ByteSpectrum.cpp)

IF (CMAKE_BUILD_TYPE STREQUAL "Debug")

#for testing the shared library you probably need some test app too
#you need cppunit library
ADD_EXECUTABLE(AllTestIrfPac AllTestIrfPac.cpp ByteSpectrum_test.cpp PacketIntArr_test.cpp PacketByteArr_test.cpp PacketInt32Arr_test.cpp)
TARGET_LINK_LIBRARIES(AllTestIrfPac irfpac crypto cppunit stdc++ )

ENDIF (CMAKE_BUILD_TYPE STREQUAL "Debug")


#for sample code, without cunit
ADD_EXECUTABLE(packetbytearr_sample packetbytearr_sample.cpp)
TARGET_LINK_LIBRARIES(packetbytearr_sample irfpac crypto stdc++)

#add an install target here
#INSTALL_FILES(...)
#INSTALL_PROGRAMS(...)
#INSTALL_TARGET(...)

INSTALL(TARGETS irfpac ARCHIVE DESTINATION ${HOME}/SARA/lib)
#INSTALL(TARGETS irfpacso LIBRARY DESTINATION ${HOME}/SARA/lib)
INSTALL(FILES PacketIntArr.h irfpac.h packetint32arr.h packetbytearr.h
	generalpacket.h
	DESTINATION ${HOME}/SARA/include/IrfPac)


