project(piintrospector)
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts")
set(PII_ROOT "../../pip/src_main/introspection")
pip_code_model(PII_CCM "${PII_ROOT}/piintrospection_server_p.h" "${PII_ROOT}/piintrospection_threads_p.h" OPTIONS "-DPIP_EXPORT" "-Es")
find_qt(${QtVersions} Core Gui)
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
qt_add_executable(${PROJECT_NAME} WIN32 out_CPP PII_CCM)
qt_target_link_libraries(${PROJECT_NAME} pip qad_utils qad_widgets qad_application piqt_utils)
qt_target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../")
message(STATUS "Building ${PROJECT_NAME}")
if(LIB)
	if(WIN32)
		qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${MINGW_BIN})
	else()
		if (DEFINED ANDROID_PLATFORM)
			qt_install(TARGETS ${PROJECT_NAME} DESTINATION ${ANDROID_SYSTEM_LIBRARY_PATH}/usr/bin)
		else()
			qt_install(TARGETS ${PROJECT_NAME} DESTINATION /usr/local/bin)
		endif()
	endif()
	#message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"")
else()
	qt_install(TARGETS ${PROJECT_NAME} DESTINATION bin)
	#message(STATUS "Install ${PROJECT_NAME} to local \"bin\"")
endif()
