[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[vidalia-svn] r2335: Move VidaliaMacros.cmake into cmake/, so FindOpenSSL.cmake i (in vidalia/trunk: . cmake)



Author: edmanm
Date: 2008-01-28 21:48:11 -0500 (Mon, 28 Jan 2008)
New Revision: 2335

Added:
   vidalia/trunk/cmake/VidaliaMacros.cmake
Removed:
   vidalia/trunk/VidaliaMacros.cmake
Modified:
   vidalia/trunk/CMakeLists.txt
Log:
Move VidaliaMacros.cmake into cmake/, so FindOpenSSL.cmake isn't so lonely.


Modified: vidalia/trunk/CMakeLists.txt
===================================================================
--- vidalia/trunk/CMakeLists.txt	2008-01-29 02:33:38 UTC (rev 2334)
+++ vidalia/trunk/CMakeLists.txt	2008-01-29 02:48:11 UTC (rev 2335)
@@ -41,7 +41,7 @@
 set(QT_USE_QTNETWORK  true)
 set(QT_USE_QTXML      true)
 include(${QT_USE_FILE})
-include(VidaliaMacros.cmake)
+include(${CMAKE_SOURCE_DIR}/cmake/VidaliaMacros.cmake)
 include(CheckIncludeFileCXX)
 include(CPack)
 

Deleted: vidalia/trunk/VidaliaMacros.cmake

Copied: vidalia/trunk/cmake/VidaliaMacros.cmake (from rev 2334, vidalia/trunk/VidaliaMacros.cmake)
===================================================================
--- vidalia/trunk/cmake/VidaliaMacros.cmake	                        (rev 0)
+++ vidalia/trunk/cmake/VidaliaMacros.cmake	2008-01-29 02:48:11 UTC (rev 2335)
@@ -0,0 +1,98 @@
+#####################################################################
+#  $Id$
+# 
+#  Vidalia is distributed under the following license:
+#
+#  Copyright (C) 2006-2007,  Matt Edman, Justin Hipple
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  
+#  02110-1301, USA.
+#####################################################################
+
+
+## Search for lrelease
+find_program(QT_LRELEASE_EXECUTABLE NAMES lrelease-qt4 lrelease
+  PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH
+)
+if (NOT QT_LRELEASE_EXECUTABLE)
+  message(FATAL_ERROR
+    "Vidalia could not find lrelease. Please make sure Qt >= ${QT_MIN_VERSION} is installed."
+  )
+endif(NOT QT_LRELEASE_EXECUTABLE)
+
+
+## Search for lupdate
+find_program(QT_LUPDATE_EXECUTABLE NAMES lupdate-qt4 lupdate
+  PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH
+)
+if (NOT QT_LUPDATE_EXECUTABLE)
+  message(FATAL_ERROR
+    "Vidalia could not find lupdate. Please make sure Qt >= ${QT_MIN_VERSION} is installed."
+  )
+endif(NOT QT_LUPDATE_EXECUTABLE)
+
+
+## We need windres.exe when building on Win32 to compile the .rc file
+if (WIN32)
+  find_program(WIN32_WINDRES_EXECUTABLE  NAMES windres.exe ${QT_BINARY_DIR})
+  if (NOT WIN32_WINDRES_EXECUTABLE)
+    message(FATAL_ERR
+      "Vidalia could not find windres. Please make sure Qt is installed and its bin directory is in your PATH environment variable."
+    )
+  endif(NOT WIN32_WINDRES_EXECUTABLE)
+endif(WIN32)
+
+
+## Wraps the supplied .ts files in lrelease commands
+macro(QT4_ADD_TRANSLATIONS outfiles)
+  foreach (it ${ARGN})
+    get_filename_component(it ${it} ABSOLUTE)
+    get_filename_component(outfile ${it} NAME_WE)
+
+    ## XXX: Ideally we would output the .qm files to CMAKE_CURRENT_BINARY_DIR,
+    ##      but then RCC can't find them when doing out-of-source builds. Is
+    ##      there an easy fix for this?
+    set(outfile ${CMAKE_CURRENT_SOURCE_DIR}/${outfile}.qm)
+    add_custom_command(OUTPUT ${outfile}
+      COMMAND ${QT_LRELEASE_EXECUTABLE}
+      ARGS -compress -silent -nounfinished ${it} -qm ${outfile}
+      MAIN_DEPENDENCY ${it}
+    )
+    set(${outfiles} ${${outfiles}} ${outfile})
+  endforeach(it)
+endmacro(QT4_ADD_TRANSLATIONS)
+
+
+if (WIN32)
+  ## Wraps the supplied .rc files in windres commands
+  macro(WIN32_WRAP_RC outfiles)
+    foreach(it ${ARGN})
+      get_filename_component(it      ${it} ABSOLUTE)
+      get_filename_component(outfile ${it} NAME_WE)
+      get_filename_component(rc_path ${it} PATH)
+      
+      set(outfile
+        ${CMAKE_CURRENT_BINARY_DIR}/${outfile}_res${CMAKE_CXX_OUTPUT_EXTENSION}
+      )
+      add_custom_command(OUTPUT ${outfile}
+        COMMAND ${WIN32_WINDRES_EXECUTABLE}
+        ARGS -i ${it} -o ${outfile} --include-dir=${rc_path}
+        MAIN_DEPENDENCY ${it}
+      )
+      set(${outfiles} ${${outfiles}} ${outfile})
+    endforeach(it)
+  endmacro(WIN32_WRAP_RC)
+endif(WIN32)
+