Commits

Vincent Rabeux committed ce2bd0a

Packaging for Windows 7.

Comments (0)

Files changed (2)

documentImageCreator/src/gui/AncientDocumentEditor/CMakeLists.txt

 #  ELSE( APPLE )
     #ADD_EXECUTABLE(${PROGNAME} ${AncientDocumentCreator_sources}  ${MOC} ${RCS} ${UI})
 SET(ALL_SOURCES ${AncientDocumentCreator_sources}  ${MOC} ${RCS} ${UI} ${APP_ICON})
-ADD_EXECUTABLE(${PROGNAME} MACOSX_BUNDLE
+ADD_EXECUTABLE(${PROGNAME} MACOSX_BUNDLE WIN32
         ${ALL_SOURCES}
 )
 
 RUNTIME DESTINATION bin COMPONENT Runtime
 )
 
-IF(APPLE)
+IF(APPLE OR WIN32)
 #--------------------------------------------------------------------------------
 # On copie le dossier de plugins QT dans le bundle courant
 INSTALL(DIRECTORY "${QT_PLUGINS_DIR}/imageformats" DESTINATION ${plugin_dest_dir}/plugins COMPONENT Runtime)
 MESSAGE(${Lipsum4Qt_LIBRARIES})
 MESSAGE(${NAME}.app/Contents/Frameworks)
 
-install (FILES ${Lipsum4Qt_LIBRARIES} DESTINATION ${NAME}.app/Contents/Frameworks)
+endif(APPLE OR WIN32)
+
+IF(APPLE)
+install (DIRECTORY ${Lipsum4Qt_LIBRARIES} DESTINATION ${NAME}.app/Contents/Frameworks)
 
 #--------------------------------------------------------------------------------
 # On copie le qt_menu.nib de QT dans le bundle courant
 install (DIRECTORY ${xmlcheckerfolder} DESTINATION ${NAME}.app/Contents/Resources)
 install (DIRECTORY ${formatsfolder} DESTINATION ${NAME}.app/Contents/Resources)
 
+endif(APPLE)
+
 # Répèrtoire à regarder pour les dépendance
-SET(DIRS ${QT_LIBRARY_DIRS} ${EXTRA_LIBS} /usr/local/lib/)
+message("QT LIB DIRS : " ${QT_LIBRARY_DIRS})
+SET(DIRS ${QT_LIBRARY_DIRS} ${EXTRA_LIBS})
 
 # on insert du code cmake pour utiliser BundleUtilities dans le script d'installation
 INSTALL(CODE "
 # on utilise cpack : "cpack -G DragNDrop CPackConfig.cmake" sur mac os x
 # le CPackConfig.cmake est créer par un premier cmake
 # Command osx /Applications/CMake\ 2.8-1.app/Contents/bin/cpack -G DragNDrop CPackConfig.cmake
+
+IF(APPLE)
+
 SET(CPACK_GENERATOR "DragNDrop")
 #set(CPACK_BINARY_DRAGNDROP ON)
 

documentImageCreator/src/gui/AncientDocumentEditor/cmake/Modules/FindLipsum4Qt.cmake

+# - Try to find Lipsum4Qt
+# Once done, this will define
+#
+#  Lipsum4Qt_FOUND - system has Lipsum4Qt
+#  Lipsum4Qt_INCLUDE_DIRS - the Lipsum4Qt include directories
+#  Lipsum4Qt_LIBRARIES - link these to use Lipsum4Qt
+
+include(LibFindMacros)
+
+if (Lipsum4Qt_INCLUDE_DIR AND Lipsum4Qt_LIBRARY)
+
+  # Already in cache
+  set (Lipsum4Qt_FOUND TRUE)
+
+else (Lipsum4Qt_INCLUDE_DIR AND Lipsum4Qt_LIBRARY)
+
+	if(NOT WIN32)
+		# Use pkg-config to get hints about paths
+		libfind_pkg_check_modules(Lipsum4Qt_PKGCONF Lipsum4Qt)
+    endif()
+	
+	if(WIN32)
+		# the hints
+		SET(Lipsum4Qt_POSSIBLE_ROOT_DIRS
+			"$ENV{DOQUBOOK_ROOT_DIR}"
+			"$ENV{SystemDrive}/Lipsum4Qt"                    
+			"$ENV{SystemDrive}/Program Files/Lipsum4Qt"       
+			"$ENV{SystemDrive}/Program Files (x86)/Lipsum4Qt"
+        )
+		# find the right and only path
+		FIND_PATH(Lipsum4Qt_ROOT_DIR
+          NAMES include/Lipsum4Qt/Lipsum4Qt.hpp
+          PATHS ${Lipsum4Qt_POSSIBLE_ROOT_DIRS}
+        )
+	
+		# libs and includes
+		SET(Lipsum4Qt_LIB_SEARCH_PATH 
+				"${Lipsum4Qt_ROOT_DIR}/bin"
+				"${Lipsum4Qt_ROOT_DIR}/lib"
+		)
+		SET(Lipsum4Qt_INCLUDE_SEARCH_PATH "${Lipsum4Qt_ROOT_DIR}/include")
+	endif()
+	
+	message(Looking lib in  ${Lipsum4Qt_LIB_SEARCH_PATH})
+	find_library (Lipsum4Qt_LIBRARIES
+		NAMES
+		Lipsum4Qt
+		PATHS
+		${PC_Lipsum4Qt_LIBRARY_DIRS}
+		${Lipsum4Qt_FRAMEWORKS}
+		${LIB_INSTALL_DIR}  
+		${Lipsum4Qt_LIB_SEARCH_PATH}
+		${Lipsum4Qt_PKGCONF_LIBRARY_DIRS}
+	)
+
+
+	find_path (Lipsum4Qt_INCLUDE_DIR
+		NAMES
+		Lipsum4Qt/Lipsum4Qt.hpp
+		PATHS
+		${PC_Lipsum4Qt_INCLUDE_DIRS}
+		${INCLUDE_INSTALL_DIR}
+		${Lipsum4Qt_FRAMEWORKS}
+		${Lipsum4Qt_INCLUDE_SEARCH_PATH}
+		${Lipsum4Qt_PKGCONF_INCLUDE_DIRS}
+	)
+	
+	include(FindPackageHandleStandardArgs)
+	find_package_handle_standard_args(Lipsum4Qt DEFAULT_MSG Lipsum4Qt_LIBRARIES Lipsum4Qt_INCLUDE_DIR)
+
+
+endif(Lipsum4Qt_INCLUDE_DIR AND Lipsum4Qt_LIBRARY)
+
+set(Lipsum4Qt_INCLUDE_DIRS ${Lipsum4Qt_INCLUDE_DIRS} ${Lipsum4Qt_INCLUDE_DIR})
+set(Lipsum4Qt_LIBRARIES ${Lipsum4Qt_LIBRARIES} ${Lipsum4Qt_LIBRARIES})
+
+# Set the include dir variables and the libraries and let libfind_process do the rest.
+# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
+#set(Lipsum4Qt_PROCESS_INCLUDES Lipsum4Qt_INCLUDE_DIR Lipsum4Qt_INCLUDE_DIRS)
+#set(Lipsum4Qt_PROCESS_LIBS Lipsum4Qt_LIBRARY Lipsum4Qt_LIBRARIES)
+#libfind_process(Lipsum4Qt)
+
+MARK_AS_ADVANCED(Lipsum4Qt_INCLUDE_DIRS Lipsum4Qt_LIBRARIES)