Added icons

git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@50 620bd6b2-0a58-f614-fd9a-1bd335dccda9
This commit is contained in:
matlabbe 2011-11-24 20:45:50 +00:00
parent a0afad0504
commit 8b12bd8bff
11 changed files with 210 additions and 129 deletions

View File

@ -93,13 +93,13 @@ IF(WIN32)
SET(CPACK_GENERATOR "NSIS;ZIP") SET(CPACK_GENERATOR "NSIS;ZIP")
SET(CPACK_SOURCE_GENERATOR "ZIP") SET(CPACK_SOURCE_GENERATOR "ZIP")
SET(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME}") SET(CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME}")
#SET(ICON_PATH "${PROJECT_SOURCE_DIR}/app/src/${PROJECT_NAME}.ico") SET(ICON_PATH "${PROJECT_SOURCE_DIR}/app/${PROJECT_NAME}.ico")
#SET(CPACK_NSIS_MUI_ICON ${ICON_PATH}) SET(CPACK_NSIS_MUI_ICON ${ICON_PATH})
#SET(CPACK_NSIS_MUI_UNIICON ${ICON_PATH}) SET(CPACK_NSIS_MUI_UNIICON ${ICON_PATH})
SET(CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME}") SET(CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME}")
SET(CPACK_NSIS_CONTACT ${CPACK_PACKAGE_CONTACT}) SET(CPACK_NSIS_CONTACT ${CPACK_PACKAGE_CONTACT})
# Set the icon used for the Windows "Add or Remove Programs" tool. # Set the icon used for the Windows "Add or Remove Programs" tool.
#SET(CPACK_NSIS_INSTALLED_ICON_NAME bin\\\\${PROJECT_NAME}.exe) SET(CPACK_NSIS_INSTALLED_ICON_NAME bin\\\\${PROJECT_NAME}.exe)
SET(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}" "${PROJECT_NAME}" ${CPACK_PACKAGE_EXECUTABLES}) SET(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}" "${PROJECT_NAME}" ${CPACK_PACKAGE_EXECUTABLES})
SET(CPACK_CREATE_DESKTOP_LINKS "${PROJECT_NAME}" ${CPACK_CREATE_DESKTOP_LINKS}) SET(CPACK_CREATE_DESKTOP_LINKS "${PROJECT_NAME}" ${CPACK_CREATE_DESKTOP_LINKS})
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
@ -115,7 +115,7 @@ ELSEIF(APPLE)
SET(CPACK_SOURCE_GENERATOR "TBZ2") SET(CPACK_SOURCE_GENERATOR "TBZ2")
#SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/app/src/${PROJECT_NAME}.icns") SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/app/${PROJECT_NAME}.icns")
ENDIF() ENDIF()
INCLUDE(CPack) INCLUDE(CPack)

View File

@ -16,12 +16,12 @@ SET(uis
../src/ui/aboutDialog.ui ../src/ui/aboutDialog.ui
) )
#SET(qrc SET(qrc
# ./GuiLib.qrc ../src/resources.qrc
#) )
# generate rules for building source files from the resources # generate rules for building source files from the resources
#QT4_ADD_RESOURCES(srcs_qrc ${qrc}) QT4_ADD_RESOURCES(srcs_qrc ${qrc})
#Generate .h files from the .ui files #Generate .h files from the .ui files
QT4_WRAP_UI(moc_uis ${uis}) QT4_WRAP_UI(moc_uis ${uis})
@ -44,7 +44,7 @@ SET(SRC_FILES
../src/AboutDialog.cpp ../src/AboutDialog.cpp
${moc_srcs} ${moc_srcs}
${moc_uis} ${moc_uis}
#${srcs_qrc} ${srcs_qrc}
) )
SET(INCLUDE_DIRS SET(INCLUDE_DIRS
@ -64,6 +64,29 @@ SET(LIBRARIES
#include files #include files
INCLUDE_DIRECTORIES(${INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${INCLUDE_DIRS})
# For Apple set the icns file containing icons
IF(APPLE AND BUILD_AS_BUNDLE)
# set how it shows up in the Info.plist file
SET(MACOSX_BUNDLE_ICON_FILE ${PROJECT_NAME}.icns)
# set where in the bundle to put the icns file
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
# include the icns file in the target
SET(SRC_FILES ${SRC_FILES} ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.icns)
ENDIF(APPLE AND BUILD_AS_BUNDLE)
# Add exe icon resource
IF(WIN32)
IF( MINGW )
# resource compilation for MinGW
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/AppIco.o
COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/AppIco.o )
SET(SRC_FILES ${SRC_FILES} ${CMAKE_CURRENT_BINARY_DIR}/AppIco.o)
ELSE( MINGW )
SET(SRC_FILES ${SRC_FILES} ${PROJECT_NAME}.rc)
ENDIF( MINGW )
ENDIF(WIN32)
# create an executable file # create an executable file
IF(APPLE AND BUILD_AS_BUNDLE) IF(APPLE AND BUILD_AS_BUNDLE)
ADD_EXECUTABLE(find_object MACOSX_BUNDLE ${SRC_FILES}) ADD_EXECUTABLE(find_object MACOSX_BUNDLE ${SRC_FILES})

BIN
app/Find-Object.icns Normal file

Binary file not shown.

BIN
app/Find-Object.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

1
app/Find-Object.rc Normal file
View File

@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "Find-Object.ico"

27
cmake_uninstall.cmake.in Normal file
View File

@ -0,0 +1,27 @@
# -----------------------------------------------
# File that provides "make uninstall" target
# We use the file 'install_manifest.txt'
# -----------------------------------------------
IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
STRING(REGEX REPLACE "\n" ";" files "${files}")
FOREACH(file ${files})
MESSAGE(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
IF(EXISTS "$ENV{DESTDIR}${file}")
EXEC_PROGRAM(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
)
IF(NOT "${rm_retval}" STREQUAL 0)
MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
ENDIF(NOT "${rm_retval}" STREQUAL 0)
ELSE(EXISTS "$ENV{DESTDIR}${file}")
MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
ENDIF(EXISTS "$ENV{DESTDIR}${file}")
ENDFOREACH(file)

View File

@ -175,7 +175,7 @@ void AddObjectDialog::setState(int state)
delete extractor; delete extractor;
if(selectedKeypoints.size() != (unsigned int)descriptors.rows) if(selectedKeypoints.size() != (unsigned int)descriptors.rows)
{ {
printf("ERROR : keypoints=%lu != descriptors=%d\n", selectedKeypoints.size(), descriptors.rows); printf("ERROR : keypoints=%d != descriptors=%d\n", (int)selectedKeypoints.size(), descriptors.rows);
} }
CvRect roi = computeROI(selectedKeypoints); CvRect roi = computeROI(selectedKeypoints);

View File

@ -351,7 +351,7 @@ void MainWindow::update(const cv::Mat & image)
delete extractor; delete extractor;
if((int)keypoints.size() != descriptors.rows) if((int)keypoints.size() != descriptors.rows)
{ {
printf("ERROR : kpt=%lu != descriptors=%d\n", keypoints.size(), descriptors.rows); printf("ERROR : kpt=%d != descriptors=%d\n", (int)keypoints.size(), descriptors.rows);
} }
if(imageGrayScale) if(imageGrayScale)
{ {

5
src/resources.qrc Normal file
View File

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="images">
<file>resources/Find-Object.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>404</width> <width>404</width>
<height>257</height> <height>223</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -20,6 +20,27 @@
<string>About Find-Object</string> <string>About Find-Object</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_7">
<property name="maximumSize">
<size>
<width>100</width>
<height>100</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../resources.qrc">:/images/resources/Find-Object.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item> <item>
<widget class="QFrame" name="frame"> <widget class="QFrame" name="frame">
<property name="frameShape"> <property name="frameShape">
@ -157,6 +178,8 @@ p, li { white-space: pre-wrap; }
</layout> </layout>
</widget> </widget>
</item> </item>
</layout>
</item>
<item> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation"> <property name="orientation">
@ -170,7 +193,9 @@ p, li { white-space: pre-wrap; }
</layout> </layout>
</widget> </widget>
<resources> <resources>
<include location="../GuiLib.qrc"/> <include location="../resources.qrc"/>
<include location="../resources.qrc"/>
<include location="../resources.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>