cmake_minimum_required(VERSION 2.6)
project(libs)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
if (${WIN32})
	find_package(MinGW REQUIRED)
endif (${WIN32})
#find_package(Qt REQUIRED)
set(LIB 1)
set(USB 1)
set(ICU 1)
set(CRYPT 1)
set(LIBPROJECT 1)
set(PIP_LIBRARY pip)
set(PIP_FOLDERS "." "core" "containers" "thread" "system" "io" "console" "math" "code")

foreach(F ${PIP_FOLDERS})
	set(PIP_INCLUDES ${PIP_INCLUDES} "../pip/src/${F}")
endforeach(F)
#message(STATUS "PIP includes = ${PIP_INCLUDES}")

set(LIST_LIBS pip qad_widgets qad_utils qad_application qad_blockview qad_graphic qad_sql_table piqt mbricks kx_utils piqt_utils touch_widgets qglview)

foreach(L ${LIST_LIBS})
	add_subdirectory(${L})
	include_directories(${L})
endforeach(L)

if (${WIN32})
	get_filename_component(QTDIR ${QT_QMAKE_EXECUTABLE} PATH)
	install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pip/libpip.dll" DESTINATION ${QTDIR})
	install(FILES "FindMinGW.cmake" DESTINATION ${CMAKE_ROOT}/Modules)
endif (${WIN32})
