From: <ai...@us...> - 2009-05-01 22:49:10
|
Revision: 9873 http://plplot.svn.sourceforge.net/plplot/?rev=9873&view=rev Author: airwin Date: 2009-05-01 22:49:09 +0000 (Fri, 01 May 2009) Log Message: ----------- Make changes to follow what is done for Fortran and Ada for CMake-2.6.x. The result is that D examples now build properly in the build tree with all rpath issues automatically taken care of on Linux. Modified Paths: -------------- trunk/cmake/modules/CMakeDCompiler.cmake.in trunk/cmake/modules/CMakeDInformation.cmake Modified: trunk/cmake/modules/CMakeDCompiler.cmake.in =================================================================== --- trunk/cmake/modules/CMakeDCompiler.cmake.in 2009-05-01 18:42:33 UTC (rev 9872) +++ trunk/cmake/modules/CMakeDCompiler.cmake.in 2009-05-01 22:49:09 UTC (rev 9873) @@ -40,6 +40,7 @@ ELSE(UNIX) SET(CMAKE_D_OUTPUT_EXTENSION .obj) ENDIF(UNIX) +SET(CMAKE_D_OUTPUT_EXTENSION_REPLACE 1) # save the size of void* in case where cache is removed # and the this file is still around #SET(CMAKE_SIZEOF_VOID_P @CMAKE_SIZEOF_VOID_P@) Modified: trunk/cmake/modules/CMakeDInformation.cmake =================================================================== --- trunk/cmake/modules/CMakeDInformation.cmake 2009-05-01 18:42:33 UTC (rev 9872) +++ trunk/cmake/modules/CMakeDInformation.cmake 2009-05-01 22:49:09 UTC (rev 9873) @@ -40,14 +40,74 @@ INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_D}) ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE_D) -# for most systems a module is the same as a shared library -# so unless the variable CMAKE_MODULE_EXISTS is set just -# copy the values from the LIBRARY variables -IF(NOT CMAKE_MODULE_EXISTS) - SET(CMAKE_SHARED_MODULE_D_FLAGS ${CMAKE_SHARED_LIBRARY_D_FLAGS}) - SET(CMAKE_SHARED_MODULE_CREATE_D_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_D_FLAGS}) -ENDIF(NOT CMAKE_MODULE_EXISTS) +# Create a set of shared library variable specific to D +# For 90% of the systems, these are the same flags as the C versions +# so if these are not set just copy the flags from the c version +IF(NOT CMAKE_SHARED_LIBRARY_CREATE_D_FLAGS) + SET(CMAKE_SHARED_LIBRARY_CREATE_D_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_D_FLAGS) +IF(NOT CMAKE_SHARED_LIBRARY_D_FLAGS) + SET(CMAKE_SHARED_LIBRARY_D_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_D_FLAGS) + +IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_D_FLAGS) + SET(CMAKE_SHARED_LIBRARY_LINK_D_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) +ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_D_FLAGS) + +IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_D_FLAG) + SET(CMAKE_SHARED_LIBRARY_RUNTIME_D_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_D_FLAG) + +IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_D_FLAG_SEP) + SET(CMAKE_SHARED_LIBRARY_RUNTIME_D_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_D_FLAG_SEP) + +IF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_D_FLAG) + SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_D_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_D_FLAG) + +# repeat for modules +IF(NOT CMAKE_SHARED_MODULE_CREATE_D_FLAGS) + SET(CMAKE_SHARED_MODULE_CREATE_D_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) +ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_D_FLAGS) + +IF(NOT CMAKE_SHARED_MODULE_D_FLAGS) + SET(CMAKE_SHARED_MODULE_D_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS}) +ENDIF(NOT CMAKE_SHARED_MODULE_D_FLAGS) + +IF(NOT CMAKE_SHARED_MODULE_RUNTIME_D_FLAG) + SET(CMAKE_SHARED_MODULE_RUNTIME_D_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG}) +ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_D_FLAG) + +IF(NOT CMAKE_SHARED_MODULE_RUNTIME_D_FLAG_SEP) + SET(CMAKE_SHARED_MODULE_RUNTIME_D_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG_SEP}) +ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_D_FLAG_SEP) + +IF(NOT CMAKE_EXECUTABLE_RUNTIME_D_FLAG) + SET(CMAKE_EXECUTABLE_RUNTIME_D_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_D_FLAG}) +ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_D_FLAG) + +IF(NOT CMAKE_EXECUTABLE_RUNTIME_D_FLAG_SEP) + SET(CMAKE_EXECUTABLE_RUNTIME_D_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_D_FLAG_SEP}) +ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_D_FLAG_SEP) + +IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_D_FLAG) + SET(CMAKE_EXECUTABLE_RPATH_LINK_D_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_D_FLAG}) +ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_D_FLAG) + +IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_D_WITH_RUNTIME_PATH) + SET(CMAKE_SHARED_LIBRARY_LINK_D_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH}) +ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_D_WITH_RUNTIME_PATH) + +IF(NOT CMAKE_INCLUDE_FLAG_D) + SET(CMAKE_INCLUDE_FLAG_D ${CMAKE_INCLUDE_FLAG_C}) +ENDIF(NOT CMAKE_INCLUDE_FLAG_D) + +IF(NOT CMAKE_INCLUDE_FLAG_SEP_D) + SET(CMAKE_INCLUDE_FLAG_SEP_D ${CMAKE_INCLUDE_FLAG_SEP_C}) +ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_D) + SET (CMAKE_D_FLAGS "$ENV{CFLAGS} ${CMAKE_D_FLAGS_INIT}" CACHE STRING "Flags for D compiler.") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <arj...@us...> - 2009-05-08 04:27:02
|
Revision: 9937 http://plplot.svn.sourceforge.net/plplot/?rev=9937&view=rev Author: arjenmarkus Date: 2009-05-08 04:27:00 +0000 (Fri, 08 May 2009) Log Message: ----------- Added logic to determine if a separate library must be created for supporting command-line options in Fortran. The test is heuristic for the moment - that is: needed for dynamic libraries, built on Cygwin/MinGW/MSYS. Modified Paths: -------------- trunk/cmake/modules/TestF77CmdLine.cmake trunk/cmake/modules/fortran.cmake Modified: trunk/cmake/modules/TestF77CmdLine.cmake =================================================================== --- trunk/cmake/modules/TestF77CmdLine.cmake 2009-05-07 18:16:53 UTC (rev 9936) +++ trunk/cmake/modules/TestF77CmdLine.cmake 2009-05-08 04:27:00 UTC (rev 9937) @@ -52,3 +52,19 @@ ENDIF (CMAKE_F77_CMD_LINE) ENDIF(NOT DEFINED CMAKE_F77_CMD_LINE) +# On some Windows platforms the plparseopts routine should be in a +# static library + +SET(STATIC OFF) +IF(WIN32) + IF(MINGW OR CYGWIN) + IF(BUILD_SHARED_LIBS) + SET(STATIC ON) + ENDIF(BUILD_SHARED_LIBS) + ENDIF(MINGW OR CYGWIN) +ENDIF(WIN32) +IF(STATIC) + SET(STATIC_OPTS ON CACHE BOOL "Command-line parsing in static library") +ELSE(STATIC) + SET(STATIC_OPTS OFF CACHE BOOL "Command-line parsing in static library") +ENDIF(STATIC) Modified: trunk/cmake/modules/fortran.cmake =================================================================== --- trunk/cmake/modules/fortran.cmake 2009-05-07 18:16:53 UTC (rev 9936) +++ trunk/cmake/modules/fortran.cmake 2009-05-08 04:27:00 UTC (rev 9937) @@ -57,10 +57,8 @@ # Set installation location for f95 modules. set(F95_MOD_DIR ${LIB_DIR}/fortran/modules/${PACKAGE}) - # Check if f77 command line parsing is possible - if(ENABLE_f77) - include(TestF77CmdLine) - endif(ENABLE_f77) + # Check if f77/f95 style command line parsing is possible + include(TestF77CmdLine) # Check if isnan is available as an fortran function include(TestFortranIsnan) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2009-05-11 23:05:17
|
Revision: 9967 http://plplot.svn.sourceforge.net/plplot/?rev=9967&view=rev Author: airwin Date: 2009-05-11 23:05:09 +0000 (Mon, 11 May 2009) Log Message: ----------- Go back to Andrew's general fix for the possibility of debug or optimized keywords in library lists being exported to *.pc files since that is a better solution than mine which made some incorrect assumptions which could lead to problems on non-Linux platforms for -DCMAKE_BUILD_TYPE=Release. I have checked that with this fix, the configured plplotd-qt.pc files are identical for no specified CMAKE_BUILD_TYPE, -DCMAKE_BUILD_TYPE=Debug, and -DCMAKE_BUILD_TYPE=Release for my particular Qt4.5.1 installation where there is no real difference between the debug and optimized versions of the Qt4 libraries (as shown by the printed out QT_LIBRARIES variable). This result confirms the logic is working properly. Of course, for other Qt4 installations with real differences between debug and optimized, the configured plplotd-qt.pc file will depend on whether CMAKE_BUILD_TYPE is Debug or not. Modified Paths: -------------- trunk/cmake/modules/pkg-config.cmake trunk/cmake/modules/plplot.cmake trunk/cmake/modules/qt.cmake Modified: trunk/cmake/modules/pkg-config.cmake =================================================================== --- trunk/cmake/modules/pkg-config.cmake 2009-05-11 21:39:43 UTC (rev 9966) +++ trunk/cmake/modules/pkg-config.cmake 2009-05-11 23:05:09 UTC (rev 9967) @@ -102,21 +102,22 @@ # N.B. ${_link_flags_in} must be a string and not a list. # First strip out optimized / debug options which are not needed - # Currently only FindQt4 seems to need this so it is handled - # explicitly in the Qt code. - # Leave this for reference in case it turns out there is a more - # general need for it. - #if(CMAKE_BUILD_TYPE MATCHES "Debug") - # string(REGEX REPLACE "(^|;)optimized;[^;]*;" "\\1" ${_link_flags_out} "${_link_flags_in}") - # string(REGEX REPLACE "(^|;)debug;" "\\1" ${_link_flags_out} "${${_link_flags_out}}") - #else(CMAKE_BUILD_TYPE MATCHES "Debug") - # string(REGEX REPLACE "(^|;)debug;[^;]*;" "\\1" ${_link_flags_out} "${_link_flags_in}") - # string(REGEX REPLACE "(^|;)optimized;" "\\1" ${_link_flags_out} "${${_link_flags_out}}") - #endif(CMAKE_BUILD_TYPE MATCHES "Debug") + # Currently only FindQt4 seems to need this. + if(CMAKE_BUILD_TYPE MATCHES "Debug") + # Get rid of the optimized keyword and immediately following library as + # well as the debug keyword anywhere such patterns occur in the list. + string(REGEX REPLACE "(^|;)optimized;[^;]*;" "\\1" ${_link_flags_out} "${_link_flags_in}") + string(REGEX REPLACE "(^|;)debug;" "\\1" ${_link_flags_out} "${${_link_flags_out}}") + else(CMAKE_BUILD_TYPE MATCHES "Debug") + # Get rid of the debug keyword and immediately following library as + # well as the optimized keyword anywhere such patterns occur in the list. + string(REGEX REPLACE "(^|;)debug;[^;]*;" "\\1" ${_link_flags_out} "${_link_flags_in}") + string(REGEX REPLACE "(^|;)optimized;" "\\1" ${_link_flags_out} "${${_link_flags_out}}") + endif(CMAKE_BUILD_TYPE MATCHES "Debug") #message("(original link flags) = ${_link_flags_in}") # Convert link flags to a blank-delimited string. - string(REGEX REPLACE ";" " " ${_link_flags_out} "${_link_flags_in}") + string(REGEX REPLACE ";" " " ${_link_flags_out} "${${_link_flags_out}}") #message("(blanks) ${_link_flags_out} = ${${_link_flags_out}}") # Replace actual library names with the -LPATHNAME and -lLIBRARYNAME form Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2009-05-11 21:39:43 UTC (rev 9966) +++ trunk/cmake/modules/plplot.cmake 2009-05-11 23:05:09 UTC (rev 9967) @@ -28,7 +28,7 @@ include(CheckSymbolExists) include(CheckPrototypeExists) -# Useful macros.... +# Useful macros go here. macro(TRANSFORM_VERSION _numerical_result _version) # _version must be a period-delimited triplet string of the form @@ -46,30 +46,6 @@ endif(${_version} MATCHES "^[0-9]*\\.[0-9]*\\.[0-9]*$") endmacro(TRANSFORM_VERSION) -macro(split_libraries_list _list _list_general _list_debug _list_optimized) - # Macro for splitting a libraries list into its keyword denoted general, - # debug, and optimized lists. - set(${_list_general}) - set(${_list_debug}) - set(${_list_optimized}) - - set(_keyword "general") - foreach(_element ${${_list}}) - if(_element STREQUAL "general" OR _element STREQUAL "debug" OR _element STREQUAL "optimized" ) - set(_keyword ${_element}) - else(_element STREQUAL "general" OR _element STREQUAL "debug" OR _element STREQUAL "optimized" ) - if(_keyword STREQUAL "general") - list(APPEND ${_list_general} ${_element}) - elseif(_keyword STREQUAL "debug") - list(APPEND ${_list_debug} ${_element}) - elseif(_keyword STREQUAL "optimized") - list(APPEND ${_list_optimized} ${_element}) - endif(_keyword STREQUAL "general") - endif(_element STREQUAL "general" OR _element STREQUAL "debug" OR _element STREQUAL "optimized" ) - endforeach(_element) - -endmacro(split_libraries_list _list _list_general _list_debug _list_optimized) - # ======================================================================= # Compilation and build options (PLFLT, install locations, and rpath) # Note, must come before java since that depends on, e.g., LIB_DIR. Modified: trunk/cmake/modules/qt.cmake =================================================================== --- trunk/cmake/modules/qt.cmake 2009-05-11 21:39:43 UTC (rev 9966) +++ trunk/cmake/modules/qt.cmake 2009-05-11 23:05:09 UTC (rev 9967) @@ -52,39 +52,7 @@ set(qt_COMPILE_FLAGS "${qt_COMPILE_FLAGS} -I${DIR}") endforeach(DIR ${QT_INCLUDES}) - split_libraries_list(QT_LIBRARIES QT_LIBRARIES_general QT_LIBRARIES_debug QT_LIBRARIES_optimized) - - # There is a complicated interpretation issue to be considered here. - # FindQt4.cmake associates "debug" with the Qt4 library DEBUG suffix (with - # currently unknown criteria for which libraries are labelled that way), - # and "optimized" with the Qt4 library RELEASE suffix (again with - # currently unknown criteria). Furthermore, CMake documentation is - # is not completely clear on how the debug and optimized keywords are to - # be interpreted by target_link_libraries for the Debug, Release, - # RelWithDebInfo and MinSizeRes possibilities for CMAKE_BUILD_TYPE. For - # example with gcc, the C options are Debug=-g, Release=-O3, - # RelWithDebInfo = -g -O2, and MinSizeRes=-Os. For that compiler, some of - # the options are clearly debug (Debug), some of the options are clearly - # optimized (Release), but the rest are ambiguous. For now we will assign - # the ambiguous ones to debug, but we may change that interpretation - # in the future. It is also clear from analysis of FindQt4.cmake that any - # of QT_LIBRARIES_general, QT_LIBRARIES_debug, or QT_LIBRARIES_optimized - # could be empty depending on the Qt install and whether CMAKE_BUILD_TYPE - # is specified or not. Therefore, specifically deal with the empty cases. message(STATUS "QT_LIBRARIES = ${QT_LIBRARIES}") - if(CMAKE_BUILD_TYPE STREQUAL "Release" AND QT_LIBRARIES_optimized) - set(QT_LIBRARIES ${QT_LIBRARIES_optimized}) - elseif(QT_LIBRARIES_debug) - set(QT_LIBRARIES ${QT_LIBRARIES_debug}) - elseif(QT_LIBRARIES_general) - set(QT_LIBRARIES ${QT_LIBRARIES_general}) - else(CMAKE_BUILD_TYPE STREQUAL "Release" AND QT_LIBRARIES_optimized) - # This should be impossible because of the above check on QT_LIBRARIES - # being true (i.e., non-empty). - message(FATAL_ERROR "qt.cmake QT_LIBRARIES logic error") - endif(CMAKE_BUILD_TYPE STREQUAL "Release" AND QT_LIBRARIES_optimized) - message(STATUS "revised QT_LIBRARIES (based on keyword interpretation for -the CMAKE_BUILD_TYPE that is specified) = ${QT_LIBRARIES}") set(qt_LINK_FLAGS ${QT_LIBRARIES}) #message("qt_LINK_FLAGS = ${qt_LINK_FLAGS}") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2009-06-22 20:15:02
|
Revision: 10058 http://plplot.svn.sourceforge.net/plplot/?rev=10058&view=rev Author: airwin Date: 2009-06-22 20:15:01 +0000 (Mon, 22 Jun 2009) Log Message: ----------- Handle plplot_pyqt4 logic within qt.cmake. Implement ENABLE_qt logic. Modified Paths: -------------- trunk/cmake/modules/drivers.cmake trunk/cmake/modules/qt.cmake Removed Paths: ------------- trunk/cmake/modules/pyqt4.cmake Modified: trunk/cmake/modules/drivers.cmake =================================================================== --- trunk/cmake/modules/drivers.cmake 2009-06-21 19:35:06 UTC (rev 10057) +++ trunk/cmake/modules/drivers.cmake 2009-06-22 20:15:01 UTC (rev 10058) @@ -92,7 +92,6 @@ include(aqt) include(wxwidgets) include(pdf) -include(pyqt4) # Finalize device options. include(drivers-finish) Deleted: trunk/cmake/modules/pyqt4.cmake =================================================================== --- trunk/cmake/modules/pyqt4.cmake 2009-06-21 19:35:06 UTC (rev 10057) +++ trunk/cmake/modules/pyqt4.cmake 2009-06-22 20:15:01 UTC (rev 10058) @@ -1,34 +0,0 @@ -# bindings/python/CMakeLists.txt -### Process this file with cmake to produce Makefile -### -# Copyright (C) 2009 Hazen Babcock -# -# This file is part of PLplot. -# -# PLplot is free software; you can redistribute it and/or modify -# it under the terms of the GNU Library General Public License as published -# by the Free Software Foundation; version 2 of the License. -# -# PLplot 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 Library General Public License for more details. -# -# You should have received a copy of the GNU Library General Public License -# along with PLplot; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -# Options to enable PyQt4 bindings -if(DEFAULT_NO_BINDINGS) - option(ENABLE_pyqt4 "Enable PyQt4 bindings" OFF) -else(DEFAULT_NO_BINDINGS) - option(ENABLE_pyqt4 "Enable PyQt4 bindings" OFF) -endif(DEFAULT_NO_BINDINGS) - -if(NOT ENABLE_python AND NOT PLD_extqt) - set(ENABLE_pyqt4 OFF CACHE BOOL "Enable PyQt4 bindings" FORCE) -endif(NOT ENABLE_python AND NOT PLD_extqt) - -if(ENABLE_pyqt4) - message(STATUS "Checking for PyQt4") -endif(ENABLE_pyqt4) Modified: trunk/cmake/modules/qt.cmake =================================================================== --- trunk/cmake/modules/qt.cmake 2009-06-21 19:35:06 UTC (rev 10057) +++ trunk/cmake/modules/qt.cmake 2009-06-22 20:15:01 UTC (rev 10058) @@ -18,7 +18,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # Module for determining all configuration variables related to the qt -# device driver. +# device driver, the plplotqt library, and the plplot_pyqt4 Python extension +# module. # The following variables are set/modified: # PLD_bmpqt - ON means the bmpqt device is enabled. # PLD_jpgqt - ON means the jpgqt device is enabled. @@ -37,6 +38,9 @@ # qt_RPATH - RPATH directory list for qt device driver. # DRIVERS_LINK_FLAGS - list of device LINK_FLAGS for case # when ENABLE_DYNDRIVERS OFF. +# ENABLE_qt - ON means the plplot_qt library is enabled. +# ENABLE_pyqt4 - ON means the plplot_pyqt4 Python extension module +# is enabled. find_package(Qt4) if(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt OR PLD_extqt) @@ -74,8 +78,32 @@ endif(QT4_FOUND AND QT_LIBRARIES) endif(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt OR PLD_extqt) -if(PLD_extqt) +if(DEFAULT_NO_BINDINGS) + option(ENABLE_qt "Enable Qt bindings" OFF) + option(ENABLE_pyqt4 "Enable pyqt4 Python extension module" OFF) +else(DEFAULT_NO_BINDINGS) + option(ENABLE_qt "Enable Qt bindings" ON) + option(ENABLE_pyqt4 "Enable pyqt4 Python extension module" ON) +endif(DEFAULT_NO_BINDINGS) + +if(ENABLE_qt AND NOT PLD_extqt) + message(STATUS + "WARNING: PLD_extqt is OFF so " + "setting ENABLE_qt to OFF." + ) + set(ENABLE_qt OFF CACHE BOOL "Enable Qt bindings" FORCE) +endif(ENABLE_qt AND NOT PLD_extqt) + +if(ENABLE_pyqt4 AND NOT ENABLE_python AND NOT ENABLE_qt) + message(STATUS + "WARNING: ENABLE_python OR ENABLE_qt is OFF so " + "setting ENABLE_pyqt4 to OFF." + ) + set(ENABLE_pyqt4 OFF CACHE BOOL "Enable pyqt4 Python extension module " FORCE) +endif(ENABLE_pyqt4 AND NOT ENABLE_python AND NOT ENABLE_qt) + +if(ENABLE_qt) set(qt_gui_true "") -else(PLD_extqt) +else(ENABLE_qt) set(qt_gui_true "#") -endif(PLD_extqt) +endif(ENABLE_qt) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2009-07-18 02:03:30
|
Revision: 10156 http://plplot.svn.sourceforge.net/plplot/?rev=10156&view=rev Author: airwin Date: 2009-07-18 02:03:28 +0000 (Sat, 18 Jul 2009) Log Message: ----------- Give users who happen to have one or more of the Ada, C++, D, Fortran, or Java compilers missing or broken a soft landing (warning message, disable that component or PLplot, and continue without a CMake error). This effort works around CMake bug 9220 by running a small test CMake session inside the normal CMake session to test for a working compiler without causing the normal CMake session to error out. These changes should all be dropped once CMake bug 9220 (fix the OPTIONAL signature of enable_language so it does not error out) has been fixed. Modified Paths: -------------- trunk/cmake/modules/ada.cmake trunk/cmake/modules/c++.cmake trunk/cmake/modules/d.cmake trunk/cmake/modules/fortran.cmake trunk/cmake/modules/java.cmake trunk/cmake/modules/plplot.cmake Added Paths: ----------- trunk/cmake/modules/language_support.cmake Modified: trunk/cmake/modules/ada.cmake =================================================================== --- trunk/cmake/modules/ada.cmake 2009-07-18 00:35:08 UTC (rev 10155) +++ trunk/cmake/modules/ada.cmake 2009-07-18 02:03:28 UTC (rev 10156) @@ -25,6 +25,14 @@ option(ENABLE_ada "Enable Ada bindings" ON) endif(DEFAULT_NO_BINDINGS) +if(ENABLE_ada AND NOT PLPLOT_Ada_COMPILER_WORKS) + workaround_9220(Ada PLPLOT_Ada_COMPILER_WORKS) + if(NOT PLPLOT_Ada_COMPILER_WORKS) + message(STATUS "WARNING: no working Ada compiler so disabling Ada bindings and examples.") + set(ENABLE_ada OFF CACHE BOOL "Enable Ada bindings" FORCE) + endif(NOT PLPLOT_Ada_COMPILER_WORKS) +endif(ENABLE_ada AND NOT PLPLOT_Ada_COMPILER_WORKS) + if(ENABLE_ada) # Find and check Ada compiler enable_language(Ada OPTIONAL) Modified: trunk/cmake/modules/c++.cmake =================================================================== --- trunk/cmake/modules/c++.cmake 2009-07-18 00:35:08 UTC (rev 10155) +++ trunk/cmake/modules/c++.cmake 2009-07-18 02:03:28 UTC (rev 10156) @@ -28,6 +28,14 @@ OPTION(ENABLE_cxx "Enable C++ bindings" ON) endif(DEFAULT_NO_BINDINGS) +if(ENABLE_cxx AND NOT PLPLOT_CXX_COMPILER_WORKS) + workaround_9220(CXX PLPLOT_CXX_COMPILER_WORKS) + if(NOT PLPLOT_CXX_COMPILER_WORKS) + message(STATUS "WARNING: no working C++ compiler so disabling C++ bindings and examples.") + set(ENABLE_cxx OFF CACHE BOOL "Enable C++ bindings" FORCE) + endif(NOT PLPLOT_CXX_COMPILER_WORKS) +endif(ENABLE_cxx AND NOT PLPLOT_CXX_COMPILER_WORKS) + if(ENABLE_cxx) # Find and check C++ compiler. enable_language(CXX OPTIONAL) Modified: trunk/cmake/modules/d.cmake =================================================================== --- trunk/cmake/modules/d.cmake 2009-07-18 00:35:08 UTC (rev 10155) +++ trunk/cmake/modules/d.cmake 2009-07-18 02:03:28 UTC (rev 10156) @@ -28,6 +28,14 @@ option(ENABLE_d "Enable D bindings" OFF) endif(DEFAULT_NO_BINDINGS) +if(ENABLE_d AND NOT PLPLOT_D_COMPILER_WORKS) + workaround_9220(D PLPLOT_D_COMPILER_WORKS) + if(NOT PLPLOT_D_COMPILER_WORKS) + message(STATUS "WARNING: no working D compiler so disabling D bindings and examples.") + set(ENABLE_d OFF CACHE BOOL "Enable D bindings" FORCE) + endif(NOT PLPLOT_D_COMPILER_WORKS) +endif(ENABLE_d AND NOT PLPLOT_D_COMPILER_WORKS) + if(ENABLE_d) # Find and check D compiler enable_language(D OPTIONAL) Modified: trunk/cmake/modules/fortran.cmake =================================================================== --- trunk/cmake/modules/fortran.cmake 2009-07-18 00:35:08 UTC (rev 10155) +++ trunk/cmake/modules/fortran.cmake 2009-07-18 02:03:28 UTC (rev 10156) @@ -31,6 +31,19 @@ endif(DEFAULT_NO_BINDINGS) if(ENABLE_f77 OR ENABLE_f95) + set(ENABLE_fortran ON) +endif(ENABLE_f77 OR ENABLE_f95) + +if(ENABLE_fortran AND NOT PLPLOT_Fortran_COMPILER_WORKS) + workaround_9220(Fortran PLPLOT_Fortran_COMPILER_WORKS) + if(NOT PLPLOT_Fortran_COMPILER_WORKS) + message(STATUS "WARNING: no working Fortran compiler so disabling Fortran bindings and examples.") + set(ENABLE_f77 OFF CACHE BOOL "Enable f77 bindings" FORCE) + set(ENABLE_f95 OFF CACHE BOOL "Enable f95 bindings" FORCE) + endif(NOT PLPLOT_Fortran_COMPILER_WORKS) +endif(ENABLE_fortran AND NOT PLPLOT_Fortran_COMPILER_WORKS) + +if(ENABLE_f77 OR ENABLE_f95) # Find and check Fortran compiler. enable_language(Fortran OPTIONAL) if(NOT CMAKE_Fortran_COMPILER_WORKS) Modified: trunk/cmake/modules/java.cmake =================================================================== --- trunk/cmake/modules/java.cmake 2009-07-18 00:35:08 UTC (rev 10155) +++ trunk/cmake/modules/java.cmake 2009-07-18 02:03:28 UTC (rev 10156) @@ -40,6 +40,14 @@ set(ENABLE_java OFF CACHE BOOL "Enable Java bindings" FORCE) endif(ENABLE_java AND NOT SWIG_FOUND) +if(ENABLE_java AND NOT PLPLOT_Java_COMPILER_WORKS) + workaround_9220(Java PLPLOT_Java_COMPILER_WORKS) + if(NOT PLPLOT_Java_COMPILER_WORKS) + message(STATUS "WARNING: no working Java compiler so disabling Java bindings and examples.") + set(ENABLE_java OFF CACHE BOOL "Enable Java bindings" FORCE) + endif(NOT PLPLOT_Java_COMPILER_WORKS) +endif(ENABLE_java AND NOT PLPLOT_Java_COMPILER_WORKS) + if(ENABLE_java) # Find and check Java compiler. enable_language(Java OPTIONAL) Added: trunk/cmake/modules/language_support.cmake =================================================================== --- trunk/cmake/modules/language_support.cmake (rev 0) +++ trunk/cmake/modules/language_support.cmake 2009-07-18 02:03:28 UTC (rev 10156) @@ -0,0 +1,98 @@ +# cmake/modules/language_support.cmake +# +# Temporary additional general language support is contained within this +# file. + +# This additional function definition is needed to provide a workaround for +# CMake bug 9220. + +function(workaround_9220 language language_works) + #message("DEBUG: language = ${language}") + set(text + "project(test NONE) +# Location where PLplot cmake build system first looks for cmake modules. +set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules) +cmake_minimum_required(VERSION 2.6.0) +enable_language(${language} OPTIONAL) +" + ) + file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/language_tests/${language}) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}) + file(WRITE ${CMAKE_BINARY_DIR}/language_tests/${language}/CMakeLists.txt + ${text}) + # Special language support files for various languages: + # N.B. This list of files has to be maintained to be consistent + # with anything special we do in terms of language support. + + if(language STREQUAL "Ada") + set(language_special ON) + set(language_files + CMakeAdaCompiler.cmake.in + CMakeAdaInformation.cmake + CMakeDetermineAdaCompiler.cmake + CMakeTestAdaCompiler.cmake + ) + elseif(language STREQUAL "D") + set(language_special ON) + set(language_files + CMakeDCompiler.cmake.in + CMakeDInformation.cmake + CMakeDetermineDCompiler.cmake + CMakeTestDCompiler.cmake + Platform/Linux-dmd.cmake + Platform/Linux-gdc.cmake + Platform/Windows-dmd.cmake + Platform/Windows-gdc.cmake + ) + elseif(language STREQUAL "Fortran") + set(language_special ON) + set(language_files + CMakeFortranInformation.cmake + Platform/Cygwin-GNU-Fortran.cmake + Platform/Windows-GNU-Fortran.cmake + Platform/Windows-df.cmake + Platform/Windows-f90.cmake + ) + else(language STREQUAL "Ada") + set(language_special OFF) + endif(language STREQUAL "Ada") + + if(language_special) + file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}/cmake/modules/Platform) + foreach(file ${language_files}) + configure_file( + ${CMAKE_SOURCE_DIR}/cmake/modules/${file} + ${CMAKE_BINARY_DIR}/language_tests/${language}/cmake/modules/${file} + COPYONLY + ) + endforeach(file ${language_files}) + endif(language_special) + + execute_process( + COMMAND ${CMAKE_COMMAND} . + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language} + RESULT_VARIABLE return_code + OUTPUT_QUIET + ERROR_QUIET) + if(return_code EQUAL 0) + set(${language_works} ON CACHE INTERNAL "") + else(return_code EQUAL 0) + set(${language_works} OFF CACHE INTERNAL "") + endif(return_code EQUAL 0) +endfunction(workaround_9220) + +# Temporary tests of the above function. +#workaround_9220(CXX CXX_language_works) +#message("CXX_language_works = ${CXX_language_works}") +#workaround_9220(CXXp CXXp_language_works) +#message("CXXp_language_works = ${CXXp_language_works}") +#workaround_9220(Ada Ada_language_works) +#message("Ada_language_works = ${Ada_language_works}") +#workaround_9220(D D_language_works) +#message("D_language_works = ${D_language_works}") +#workaround_9220(Fortran Fortran_language_works) +#message("Fortran_language_works = ${Fortran_language_works}") +#workaround_9220(Java Java_language_works) +#message("Java_language_works = ${Java_language_works}") + + Property changes on: trunk/cmake/modules/language_support.cmake ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2009-07-18 00:35:08 UTC (rev 10155) +++ trunk/cmake/modules/plplot.cmake 2009-07-18 02:03:28 UTC (rev 10156) @@ -379,6 +379,10 @@ "All language bindings are disabled by default" OFF ) +# Temporary workaround for language support that is required. +include(language_support) + +# Individual language support. include(c++) include(fortran) include(java) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2009-09-12 16:10:08
|
Revision: 10398 http://plplot.svn.sourceforge.net/plplot/?rev=10398&view=rev Author: airwin Date: 2009-09-12 16:09:59 +0000 (Sat, 12 Sep 2009) Log Message: ----------- Add extra information to DRIVERS_DEVICE_LIST. This information is KIND = one of F (file), I (interactive), M (memory), E (external), or N (null, i.e., valid prototype drive that produces no results) and REQUIRES_FAMILYING (set to ON if the file device requires familying). Parse that extra information to determine FILE_DEVICES_LIST (which includes the REQUIRES_FAMILYING information) and INTERACTIVE_DEVICES_LIST. These two additional lists are required for examples testing. Modified Paths: -------------- trunk/cmake/modules/drivers-finish.cmake trunk/cmake/modules/drivers-init.cmake Modified: trunk/cmake/modules/drivers-finish.cmake =================================================================== --- trunk/cmake/modules/drivers-finish.cmake 2009-09-11 07:27:30 UTC (rev 10397) +++ trunk/cmake/modules/drivers-finish.cmake 2009-09-12 16:09:59 UTC (rev 10398) @@ -22,15 +22,38 @@ # Module to finalize device options. # Results are contained in the following variables: -# DEVICES_LIST: list of devices (e.g. png, jpeg),where PLD_devicename is ON # DRIVERS_LIST: list of device drivers (e.g., gd for the png and jpeg devices) -# where at least one of the associated devices is enabled. +# where at least one of the associated devices is enabled. +# DEVICES_LIST: list of devices (e.g. png, jpeg), where device is enabled. +# FILE_DEVICES_LIST: list of colon-separated information +# (<devicename>:<familied>, where familied is ON or OFF (depending on whether +# familying is required for multi-page results) for enabled file # devices. +# INTERACTIVE_DEVICES_LIST: list of enabled interactive devices. +# N.B. DRIVERS_LIST is used below to create data to help test plug-in +# devices. Also, it is output in the summary. DEVICES_LIST is used +# to iterate through all enabled devices (notably in the drivers and +# src subdirectories). Also, it is output in the summary. Both +# FILE_DEVICES_LIST and INTERACTIVE_DEVICES_LIST are used in the +# examples subdirectory to set up testing of file devices and +# interactive devices. +set(DRIVERS_LIST) +set(DEVICES_LIST) +set(FILE_DEVICES_LIST) +set(INTERACTIVE_DEVICES_LIST) foreach(DRIVERS_DEVICE ${DRIVERS_DEVICE_LIST}) - string(REGEX REPLACE "^(.*):.*:.*$" "\\1" DEVICE ${DRIVERS_DEVICE}) - string(REGEX REPLACE "^.*:(.*):.*$" "\\1" DRIVER ${DRIVERS_DEVICE}) + string(REGEX REPLACE "^(.*):.*:.*:.*:.*$" "\\1" DEVICE ${DRIVERS_DEVICE}) + string(REGEX REPLACE "^.*:(.*):.*:.*:.*$" "\\1" DRIVER ${DRIVERS_DEVICE}) if(PLD_${DEVICE}) - set(DEVICES_LIST ${DEVICES_LIST} ${DEVICE}) + list(APPEND DEVICES_LIST ${DEVICE}) + string(REGEX REPLACE "^.*:.*:.*:(.*):.*$" "\\1" KIND ${DRIVERS_DEVICE}) + string(REGEX REPLACE "^.*:.*:.*:.*:(.*)$" "\\1" REQUIRE_FAMILYING ${DRIVERS_DEVICE}) + if(KIND STREQUAL "F") + list(APPEND FILE_DEVICES_LIST "${DEVICE}:${REQUIRE_FAMILYING}") + elseif(KIND STREQUAL "I") + list(APPEND INTERACTIVE_DEVICES_LIST ${DEVICE}) + endif(KIND STREQUAL "F") + set(APPEND_DRIVER ON) foreach(DRIVER_IN_LIST ${DRIVERS_LIST}) if(DRIVER STREQUAL "${DRIVER_IN_LIST}") @@ -47,11 +70,17 @@ ) endif(EXISTS ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.rc.in) endif(ENABLE_DYNDRIVERS) - set(DRIVERS_LIST ${DRIVERS_LIST} ${DRIVER}) + list(APPEND DRIVERS_LIST ${DRIVER}) + + # Prepend driver's source code in the drivers directory to + # anything set specially for the driver in question in the + # various special CMake modules for drivers included by + # drivers.cmake before this module (drivers-finish.cmake) is + # included by drivers.cmake. if(DRIVER STREQUAL "wxwidgets") set(${DRIVER}_SOURCE ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.cpp - ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}_app.cpp + ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}_app.cpp ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}_dc.cpp ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}_gc.cpp ${${DRIVER}_SOURCE} @@ -82,16 +111,22 @@ endif(PLD_${DEVICE}) endforeach(DRIVERS_DEVICE) +# Calculate driver information and store it in +# ${CMAKE_BINARY_DIR}/drivers/${DRIVER}.rc for each driver to be compared +# at run-time with the same information obtained from the actual +# driver plug-in by test-drv-info as a check of the validity of +# that plug-in (and consistency of the driver code with DRIVERS_DEVICE_LIST +# maintained in drivers-init.cmake). foreach(DRIVERS_DEVICE ${DRIVERS_DEVICE_LIST}) - string(REGEX REPLACE "^(.*):.*:.*$" "\\1" DEVICE ${DRIVERS_DEVICE}) - string(REGEX REPLACE "^.*:(.*):.*$" "\\1" DRIVER ${DRIVERS_DEVICE}) + string(REGEX REPLACE "^(.*):.*:.*:.*:.*$" "\\1" DEVICE ${DRIVERS_DEVICE}) + string(REGEX REPLACE "^.*:(.*):.*:.*:.*$" "\\1" DRIVER ${DRIVERS_DEVICE}) if(${DRIVER}_INFO) if(NOT PLD_${DEVICE}) set(DEVICE_INFO_MATCHED) # Must remove corresponding data from ${DRIVER}_INFO #message("DEVICE = ${DEVICE}") foreach(DEVICE_INFO ${${DRIVER}_INFO}) - string(REGEX REPLACE "^(.*):.*:.*:.*:.*:.*$" "\\1" DEVICE_INFO_NAME ${DEVICE_INFO}) + string(REGEX REPLACE "^(.*):.*:.*:.*:.*:.*:.*:.*$" "\\1" DEVICE_INFO_NAME ${DEVICE_INFO}) #message("DEVICE_INFO_NAME = ${DEVICE_INFO_NAME}") if(DEVICE STREQUAL "${DEVICE_INFO_NAME}") #There should one and only one match. @@ -108,7 +143,7 @@ endforeach(DRIVERS_DEVICE) foreach(DRIVERS_DEVICE ${DRIVERS_DEVICE_LIST}) - string(REGEX REPLACE "^.*:(.*):.*$" "\\1" DRIVER ${DRIVERS_DEVICE}) + string(REGEX REPLACE "^.*:(.*):.*:.*:.*$" "\\1" DRIVER ${DRIVERS_DEVICE}) if(${DRIVER}_INFO) file(WRITE ${CMAKE_BINARY_DIR}/drivers/${DRIVER}.rc "") foreach(DEVICE_INFO ${${DRIVER}_INFO}) Modified: trunk/cmake/modules/drivers-init.cmake =================================================================== --- trunk/cmake/modules/drivers-init.cmake 2009-09-11 07:27:30 UTC (rev 10397) +++ trunk/cmake/modules/drivers-init.cmake 2009-09-12 16:09:59 UTC (rev 10398) @@ -92,41 +92,65 @@ endif(DEFAULT_NO_CAIRO_DEVICES) endif(DEFAULT_ALL_DEVICES) -# The DRIVERS_DEVICE_LIST defined below is a list of -# <device>:<drive>:<enable_default> items. <enable_default> should be -# "ON" or "OFF" and this will reflect in inclusion/exclusion by default -# (as shown by ccmake). -# +# The DRIVERS_DEVICE_LIST defined below is a colon-separated list of +# <device>:<driver>:<enable_default>:<kind>:<familied> items. + +# <device> is the name of the device (e.g., epsqt). + +# <driver> is the name of the device driver (e.g., qt). + +# <enable_default> should be ON or OFF and this will reflect in +# inclusion/exclusion by default (as shown by ccmake). + +# <kind> should be one of F (file), I (interactive), M (memory), E +# (external), or N (null, i.e., valid prototype drive that produces +# no results.) + +# <familed> should be either ON or OFF depending on whether familying is +# a necessity for this device to generate multipage plots. + +# <device>, <driver>, and <enable_default> are fundamental data that +# help to determine the list of enabled drivers, DRIVERS_LIST (used in +# the summary), and list of enabled devices, DEVICES_LIST (used in the +# summary and also when iterating over enabled devices in the build +# system). <kind> is used (in drivers-finish.cmake) to determine +# which enabled devices are included in the FILE_DEVICES_LIST (which +# also includes <familied> information), and <kind> is used to +# determine (again in drivers-finish.cmake) which enabled devices are +# included in the INTERACTIVE_DEVICES_LIST. Both FILE_DEVICES_LIST +# and INTERACTIVE_DEVICES_LIST are used in the examples subdirectory +# to set up testing of file devices and interactive devices. + # Ordered alphabetically by second in each pair (the driver) and then # alphabetically by device (the first in each pair) for human # consumption, but this is not necessary. set(DRIVERS_DEVICE_LIST - "aqt:aqt:ON" + "aqt:aqt:ON:I:OFF" # memcairo does not work so turn it off by default. # The remaining cairo devices work well so turn them on by default. - "memcairo:cairo:OFF" - "extcairo:cairo:ON" - "pdfcairo:cairo:ON" - "pngcairo:cairo:ON" - "pscairo:cairo:ON" - "svgcairo:cairo:ON" - "xcairo:cairo:ON" + "memcairo:cairo:OFF:M:OFF" + "extcairo:cairo:ON:E:OFF" + "pdfcairo:cairo:ON:F:OFF" + "pngcairo:cairo:ON:F:ON" + "pscairo:cairo:ON:F:OFF" + "svgcairo:cairo:ON:F:ON" + "xcairo:cairo:ON:I:OFF" # new example 16 shows severe valgrind issues with this device. - "cgm:cgm:OFF" + "cgm:cgm:OFF:F:OFF" # This unmaintained device driver builds but does not actually work # (with error message: "Unable to locate dispatch table initialization # function for driver: dg300.") so retire it. - # "dg300:dg300:OFF" - "epsqt:qt:ON" - "pdfqt:qt:ON" - "qtwidget:qt:ON" - "bmpqt:qt:ON" - "jpgqt:qt:ON" - "pngqt:qt:ON" - "ppmqt:qt:ON" - "tiffqt:qt:ON" - "extqt:qt:ON" + # "dg300:dg300:OFF:F:OFF" + "epsqt:qt:ON:F:ON" + "pdfqt:qt:ON:F:ON" + "qtwidget:qt:ON:I:OFF" + "bmpqt:qt:ON:F:ON" + "jpgqt:qt:ON:F:ON" + "pngqt:qt:ON:F:ON" + "ppmqt:qt:ON:F:ON" + "tiffqt:qt:ON:F:ON" + "extqt:qt:ON:E:OFF" # Currently does not validate at http://validator.w3.org/, but that appears # to be a result of the validator being unfamiliar with SVG-1.2 (a draft # SVG standard that has not been finalized yet) which is produced @@ -135,68 +159,68 @@ # which is clearly documented in the 1.2 draft. Also, text offset issues # which were in SVG results produced by QT-4.4.3 are gone for QT-4.5.0. # Therefore, the conclusion is to enable svgqt by default. - "svgqt:qt:ON" + "svgqt:qt:ON:F:ON" # gd related devices are not maintained. - "gif:gd:OFF" - "jpeg:gd:OFF" - "png:gd:OFF" + "gif:gd:OFF:F:ON" + "jpeg:gd:OFF:F:ON" + "png:gd:OFF:F:ON" # gcw is not maintained. - "gcw:gcw:OFF" + "gcw:gcw:OFF:I:OFF" # Do not implement gnome which is superseded by gcw - #"gnome:gnome:OFF" + #"gnome:gnome:OFF:I:OFF" # hpgl devices produce tons of "Invalid pen selection." messages and the # lj_hpgl device produces the error message "Unable to locate dispatch # table initialization function for driver: hpgl." # Retire this elderly device driver rather than fixing it. - #"hp7470:hpgl:OFF" - #"hp7580:hpgl:OFF" - #"lj_hpgl:hpgl:OFF" + #"hp7470:hpgl:OFF:F:OFF" + #"hp7580:hpgl:OFF:F:OFF" + #"lj_hpgl:hpgl:OFF:F:OFF" # This unmaintained driver generates double frees for example 14. # Retire this elderly device driver rather than fixing it. - # "imp:impress:OFF" + # "imp:impress:OFF:I:OFF" # Default off because poorly maintained (e.g., colours are incorrect) # must use software fill, and must run as root. - "linuxvga:linuxvga:OFF" + "linuxvga:linuxvga:OFF:I:OFF" # ljii is unmaintained and both the ljii and ljiip segfault on example 14. # Retire this elderly device driver rather than fixing it. - #"ljii:ljii:OFF" - #"ljiip:ljiip:OFF" - "mem:mem:ON" - "ntk:ntk:OFF" - "null:null:ON" + #"ljii:ljii:OFF:F:OFF" + #"ljiip:ljiip:OFF:F:OFF" + "mem:mem:ON:M:OFF" + "ntk:ntk:OFF:I:OFF" + "null:null:ON:N:OFF" # glibc detects double free - "pbm:pbm:OFF" - "pdf:pdf:OFF" + "pbm:pbm:OFF:F:OFF" + "pdf:pdf:OFF:F:OFF" # (2007-09-01) As discussed on list, don't enable plmeta until we sort # out the known issues (e.g., strings, aspect ratio, and TrueType fonts). # This is going to take time/energy for some volunteer who has not volunteered # yet.... :-) - "plmeta:plmeta:OFF" - "ps:ps:ON" + "plmeta:plmeta:OFF:F:OFF" + "ps:ps:ON:F:OFF" # No longer segfaults, but still default OFF because cleaner/better ways # (psttf and pscairo) to get modern fonts for postscript results. - "pstex:pstex:OFF" - "psttf:psttf:ON" - "svg:svg:ON" + "pstex:pstex:OFF:F:OFF" + "psttf:psttf:ON:F:OFF" + "svg:svg:ON:F:ON" # Build issues (inconsistent use of PLD names). We believe there is no # user interest in the tek devices any more so retire them rather than # fix them. - #"conex:tek:OFF" - #"mskermit:tek:OFF" - #"tek4010:tek:OFF" - #"tek4010f:tek:OFF" - #"tek4107:tek:OFF" - #"tek4107f:tek:OFF" - #"versaterm:tek:OFF" - #"vlt:tek:OFF" - #"xterm:tek:OFF" - "tk:tk:ON" - "tkwin:tkwin:ON" - "wingcc:wingcc:ON" - "wxwidgets:wxwidgets:ON" - "wxpng:wxwidgets:OFF" - "xfig:xfig:ON" - "xwin:xwin:ON" + #"conex:tek:OFF:I:OFF" + #"mskermit:tek:OFF:I:OFF" + #"tek4010:tek:OFF:I:OFF" + #"tek4010f:tek:OFF:F:OFF" + #"tek4107:tek:OFF:I:OFF" + #"tek4107f:tek:OFF:F:OFF" + #"versaterm:tek:OFF:I:OFF" + #"vlt:tek:OFF:I:OFF" + #"xterm:tek:OFF:I:OFF" + "tk:tk:ON:I:OFF" + "tkwin:tkwin:ON:E:OFF" + "wingcc:wingcc:ON:I:OFF" + "wxwidgets:wxwidgets:ON:I:OFF" + "wxpng:wxwidgets:OFF:F:ON" + "xfig:xfig:ON:F:ON" + "xwin:xwin:ON:I:OFF" ) if(DEFAULT_ALL_DEVICES) @@ -210,15 +234,25 @@ endif(DEFAULT_ALL_DEVICES) foreach(DRIVERS_DEVICE ${DRIVERS_DEVICE_LIST}) - string(REGEX REPLACE "^(.*):.*:.*$" "\\1" DEVICE ${DRIVERS_DEVICE}) + string(REGEX REPLACE "^(.*):.*:.*:.*:.*$" "\\1" DEVICE ${DRIVERS_DEVICE}) + string(REGEX REPLACE "^.*:.*:.*:(.*):.*$" "\\1" KIND ${DRIVERS_DEVICE}) + string(REGEX REPLACE "^.*:.*:.*:.*:(.*)$" "\\1" REQUIRE_FAMILYING ${DRIVERS_DEVICE}) + # Check that you don't have the invalid combination of a non-file device + # that requires familying. + if(REQUIRE_FAMILYING AND NOT KIND STREQUAL "F") + message(FATAL_ERROR "Invalid combination of REQUIRE_FAMILYING = ${REQUIRE_FAMILYING} AND KIND = ${KIND} for DEVICE = ${DEVICE}") + endif(REQUIRE_FAMILYING AND NOT KIND STREQUAL "F") + if(NOT PRESET_DEFAULT) if(DEFAULT_NO_QT_DEVICES AND DEVICE MATCHES ".*qt.*" AND NOT DEVICE STREQUAL "aqt") set(DEFAULT OFF) elseif(DEFAULT_NO_CAIRO_DEVICES AND DEVICE MATCHES ".*cairo.*") set(DEFAULT OFF) else(DEFAULT_NO_QT_DEVICES AND DEVICE MATCHES ".*qt.*" AND NOT DEVICE STREQUAL "aqt") - string(REGEX REPLACE "^.*:.*:(.*)$" "\\1" DEFAULT ${DRIVERS_DEVICE}) + string(REGEX REPLACE "^.*:.*:(.*):.*:.*$" "\\1" DEFAULT ${DRIVERS_DEVICE}) endif(DEFAULT_NO_QT_DEVICES AND DEVICE MATCHES ".*qt.*" AND NOT DEVICE STREQUAL "aqt") endif(NOT PRESET_DEFAULT) + #message(STATUS "DEBUG: DEVICE = ${DEVICE}") + #message(STATUS "DEBUG: DEFAULT= ${DEFAULT}") option(PLD_${DEVICE} "Enable ${DEVICE} device" ${DEFAULT}) endforeach(DRIVERS_DEVICE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-02-08 19:33:44
|
Revision: 10796 http://plplot.svn.sourceforge.net/plplot/?rev=10796&view=rev Author: airwin Date: 2010-02-08 19:33:38 +0000 (Mon, 08 Feb 2010) Log Message: ----------- Define and use filter_rpath function to filter out default locations from rpath data. Modified Paths: -------------- trunk/cmake/modules/cairo.cmake trunk/cmake/modules/drivers.cmake trunk/cmake/modules/pdf.cmake trunk/cmake/modules/plplot.cmake trunk/cmake/modules/psttf.cmake trunk/cmake/modules/qt.cmake Modified: trunk/cmake/modules/cairo.cmake =================================================================== --- trunk/cmake/modules/cairo.cmake 2010-02-07 01:47:34 UTC (rev 10795) +++ trunk/cmake/modules/cairo.cmake 2010-02-08 19:33:38 UTC (rev 10796) @@ -111,6 +111,7 @@ message("Pango Cairo version (${version}) < 1.20.5, if text rendering is slow recommend turning off text clipping") endif(NUMERICAL_PANGOCAIRO_VERSION LESS "${NUMERICAL_PANGOCAIRO_MINIMUM_VERSION}") set(cairo_RPATH ${linkdir}) + filter_rpath(cairo_RPATH) if(PLD_xcairo AND X11_COMPILE_FLAGS) # Blank-delimited required. string(REGEX REPLACE ";" " " Modified: trunk/cmake/modules/drivers.cmake =================================================================== --- trunk/cmake/modules/drivers.cmake 2010-02-07 01:47:34 UTC (rev 10795) +++ trunk/cmake/modules/drivers.cmake 2010-02-08 19:33:38 UTC (rev 10796) @@ -53,6 +53,7 @@ find_package(LTDL) if(LTDL_FOUND) set(libplplot${LIB_TAG}_RPATH ${LTDL_LIBRARY_DIR}) + filter_rpath(libplplot${LIB_TAG}_RPATH) message(STATUS "LTDL_INCLUDE_DIR = ${LTDL_INCLUDE_DIR}") message(STATUS "LTDL_LIBRARY_DIR = ${LTDL_LIBRARY_DIR}") message(STATUS "LTDL_LIBRARIES = ${LTDL_LIBRARIES}") Modified: trunk/cmake/modules/pdf.cmake =================================================================== --- trunk/cmake/modules/pdf.cmake 2010-02-07 01:47:34 UTC (rev 10795) +++ trunk/cmake/modules/pdf.cmake 2010-02-08 19:33:38 UTC (rev 10796) @@ -39,6 +39,7 @@ endif(WIN32) set(pdf_LINK_FLAGS "${hpdf_LIBRARIES}") set(pdf_RPATH ${hpdf_LIBRARY_DIRS}) + filter_rpath(pdf_RPATH) set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${pdf_LINK_FLAGS}) else(hpdf_FOUND) message(STATUS "Looking for haru pdf header and library - not found") Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2010-02-07 01:47:34 UTC (rev 10795) +++ trunk/cmake/modules/plplot.cmake 2010-02-08 19:33:38 UTC (rev 10796) @@ -82,6 +82,27 @@ set(${numerical_result} ${internal_numerical_result} PARENT_SCOPE) endfunction(TRANSFORM_VERSION) +# CMake-2.6.x duplicates this list so work around that bug by removing +# those duplicates. +if(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) + list(REMOVE_DUPLICATES CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) +endif(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) + +# Filter all CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES list elements from +# rpath_in list. +function(filter_rpath rpath) + message("DEBUG: ${rpath} = ${${rpath}}") + set(internal_rpath ${${rpath}}) + if(internal_rpath) + list(REMOVE_DUPLICATES internal_rpath) + if(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) + list(REMOVE_ITEM internal_rpath ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}) + endif(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) + endif(internal_rpath) + message("DEBUG: (filtered) ${rpath} = ${internal_rpath}") + set(${rpath} ${internal_rpath} PARENT_SCOPE) +endfunction(filter_rpath) + # ======================================================================= # Compilation and build options (PLFLT, install locations, and rpath) # Note, must come before java since that depends on, e.g., LIB_DIR. Modified: trunk/cmake/modules/psttf.cmake =================================================================== --- trunk/cmake/modules/psttf.cmake 2010-02-07 01:47:34 UTC (rev 10795) +++ trunk/cmake/modules/psttf.cmake 2010-02-08 19:33:38 UTC (rev 10796) @@ -62,6 +62,7 @@ string(REGEX REPLACE ";" " " psttf_COMPILE_FLAGS "${cflags}") set(psttf_LINK_FLAGS ${linkflags}) set(psttf_RPATH ${libdir}) + filter_rpath(psttf_RPATH) list(APPEND DRIVERS_LINK_FLAGS ${psttf_LINK_FLAGS}) else(linkflags) message("includedir = ${includedir}") Modified: trunk/cmake/modules/qt.cmake =================================================================== --- trunk/cmake/modules/qt.cmake 2010-02-07 01:47:34 UTC (rev 10795) +++ trunk/cmake/modules/qt.cmake 2010-02-08 19:33:38 UTC (rev 10796) @@ -80,6 +80,7 @@ set(qt_LINK_FLAGS) set(qt_RPATH ${QT_LIBRARY_DIR}) + filter_rpath(qt_RPATH) #message("qt_LIBRARY_DIR = ${qt_LIBRARY_DIR}") else(QT4_FOUND) message(STATUS "WARNING: Qt4 development environment not found so " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2010-04-29 20:00:33
|
Revision: 10953 http://plplot.svn.sourceforge.net/plplot/?rev=10953&view=rev Author: airwin Date: 2010-04-29 20:00:26 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Remove these slightly modified versions for these modules for CMake-2.4.7 so that our users can access the modern CMake core versions of these modules. Removed Paths: ------------- trunk/cmake/modules/FindTCL.cmake trunk/cmake/modules/FindTclsh.cmake Deleted: trunk/cmake/modules/FindTCL.cmake =================================================================== --- trunk/cmake/modules/FindTCL.cmake 2010-04-29 18:25:44 UTC (rev 10952) +++ trunk/cmake/modules/FindTCL.cmake 2010-04-29 20:00:26 UTC (rev 10953) @@ -1,169 +0,0 @@ -# - Find Tcl includes and libraries. -# This module finds if TCL is installed and determines where the -# include files and libraries are. It also determines what the name of -# the library is. This code sets the following variables: -# TCL_LIBRARY = path to Tcl library (tcl tcl80) -# TCL_LIBRARY_DEBUG = path to Tcl library (debug) -# TCL_STUB_LIBRARY = path to Tcl stub library -# TCL_STUB_LIBRARY_DEBUG = path to debug stub library -# TCL_INCLUDE_PATH = path to where tcl.h can be found -# TCL_TCLSH = path to tclsh binary (tcl tcl80) -# TK_LIBRARY = path to Tk library (tk tk80 etc) -# TK_LIBRARY_DEBUG = path to Tk library (debug) -# TK_STUB_LIBRARY = path to Tk stub library -# TK_STUB_LIBRARY_DEBUG = path to debug Tk stub library -# TK_INCLUDE_PATH = path to where tk.h can be found -# TK_INTERNAL_PATH = path to where tkWinInt.h is found -# TK_WISH = full path to the wish executable - -INCLUDE(CMakeFindFrameworks) -INCLUDE(FindTclsh) -INCLUDE(FindWish) - -GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH) -GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH) - -SET (TCLTK_POSSIBLE_LIB_PATHS - "${TCL_TCLSH_PATH}/../lib" - "${TK_WISH_PATH}/../lib" - "${TCL_INCLUDE_PATH}/../lib" - "${TK_INCLUDE_PATH}/../lib" - "$ENV{ProgramFiles}/Tcl/Lib" - "C:/Program Files/Tcl/lib" - "C:/Tcl/lib" - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/lib - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/lib - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib - /usr/lib - /usr/local/lib -) - -FIND_LIBRARY(TCL_LIBRARY - NAMES tcl tcl85 tcl8.5 tcl84 tcl8.4 tcl83 tcl8.3 tcl82 tcl8.2 tcl80 tcl8.0 - PATHS ${TCLTK_POSSIBLE_LIB_PATHS} -) - -FIND_LIBRARY(TCL_LIBRARY_DEBUG - NAMES tcld tcl85d tcl8.5d tcl84d tcl8.4d tcl83d tcl8.3d tcl82d tcl8.2d tcl80d tcl8.0d - PATHS ${TCLTK_POSSIBLE_LIB_PATHS} -) - -FIND_LIBRARY(TCL_STUB_LIBRARY - NAMES tclstub tclstub85 tclstub8.5 tclstub84 tclstub8.4 tclstub83 tclstub8.3 tclstub82 tclstub8.2 tclstub80 tclstub8.0 - PATHS ${TCLTK_POSSIBLE_LIB_PATHS} -) - -FIND_LIBRARY(TCL_STUB_LIBRARY_DEBUG - NAMES tclstubd tclstub85d tclstub8.5d tclstub84d tclstub8.4d tclstub83d tclstub8.3d tclstub82d tclstub8.2d tclstub80d tclstub8.0d - PATHS ${TCLTK_POSSIBLE_LIB_PATHS} -) - -FIND_LIBRARY(TK_LIBRARY - NAMES tk tk85 tk8.5 tk84 tk8.4 tk83 tk8.3 tk82 tk8.2 tk80 tk8.0 - PATHS ${TCLTK_POSSIBLE_LIB_PATHS} -) - -FIND_LIBRARY(TK_LIBRARY_DEBUG - NAMES tkd tk85d tk8.5d tk84d tk8.4d tk83d tk8.3d tk82d tk8.2d tk80d tk8.0d - PATHS ${TCLTK_POSSIBLE_LIB_PATHS} -) - -FIND_LIBRARY(TK_STUB_LIBRARY - NAMES tkstub tkstub85 tkstub8.5 tkstub84 tkstub8.4 tkstub83 tkstub8.3 tkstub82 tkstub8.2 tkstub80 tkstub8.0 - PATHS ${TCLTK_POSSIBLE_LIB_PATHS} -) - -FIND_LIBRARY(TK_STUB_LIBRARY_DEBUG - NAMES tkstubd tkstub85d tkstub8.5d tkstub84d tkstub8.4d tkstub83d tkstub8.3d tkstub82d tkstub8.2d tkstub80d tkstub8.0d - PATHS ${TCLTK_POSSIBLE_LIB_PATHS} -) - -CMAKE_FIND_FRAMEWORKS(Tcl) -CMAKE_FIND_FRAMEWORKS(Tk) - -SET(TCL_FRAMEWORK_INCLUDES) -IF(Tcl_FRAMEWORKS) - IF(NOT TCL_INCLUDE_PATH) - FOREACH(dir ${Tcl_FRAMEWORKS}) - SET(TCL_FRAMEWORK_INCLUDES ${TCL_FRAMEWORK_INCLUDES} ${dir}/Headers) - ENDFOREACH(dir) - ENDIF(NOT TCL_INCLUDE_PATH) -ENDIF(Tcl_FRAMEWORKS) - -SET(TK_FRAMEWORK_INCLUDES) -IF(Tk_FRAMEWORKS) - IF(NOT TK_INCLUDE_PATH) - FOREACH(dir ${Tk_FRAMEWORKS}) - SET(TK_FRAMEWORK_INCLUDES ${TK_FRAMEWORK_INCLUDES} - ${dir}/Headers ${dir}/PrivateHeaders) - ENDFOREACH(dir) - ENDIF(NOT TK_INCLUDE_PATH) -ENDIF(Tk_FRAMEWORKS) - -GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH) -GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH) - -SET (TCLTK_POSSIBLE_INCLUDE_PATHS - ${TCL_TCLSH_PATH}/../include - ${TK_WISH_PATH}/../include - "${TCL_LIBRARY_PATH}/../include" - "${TK_LIBRARY_PATH}/../include" - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/include - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/include - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/include - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/include - "$ENV{ProgramFiles}/Tcl/include" - "C:/Program Files/Tcl/include" - C:/Tcl/include - /usr/include - /usr/local/include - /usr/include/tcl8.5 - /usr/include/tcl8.4 - /usr/include/tcl8.3 - /usr/include/tcl8.2 - /usr/include/tcl8.0 -) - -FIND_PATH(TCL_INCLUDE_PATH tcl.h - ${TCL_FRAMEWORK_INCLUDES} ${TCLTK_POSSIBLE_INCLUDE_PATHS} -) - -FIND_PATH(TK_INCLUDE_PATH tk.h - ${TK_FRAMEWORK_INCLUDES} ${TCLTK_POSSIBLE_INCLUDE_PATHS} -) - -IF (WIN32) - FIND_PATH(TK_INTERNAL_PATH tkWinInt.h - ${TCLTK_POSSIBLE_INCLUDE_PATHS} - ) - MARK_AS_ADVANCED(TK_INTERNAL_PATH) -ENDIF(WIN32) - -MARK_AS_ADVANCED( - TCL_TCLSH_PATH - TK_WISH_PATH - TCL_INCLUDE_PATH - TK_INCLUDE_PATH - TCL_LIBRARY - TCL_LIBRARY_DEBUG - TK_LIBRARY - TK_LIBRARY_DEBUG - TCL_STUB_LIBRARY - TCL_STUB_LIBRARY_DEBUG - TK_STUB_LIBRARY - TK_STUB_LIBRARY - TK_STUB_LIBRARY_DEBUG - ) - -IF(TCL_INCLUDE_PATH) - IF(TK_INCLUDE_PATH) - IF(TCL_LIBRARY) - IF(TK_LIBRARY) - SET(TCL_FOUND 1) - ENDIF(TK_LIBRARY) - ENDIF(TCL_LIBRARY) - ENDIF(TK_INCLUDE_PATH) -ENDIF(TCL_INCLUDE_PATH) Deleted: trunk/cmake/modules/FindTclsh.cmake =================================================================== --- trunk/cmake/modules/FindTclsh.cmake 2010-04-29 18:25:44 UTC (rev 10952) +++ trunk/cmake/modules/FindTclsh.cmake 2010-04-29 20:00:26 UTC (rev 10953) @@ -1,37 +0,0 @@ -# - Find tclsh -# This module finds if TCL is installed and determines where the -# include files and libraries are. It also determines what the name of -# the library is. This code sets the following variables: -# TCL_TCLSH = the path to the tclsh executable -# In cygwin, look for the cygwin version first. Don't look for it later to -# avoid finding the cygwin version on a Win32 build. -IF(WIN32) - IF(UNIX) - FIND_PROGRAM(TCL_TCLSH NAMES cygtclsh83 cygtclsh80) - ENDIF(UNIX) -ENDIF(WIN32) - -GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH) -GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH) - -FIND_PROGRAM(TCL_TCLSH - NAMES tclsh - tclsh85 tclsh8.5 - tclsh84 tclsh8.4 - tclsh83 tclsh8.3 - tclsh82 tclsh8.2 - tclsh80 tclsh8.0 - PATHS - "${TCL_INCLUDE_PATH}/../bin" - "${TK_INCLUDE_PATH}/../bin" - "${TCL_LIBRARY_PATH}/../bin" - "${TK_LIBRARY_PATH}/../bin" - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/bin - [HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\8.4.6.0]/bin - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.4;Root]/bin - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/bin - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/bin - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin -) - -MARK_AS_ADVANCED( TCL_TCLSH ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2011-10-14 02:26:14
|
Revision: 11960 http://plplot.svn.sourceforge.net/plplot/?rev=11960&view=rev Author: airwin Date: 2011-10-14 02:26:07 +0000 (Fri, 14 Oct 2011) Log Message: ----------- Split off useful functions used by PLplot configuration into their own module file. Modified Paths: -------------- trunk/cmake/modules/plplot.cmake Added Paths: ----------- trunk/cmake/modules/plplot_functions.cmake Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2011-10-14 00:14:28 UTC (rev 11959) +++ trunk/cmake/modules/plplot.cmake 2011-10-14 02:26:07 UTC (rev 11960) @@ -44,206 +44,9 @@ include(CheckSymbolExists) include(CheckPrototypeExists) -# Useful functions go here. +# Include some useful functions that Plplot requires. +include(plplot_functions) -function(list_example_files path device suffix output_list) - # Return list of files (with ${path}/ prepended to form the full path - # name for each file) that are generated by plplot-test.sh for a - # particular device and file suffix corresponding to front-end - # language. This list will be used for OUTPUT files of a custom - # command so that these files will be properly deleted by "make - # clean". Thus, it doesn't matter if we miss a few examples or - # pages that are only implemented for one of the languages. - # However, if we specify a file that is not generated by - # plplot-test.sh for the specified device and language, then that - # custom command is never satisfied and will continue to regenerate - # the files. Therefore only specify examples and pages that you - # _know_ are generated by all language bindings. - set(examples_pages_LIST - x01:01 - x02:02 - x03:01 - x04:02 - x05:01 - x06:05 - x07:20 - x08:08 - x09:05 - x10:01 - x11:08 - x12:01 - x13:01 - x14:02 - x14a:02 - x15:03 - x16:05 - x17:01 - x18:08 - x19:04 - x20:06 - x21:03 - x22:04 - x23:16 - x24:01 - x25:08 - x26:02 - x27:20 - x28:05 - x29:10 - x30:02 - x31:01 - # 32 missing deliberately since that only implemented for C - x33:04 - ) - - # This list taken directly from plplot-test.sh.cmake. Update as needed. - if( - ${device} STREQUAL "png" OR - ${device} STREQUAL "pngcairo" OR - ${device} STREQUAL "jpeg" OR - ${device} STREQUAL "xfig" OR - ${device} STREQUAL "svg" OR - ${device} STREQUAL "svgcairo" OR - ${device} STREQUAL "bmpqt" OR - ${device} STREQUAL "jpgqt" OR - ${device} STREQUAL "pngqt" OR - ${device} STREQUAL "ppmqt" OR - ${device} STREQUAL "tiffqt" OR - ${device} STREQUAL "svgqt" OR - ${device} STREQUAL "epsqt" OR - ${device} STREQUAL "pdfqt" OR - ${device} STREQUAL "gif" - ) - set(familying ON) - else( - ${device} STREQUAL "png" OR - ${device} STREQUAL "pngcairo" OR - ${device} STREQUAL "jpeg" OR - ${device} STREQUAL "xfig" OR - ${device} STREQUAL "svg" OR - ${device} STREQUAL "svgcairo" OR - ${device} STREQUAL "bmpqt" OR - ${device} STREQUAL "jpgqt" OR - ${device} STREQUAL "pngqt" OR - ${device} STREQUAL "ppmqt" OR - ${device} STREQUAL "tiffqt" OR - ${device} STREQUAL "svgqt" OR - ${device} STREQUAL "epsqt" OR - ${device} STREQUAL "pdfqt" OR - ${device} STREQUAL "gif" - ) - set(familying OFF) - endif( - ${device} STREQUAL "png" OR - ${device} STREQUAL "pngcairo" OR - ${device} STREQUAL "jpeg" OR - ${device} STREQUAL "xfig" OR - ${device} STREQUAL "svg" OR - ${device} STREQUAL "svgcairo" OR - ${device} STREQUAL "bmpqt" OR - ${device} STREQUAL "jpgqt" OR - ${device} STREQUAL "pngqt" OR - ${device} STREQUAL "ppmqt" OR - ${device} STREQUAL "tiffqt" OR - ${device} STREQUAL "svgqt" OR - ${device} STREQUAL "epsqt" OR - ${device} STREQUAL "pdfqt" OR - ${device} STREQUAL "gif" - ) - set(file_list) - - foreach(example_pages ${examples_pages_LIST}) - string(REGEX REPLACE "^(.*):.*$" "\\1" example ${example_pages}) - string(REGEX REPLACE "^.*:(.*)$" "\\1" pages ${example_pages}) - if(${suffix} STREQUAL "a") - string(REGEX REPLACE "^x" "xthick" thick_example ${example}) - else(${suffix} STREQUAL "a") - set(thick_example) - endif(${suffix} STREQUAL "a") - if(familying) - foreach(famnum RANGE 1 ${pages}) - if(famnum LESS 10) - set(famnum 0${famnum}) - endif(famnum LESS 10) - list(APPEND file_list ${path}/${example}${suffix}${famnum}.${device}) - if(thick_example) - list(APPEND file_list ${path}/${thick_example}${suffix}${famnum}.${device}) - endif(thick_example) - endforeach(famnum RANGE 1 ${pages}) - else(familying) - list(APPEND file_list ${path}/${example}${suffix}.${device}) - if(thick_example) - list(APPEND file_list ${path}/${thick_example}${suffix}.${device}) - endif(thick_example) - endif(familying) - if(NOT ${example} STREQUAL "x14a") - list(APPEND file_list ${path}/${example}${suffix}_${device}.txt) - if(thick_example) - list(APPEND file_list ${path}/${thick_example}${suffix}_${device}.txt) - endif(thick_example) - endif(NOT ${example} STREQUAL "x14a") - endforeach(example_pages ${examples_pages_LIST}) - - set(${output_list} ${file_list} PARENT_SCOPE) -endfunction(list_example_files ) - -function(TRANSFORM_VERSION numerical_result version) - # internal_version ignores everything in version after any character that - # is not 0-9 or ".". This should take care of the case when there is - # some non-numerical data in the patch version. - #message(STATUS "DEBUG: version = ${version}") - string(REGEX REPLACE "^([0-9.]+).*$" "\\1" internal_version ${version}) - - # internal_version is normally a period-delimited triplet string of the form - # "major.minor.patch", but patch and/or minor could be missing. - # Transform internal_version into a numerical result that can be compared. - string(REGEX REPLACE "^([0-9]*).+$" "\\1" major ${internal_version}) - string(REGEX REPLACE "^[0-9]*\\.([0-9]*).*$" "\\1" minor ${internal_version}) - string(REGEX REPLACE "^[0-9]*\\.[0-9]*\\.([0-9]*)$" "\\1" patch ${internal_version}) - - if(NOT patch MATCHES "[0-9]+") - set(patch 0) - endif(NOT patch MATCHES "[0-9]+") - - if(NOT minor MATCHES "[0-9]+") - set(minor 0) - endif(NOT minor MATCHES "[0-9]+") - - if(NOT major MATCHES "[0-9]+") - set(major 0) - endif(NOT major MATCHES "[0-9]+") - #message(STATUS "DEBUG: internal_version = ${internal_version}") - #message(STATUS "DEBUG: major = ${major}") - #message(STATUS "DEBUG: minor= ${minor}") - #message(STATUS "DEBUG: patch = ${patch}") - math(EXPR internal_numerical_result - "${major}*1000000 + ${minor}*1000 + ${patch}" - ) - #message(STATUS "DEBUG: ${numerical_result} = ${internal_numerical_result}") - set(${numerical_result} ${internal_numerical_result} PARENT_SCOPE) -endfunction(TRANSFORM_VERSION) - -# CMake-2.6.x duplicates this list so work around that bug by removing -# those duplicates. -if(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) - list(REMOVE_DUPLICATES CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) -endif(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) - -# Filter all CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES list elements from -# rpath_in list. -function(filter_rpath rpath) - #message("DEBUG: ${rpath} = ${${rpath}}") - set(internal_rpath ${${rpath}}) - if(internal_rpath) - list(REMOVE_DUPLICATES internal_rpath) - if(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) - list(REMOVE_ITEM internal_rpath ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}) - endif(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) - endif(internal_rpath) - #message("DEBUG: (filtered) ${rpath} = ${internal_rpath}") - set(${rpath} ${internal_rpath} PARENT_SCOPE) -endfunction(filter_rpath) - # ======================================================================= # Compilation and build options (PLFLT, install locations, and rpath) # Note, must come before java since that depends on, e.g., LIB_DIR. Added: trunk/cmake/modules/plplot_functions.cmake =================================================================== --- trunk/cmake/modules/plplot_functions.cmake (rev 0) +++ trunk/cmake/modules/plplot_functions.cmake 2011-10-14 02:26:07 UTC (rev 11960) @@ -0,0 +1,199 @@ +# Collection of useful functions that are required by PLplot. + +function(list_example_files path device suffix output_list) + # Return list of files (with ${path}/ prepended to form the full path + # name for each file) that are generated by plplot-test.sh for a + # particular device and file suffix corresponding to front-end + # language. This list will be used for OUTPUT files of a custom + # command so that these files will be properly deleted by "make + # clean". Thus, it doesn't matter if we miss a few examples or + # pages that are only implemented for one of the languages. + # However, if we specify a file that is not generated by + # plplot-test.sh for the specified device and language, then that + # custom command is never satisfied and will continue to regenerate + # the files. Therefore only specify examples and pages that you + # _know_ are generated by all language bindings. + set(examples_pages_LIST + x01:01 + x02:02 + x03:01 + x04:02 + x05:01 + x06:05 + x07:20 + x08:08 + x09:05 + x10:01 + x11:08 + x12:01 + x13:01 + x14:02 + x14a:02 + x15:03 + x16:05 + x17:01 + x18:08 + x19:04 + x20:06 + x21:03 + x22:04 + x23:16 + x24:01 + x25:08 + x26:02 + x27:20 + x28:05 + x29:10 + x30:02 + x31:01 + # 32 missing deliberately since that only implemented for C + x33:04 + ) + + # This list taken directly from plplot-test.sh.cmake. Update as needed. + if( + ${device} STREQUAL "png" OR + ${device} STREQUAL "pngcairo" OR + ${device} STREQUAL "jpeg" OR + ${device} STREQUAL "xfig" OR + ${device} STREQUAL "svg" OR + ${device} STREQUAL "svgcairo" OR + ${device} STREQUAL "bmpqt" OR + ${device} STREQUAL "jpgqt" OR + ${device} STREQUAL "pngqt" OR + ${device} STREQUAL "ppmqt" OR + ${device} STREQUAL "tiffqt" OR + ${device} STREQUAL "svgqt" OR + ${device} STREQUAL "epsqt" OR + ${device} STREQUAL "pdfqt" OR + ${device} STREQUAL "gif" + ) + set(familying ON) + else( + ${device} STREQUAL "png" OR + ${device} STREQUAL "pngcairo" OR + ${device} STREQUAL "jpeg" OR + ${device} STREQUAL "xfig" OR + ${device} STREQUAL "svg" OR + ${device} STREQUAL "svgcairo" OR + ${device} STREQUAL "bmpqt" OR + ${device} STREQUAL "jpgqt" OR + ${device} STREQUAL "pngqt" OR + ${device} STREQUAL "ppmqt" OR + ${device} STREQUAL "tiffqt" OR + ${device} STREQUAL "svgqt" OR + ${device} STREQUAL "epsqt" OR + ${device} STREQUAL "pdfqt" OR + ${device} STREQUAL "gif" + ) + set(familying OFF) + endif( + ${device} STREQUAL "png" OR + ${device} STREQUAL "pngcairo" OR + ${device} STREQUAL "jpeg" OR + ${device} STREQUAL "xfig" OR + ${device} STREQUAL "svg" OR + ${device} STREQUAL "svgcairo" OR + ${device} STREQUAL "bmpqt" OR + ${device} STREQUAL "jpgqt" OR + ${device} STREQUAL "pngqt" OR + ${device} STREQUAL "ppmqt" OR + ${device} STREQUAL "tiffqt" OR + ${device} STREQUAL "svgqt" OR + ${device} STREQUAL "epsqt" OR + ${device} STREQUAL "pdfqt" OR + ${device} STREQUAL "gif" + ) + set(file_list) + + foreach(example_pages ${examples_pages_LIST}) + string(REGEX REPLACE "^(.*):.*$" "\\1" example ${example_pages}) + string(REGEX REPLACE "^.*:(.*)$" "\\1" pages ${example_pages}) + if(${suffix} STREQUAL "a") + string(REGEX REPLACE "^x" "xthick" thick_example ${example}) + else(${suffix} STREQUAL "a") + set(thick_example) + endif(${suffix} STREQUAL "a") + if(familying) + foreach(famnum RANGE 1 ${pages}) + if(famnum LESS 10) + set(famnum 0${famnum}) + endif(famnum LESS 10) + list(APPEND file_list ${path}/${example}${suffix}${famnum}.${device}) + if(thick_example) + list(APPEND file_list ${path}/${thick_example}${suffix}${famnum}.${device}) + endif(thick_example) + endforeach(famnum RANGE 1 ${pages}) + else(familying) + list(APPEND file_list ${path}/${example}${suffix}.${device}) + if(thick_example) + list(APPEND file_list ${path}/${thick_example}${suffix}.${device}) + endif(thick_example) + endif(familying) + if(NOT ${example} STREQUAL "x14a") + list(APPEND file_list ${path}/${example}${suffix}_${device}.txt) + if(thick_example) + list(APPEND file_list ${path}/${thick_example}${suffix}_${device}.txt) + endif(thick_example) + endif(NOT ${example} STREQUAL "x14a") + endforeach(example_pages ${examples_pages_LIST}) + + set(${output_list} ${file_list} PARENT_SCOPE) +endfunction(list_example_files ) + +function(TRANSFORM_VERSION numerical_result version) + # internal_version ignores everything in version after any character that + # is not 0-9 or ".". This should take care of the case when there is + # some non-numerical data in the patch version. + #message(STATUS "DEBUG: version = ${version}") + string(REGEX REPLACE "^([0-9.]+).*$" "\\1" internal_version ${version}) + + # internal_version is normally a period-delimited triplet string of the form + # "major.minor.patch", but patch and/or minor could be missing. + # Transform internal_version into a numerical result that can be compared. + string(REGEX REPLACE "^([0-9]*).+$" "\\1" major ${internal_version}) + string(REGEX REPLACE "^[0-9]*\\.([0-9]*).*$" "\\1" minor ${internal_version}) + string(REGEX REPLACE "^[0-9]*\\.[0-9]*\\.([0-9]*)$" "\\1" patch ${internal_version}) + + if(NOT patch MATCHES "[0-9]+") + set(patch 0) + endif(NOT patch MATCHES "[0-9]+") + + if(NOT minor MATCHES "[0-9]+") + set(minor 0) + endif(NOT minor MATCHES "[0-9]+") + + if(NOT major MATCHES "[0-9]+") + set(major 0) + endif(NOT major MATCHES "[0-9]+") + #message(STATUS "DEBUG: internal_version = ${internal_version}") + #message(STATUS "DEBUG: major = ${major}") + #message(STATUS "DEBUG: minor= ${minor}") + #message(STATUS "DEBUG: patch = ${patch}") + math(EXPR internal_numerical_result + "${major}*1000000 + ${minor}*1000 + ${patch}" + ) + #message(STATUS "DEBUG: ${numerical_result} = ${internal_numerical_result}") + set(${numerical_result} ${internal_numerical_result} PARENT_SCOPE) +endfunction(TRANSFORM_VERSION) + +# CMake-2.6.x duplicates this list so work around that bug by removing +# those duplicates. +if(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) + list(REMOVE_DUPLICATES CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) +endif(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) + +# Filter all CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES list elements from +# rpath_in list. +function(filter_rpath rpath) + #message("DEBUG: ${rpath} = ${${rpath}}") + set(internal_rpath ${${rpath}}) + if(internal_rpath) + list(REMOVE_DUPLICATES internal_rpath) + if(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) + list(REMOVE_ITEM internal_rpath ${CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES}) + endif(CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES) + endif(internal_rpath) + #message("DEBUG: (filtered) ${rpath} = ${internal_rpath}") + set(${rpath} ${internal_rpath} PARENT_SCOPE) +endfunction(filter_rpath) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2012-02-17 22:39:23
|
Revision: 12168 http://plplot.svn.sourceforge.net/plplot/?rev=12168&view=rev Author: airwin Date: 2012-02-17 22:39:16 +0000 (Fri, 17 Feb 2012) Log Message: ----------- Modernize Lua build system support so that lua-5.x should work in general. These changes give good results for the test_diff_psc target in the build tree and CMake-based installed example tree for lua-5.1. They still need to be tested for lua-5.2 (and 5.0 if anybody still has access to that). Modified Paths: -------------- trunk/cmake/modules/lua.cmake Added Paths: ----------- trunk/cmake/modules/FindLua.cmake Added: trunk/cmake/modules/FindLua.cmake =================================================================== --- trunk/cmake/modules/FindLua.cmake (rev 0) +++ trunk/cmake/modules/FindLua.cmake 2012-02-17 22:39:16 UTC (rev 12168) @@ -0,0 +1,171 @@ +# Locate Lua executable, library, and headers. +# This module supersedes FindLua50 and FindLua51 (and also supports +# Lua-5.2) by using the +# lua -v command to determine version. +# This module defines +# LUA_FOUND, if false, do not try to link to Lua +# LUA_EXECUTABLE, full path of Lua executable used to determine LUA_VERSION +# LUA_VERSION +# LUA_LIBRARIES +# LUA_INCLUDE_DIR, where to find lua.h +# +# Note that the expected include convention is +# #include "lua.h" +# and not +# #include <lua/lua.h> +# This is because, the lua location is not standardized and may exist +# in locations other than lua/ + +#============================================================================= +# CMake - Cross Platform Makefile Generator +# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the names of Kitware, Inc., the Insight Software Consortium, +# nor the names of their contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# ------------------------------------------------------------------------------ +# The above copyright and license notice applies to distributions of +# CMake in source and binary form. Some source files contain additional +# notices of original copyright by their contributors; see each source +# for details. Third-party software packages supplied with CMake under +# compatible licenses provide their own copyright notices documented in +# corresponding subdirectories. +# +# ------------------------------------------------------------------------------ +# +# CMake was initially developed by Kitware with the following sponsorship: +# +# * National Library of Medicine at the National Institutes of Health +# as part of the Insight Segmentation and Registration Toolkit (ITK). +# +# * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel +# Visualization Initiative. +# +# * National Alliance for Medical Image Computing (NAMIC) is funded by the +# National Institutes of Health through the NIH Roadmap for Medical Research, +# Grant U54 EB005149. +# +# * Kitware, Inc. + +find_program(LUA_EXECUTABLE lua + HINTS + $ENV{LUA_DIR} + PATH_SUFFIXES bin + PATHS + ~/Library/Frameworks + /Library/Frameworks + /usr/local + /usr + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt + ) + +if(LUA_EXECUTABLE) + #N.B. lua -v outputs results to stderr (at least for lua-5.1) so + #look for version string results in both stderr and stdout. + execute_process( + COMMAND ${LUA_EXECUTABLE} -v + RESULT_VARIABLE LUA_ERR + OUTPUT_VARIABLE LUA_VERSION_STRING + ERROR_VARIABLE LUA_VERSION_STRING + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE + ) + if(LUA_ERR) + message(WARNING "Lua executable broken. Could not determine version string without an error") + set(LUA_EXECUTABLE OFF CACHE BOOL "Lua executable location" FORCE) + endif(LUA_ERR) +endif(LUA_EXECUTABLE) + +if(LUA_EXECUTABLE) + string(REGEX MATCH "5\\.[0-9]" LUA_VERSION "${LUA_VERSION_STRING}") + message(STATUS "LUA_VERSION = ${LUA_VERSION}") + string(REGEX MATCH "[0-9]$" LUA_VERSION_SUFFIX "${LUA_VERSION}") + set(LUA_INCLUDE_SUFFIX_VERSIONS include/lua5${LUA_VERSION_SUFFIX} include/lua5.${LUA_VERSION_SUFFIX}) + set(LUA_LIBRARY_NAME_VERSIONS lua5${LUA_VERSION_SUFFIX} lua5.${LUA_VERSION_SUFFIX} lua-5.${LUA_VERSION_SUFFIX}) + if(NOT LUA_VERSION MATCHES "5\\.[0-9]") + message(WARNING "Could not parse Lua version string") + set(LUA_EXECUTABLE OFF CACHE BOOL "Lua executable location" FORCE) + endif(NOT LUA_VERSION MATCHES "5\\.[0-9]") +endif(LUA_EXECUTABLE) + +if(LUA_EXECUTABLE) + find_path(LUA_INCLUDE_DIR lua.h + HINTS + $ENV{LUA_DIR} + PATH_SUFFIXES ${LUA_INCLUDE_SUFFIX_VERSIONS} include/lua include + PATHS + ~/Library/Frameworks + /Library/Frameworks + /usr/local + /usr + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt + ) + message(STATUS "LUA_INCLUDE_DIR = ${LUA_INCLUDE_DIR}") + + find_library(LUA_LIBRARY + NAMES ${LUA_LIBRARY_NAME_VERSIONS} lua + HINTS + $ENV{LUA_DIR} + PATH_SUFFIXES lib64 lib + PATHS + ~/Library/Frameworks + /Library/Frameworks + /usr/local + /usr + /sw + /opt/local + /opt/csw + /opt + ) + + if(LUA_LIBRARY) + # include the math library for Unix + if(UNIX AND NOT APPLE) + find_library(LUA_MATH_LIBRARY m) + set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries") + # For Windows and Mac, don't need to explicitly include the math library + else(UNIX AND NOT APPLE) + set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries") + endif(UNIX AND NOT APPLE) + endif(LUA_LIBRARY) + message(STATUS "LUA_LIBRARIES = ${LUA_LIBRARIES}") +endif(LUA_EXECUTABLE) + +include(FindPackageHandleStandardArgs) +# handle the QUIET and REQUIRED arguments and set LUA_FOUND to TRUE if +# all listed variables are TRUE +find_package_handle_standard_args(Lua DEFAULT_MSG LUA_EXECUTABLE LUA_VERSION LUA_LIBRARIES LUA_INCLUDE_DIR) + +mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY) Modified: trunk/cmake/modules/lua.cmake =================================================================== --- trunk/cmake/modules/lua.cmake 2012-02-16 20:24:20 UTC (rev 12167) +++ trunk/cmake/modules/lua.cmake 2012-02-17 22:39:16 UTC (rev 12168) @@ -59,16 +59,13 @@ # Check for Lua libraries which defines # LUA_LIBRARIES = path to the Lua library # LUA_INCLUDE_DIR = path to where lua.h is found - # and LUA51_FOUND and LUA50_FOUND consistently. - find_package(Lua51) - if(NOT LUA51_FOUND) - find_package(Lua50) - endif(NOT LUA51_FOUND) - if(NOT LUA51_FOUND AND NOT LUA51_FOUND) + # and LUA_FOUND consistently. + find_package(Lua) + if(NOT LUA_FOUND) message(STATUS "WARNING: " "Lua library and/or header not found. Disabling Lua bindings") set(ENABLE_lua OFF CACHE BOOL "Enable Lua bindings" FORCE) - endif(NOT LUA51_FOUND AND NOT LUA51_FOUND) + endif(NOT LUA_FOUND) endif(ENABLE_lua) if(ENABLE_lua) @@ -81,40 +78,11 @@ endif(ENABLE_lua) if(ENABLE_lua) - # Check whether you have found a Lua executable that is consistent - # with the library version. - execute_process(COMMAND ${LUA_EXECUTABLE} -v - OUTPUT_VARIABLE LUA_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_VARIABLE LUA_VERSION - ERROR_STRIP_TRAILING_WHITESPACE - ) - #message("(preliminary) LUA_VERSION = ${LUA_VERSION}") - string(REGEX MATCH "[0-9]\\.[0-9]\\.[0-9]" LUA_VERSION "${LUA_VERSION}") - #message("(dotted triplet) LUA_VERSION = ${LUA_VERSION}") - # Reduce to just major.minor for purposes of comparison. - string(SUBSTRING "${LUA_VERSION}" 0 3 LUA_VERSION) - message(STATUS "LUA_VERSION = ${LUA_VERSION}") - set(LUA_VERSION_VALID) - if(${LUA_VERSION} STREQUAL "5.0" AND LUA50_FOUND) - set(LUA_VERSION_VALID ON) - elseif(${LUA_VERSION} STREQUAL "5.1" AND LUA51_FOUND) - set(LUA_VERSION_VALID ON) - endif(${LUA_VERSION} STREQUAL "5.0" AND LUA50_FOUND) - - if(NOT LUA_VERSION_VALID) - message(STATUS "WARNING: " - "Lua executable found but version not consistent with library. Disabling Lua bindings") - set(ENABLE_lua OFF CACHE BOOL "Enable Lua bindings" FORCE) - endif(NOT LUA_VERSION_VALID) -endif(ENABLE_lua) - -if(ENABLE_lua) # Unless some better convention comes along, follow what Debian does for # install location of Lua wrapper shared object. - if(LUA51_FOUND) - set(LUA_DIR ${LIB_DIR}/lua/5.1/plplot) - else(LUA51_FOUND) + if(LUA_VERSION MATCHES "5\\.0") set(LUA_DIR ${LIB_DIR}/lua/50/plplot) - endif(LUA51_FOUND) + else(LUA_VERSION MATCHES "5\\.0") + set(LUA_DIR ${LIB_DIR}/lua/${LUA_VERSION}/plplot) + endif(LUA_VERSION MATCHES "5\\.0") endif(ENABLE_lua) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2013-11-08 21:41:38
|
Revision: 12671 http://sourceforge.net/p/plplot/code/12671 Author: airwin Date: 2013-11-08 21:41:30 +0000 (Fri, 08 Nov 2013) Log Message: ----------- Rationalize and strengthen Itcl, Itk, and Iwidgets detection and consistency checking. Use temporary files written by CMake in the build tree rather than permanent files in our source tree to do these checks using tclsh. Modified Paths: -------------- trunk/cmake/modules/tcl-related.cmake Removed Paths: ------------- trunk/cmake/modules/CheckITCL_Available.tcl trunk/cmake/modules/CheckTCL_GT_84.tcl trunk/cmake/modules/GetITCL_Version.tcl Deleted: trunk/cmake/modules/CheckITCL_Available.tcl =================================================================== --- trunk/cmake/modules/CheckITCL_Available.tcl 2013-11-08 07:52:13 UTC (rev 12670) +++ trunk/cmake/modules/CheckITCL_Available.tcl 2013-11-08 21:41:30 UTC (rev 12671) @@ -1 +0,0 @@ -puts -nonewline [expr {[catch {package require Itcl}]==1? 0: 1}]; exit Deleted: trunk/cmake/modules/CheckTCL_GT_84.tcl =================================================================== --- trunk/cmake/modules/CheckTCL_GT_84.tcl 2013-11-08 07:52:13 UTC (rev 12670) +++ trunk/cmake/modules/CheckTCL_GT_84.tcl 2013-11-08 21:41:30 UTC (rev 12671) @@ -1 +0,0 @@ -puts -nonewline [package vsatisfies [info patchlevel] 8.5]; exit Deleted: trunk/cmake/modules/GetITCL_Version.tcl =================================================================== --- trunk/cmake/modules/GetITCL_Version.tcl 2013-11-08 07:52:13 UTC (rev 12670) +++ trunk/cmake/modules/GetITCL_Version.tcl 2013-11-08 21:41:30 UTC (rev 12671) @@ -1,2 +0,0 @@ -# Extract the version of Itcl -puts -nonewline [package require Itcl]; exit Modified: trunk/cmake/modules/tcl-related.cmake =================================================================== --- trunk/cmake/modules/tcl-related.cmake 2013-11-08 07:52:13 UTC (rev 12670) +++ trunk/cmake/modules/tcl-related.cmake 2013-11-08 21:41:30 UTC (rev 12671) @@ -1,6 +1,6 @@ # cmake/modules/tcl-related.cmake # -# Copyright (C) 2006 Alan W. Irwin +# Copyright (C) 2006-2013 Alan W. Irwin # # This file is part of PLplot. # @@ -24,12 +24,12 @@ option(ENABLE_tcl "Enable Tcl bindings" OFF) option(ENABLE_itcl "Enable incr Tcl interface code" OFF) option(ENABLE_tk "Enable Tk interface code" OFF) - option(ENABLE_itk "Enable incr TK interface code" OFF) + option(ENABLE_itk "Enable incr Tk interface code" OFF) else(DEFAULT_NO_BINDINGS) option(ENABLE_tcl "Enable Tcl bindings" ON) option(ENABLE_itcl "Enable incr Tcl interface code" ON) option(ENABLE_tk "Enable Tk interface code" ON) - option(ENABLE_itk "Enable incr TK interface code" ON) + option(ENABLE_itk "Enable incr Tk interface code" ON) endif(DEFAULT_NO_BINDINGS) option(USE_INCRTCL_VERSION_4 "Use [incr Tcl] version 4" OFF) @@ -64,6 +64,8 @@ message(STATUS "Looking for include paths and libraries for Tcl/Tk - found" ) + get_filename_component(TCL_LIBRARY_PATH ${TCL_LIBRARY} PATH) + message(STATUS "Looking for tclsh") include(FindTclsh) if(TCL_TCLSH) @@ -81,29 +83,29 @@ message(STATUS "TCL_INCLUDE_PATH = ${TCL_INCLUDE_PATH}") message(STATUS "TCL_LIBRARY = ${TCL_LIBRARY}") if(ENABLE_itcl) + if(USE_INCRTCL_VERSION_4) + set(SUGGESTED_ITCL_VERSION 4) + else(USE_INCRTCL_VERSION_4) + set(SUGGESTED_ITCL_VERSION 3) + endif(USE_INCRTCL_VERSION_4) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_Available.tcl "puts -nonewline [package require Itcl ${SUGGESTED_ITCL_VERSION}]; exit") + # Refine SUGGESTED_ITCL_VERSION to exact value or fail. execute_process( - COMMAND ${TCL_TCLSH} CheckITCL_Available.tcl - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/modules - OUTPUT_VARIABLE AVAILABLE_ITCL) - if(AVAILABLE_ITCL) - execute_process( - COMMAND ${TCL_TCLSH} GetITCL_Version.tcl - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/modules - OUTPUT_VARIABLE itcl_library_versions) + COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_Available.tcl + RESULT_VARIABLE ITCL_RC + OUTPUT_VARIABLE ITCL_VERSION + ERROR_VARIABLE ITCL_STDERR + ) + if(NOT ITCL_RC) + set(ITCL_PACKAGE_NAME "-exact Itcl ${ITCL_VERSION}") + message(STATUS "ITCL_PACKAGE_NAME = ${ITCL_PACKAGE_NAME}") message(STATUS "Looking for itcl.h") find_path(ITCL_INCLUDE_PATH itcl.h ${TCL_INCLUDE_PATH}) if(ITCL_INCLUDE_PATH) message(STATUS "Looking for itcl.h - found") message(STATUS "Looking for itcl library") - get_filename_component(TCL_LIBRARY_PATH ${TCL_LIBRARY} PATH) - set(itcl_library_versions 3.4 3.3 3.2 3.1 3.0 2.1 2.0) - if(USE_INCRTCL_VERSION_4) - set(itcl_library_versions 4.0.0 ${itcl_library_versions}) - endif(USE_INCRTCL_VERSION_4) - foreach(version ${itcl_library_versions}) - find_library(ITCL_LIBRARY itcl${version} PATHS ${TCL_LIBRARY_PATH} - PATH_SUFFIXES itcl${version}) - endforeach(version ${itcl_library_versions}) + find_library(ITCL_LIBRARY itcl${ITCL_VERSION} PATHS ${TCL_LIBRARY_PATH} + PATH_SUFFIXES itcl${ITCL_VERSION}) if(ITCL_LIBRARY) message(STATUS "Looking for itcl library - found") set(HAVE_ITCL ON) @@ -118,11 +120,12 @@ message(STATUS "WARNING: Disabling incr Tcl interface code") set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE) endif(ITCL_INCLUDE_PATH) - else(AVAILABLE_ITCL) + else(NOT ITCL_RC) message(STATUS "Itcl not available or not compatible with current Tcl shell") + message(STATUS "WARNING: Disabling incr Tcl interface code") set(HAVE_ITCL OFF) set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE) - endif(AVAILABLE_ITCL) + endif(NOT ITCL_RC) endif(ENABLE_itcl) if(ENABLE_itcl) message(STATUS "ITCL_INCLUDE_PATH = ${ITCL_INCLUDE_PATH}") @@ -161,33 +164,101 @@ set(ENABLE_itk OFF CACHE BOOL "Enable incr Tk interface code" FORCE) endif(ENABLE_tk) if(ENABLE_itk) - message(STATUS "Looking for itk.h") - find_path(ITK_INCLUDE_PATH itk.h ${TK_INCLUDE_PATH}) - if(ITK_INCLUDE_PATH) - message(STATUS "Looking for itk.h - found") - message(STATUS "Looking for itk library") - set(itk_library_versions 3.4 3.3 3.2 3.1 3.0 2.1 2.0) - if(USE_INCRTCL_VERSION_4) - set(itk_library_versions 4.0.0 ${itk_library_versions}) - endif(USE_INCRTCL_VERSION_4) - foreach(version ${itk_library_versions}) - find_library(ITK_LIBRARY itk${version} PATHS ${TCL_LIBRARY_PATH} - PATH_SUFFIXES itk${version}) - endforeach(version ${itk_library_versions}) - if(ITK_LIBRARY) - message(STATUS "Looking for itk library - found") - set(HAVE_ITK ON) - else(ITK_LIBRARY) - message(STATUS "Looking for itk library - not found") + if(USE_INCRTCL_VERSION_4) + set(SUGGESTED_ITK_VERSION 4) + else(USE_INCRTCL_VERSION_4) + set(SUGGESTED_ITK_VERSION 3) + endif(USE_INCRTCL_VERSION_4) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_Available.tcl "puts -nonewline [package require Itk ${SUGGESTED_ITK_VERSION}]; exit") + # Refine SUGGESTED_ITK_VERSION to exact value or fail. + execute_process( + COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_Available.tcl + RESULT_VARIABLE ITK_RC + OUTPUT_VARIABLE ITK_VERSION + ERROR_VARIABLE ITK_STDERR + ) + if(NOT ITK_RC) + set(ITK_PACKAGE_NAME "-exact Itk ${ITK_VERSION}") + message(STATUS "ITK_PACKAGE_NAME = ${ITK_PACKAGE_NAME}") + message(STATUS "Looking for itk.h") + find_path(ITK_INCLUDE_PATH itk.h ${TK_INCLUDE_PATH}) + if(ITK_INCLUDE_PATH) + message(STATUS "Looking for itk.h - found") + message(STATUS "Looking for itk library") + find_library(ITK_LIBRARY itk${ITK_VERSION} PATHS ${TCL_LIBRARY_PATH} + PATH_SUFFIXES itk${ITK_VERSION}) + if(ITK_LIBRARY) + message(STATUS "Looking for itk library - found") + set(HAVE_ITK ON) + + # Test version consistency between iwidgets, itk, and itcl. + if(USE_INCRTCL_VERSION_4) + set(SUGGESTED_IWIDGETS_VERSION 4.1) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl "puts -nonewline \"[package require Iwidgets ${SUGGESTED_IWIDGETS_VERSION}];[package require Itk];[package require Itcl]\";exit") + execute_process( + COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl + RESULT_VARIABLE IWIDGETS_RC + OUTPUT_VARIABLE IWIDGETS_VERSIONS_LIST + ERROR_VARIABLE IWIDGETS_STDERR + ) + else(USE_INCRTCL_VERSION_4) + # Find maximum 4.0 version of iwidgets that is + # available. 4.0.1 (released in 2002) is the largest + # version of iwidgets4.0 (as opposed to the recently + # developed iwidgets4.1) I have found on the web in + # tarball form, but I have seen one reference to 4.0.2 + # which may have been publicly released somewhere + # inaccessible to my google searches or privately made + # available before all development of iwidgets4.0 + # stopped. So add 4.0.2 to the list just in case. + foreach(SUGGESTED_ITK_VERSION 4.0.2 4.0.1 4.0.0) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl "puts -nonewline \"[package require Iwidgets ${SUGGESTED_IWIDGETS_VERSION}];[package require Itk];[package require Itcl]\";exit") + execute_process( + COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl + RESULT_VARIABLE IWIDGETS_RC + OUTPUT_VARIABLE IWIDGETS_VERSIONS_LIST + ERROR_VARIABLE IWIDGETS_STDERR + ) + if(NOT IWIDGETS_RC) + break() + endif(NOT IWIDGETS_RC) + endforeach(SUGGESTED_ITK_VERSION 4.0.2 4.0.1 4.0.0) + endif(USE_INCRTCL_VERSION_4) + if(NOT IWIDGETS_RC) + list(GET IWIDGETS_VERSIONS_LIST 0 IWIDGETS_VERSION) + list(GET IWIDGETS_VERSIONS_LIST 1 CONSISTENT_ITK_VERSION) + list(GET IWIDGETS_VERSIONS_LIST 2 CONSISTENT_ITCL_VERSION) + if(CONSISTENT_ITCL_VERSION STREQUAL ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL ITK_VERSION) + set(IWIDGETS_PACKAGE_NAME "-exact Iwidgets ${IWIDGETS_VERSION}") + message(STATUS "IWIDGETS_PACKAGE_NAME = ${IWIDGETS_PACKAGE_NAME}") + else(CONSISTENT_ITCL_VERSION STREQUAL ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL ITK_VERSION) + message(STATUS "WARNING: Consistent combination of Iwidgets, Itk, and Itcl not found so disabling Itcl and Itk") + set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE) + set(ENABLE_itk OFF CACHE BOOL "Enable incr Tk interface code" FORCE) + endif(CONSISTENT_ITCL_VERSION STREQUAL ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL ITK_VERSION) + else(NOT IWIDGETS_RC) + message(STATUS "WARNING: Iwidgets could not be found so disabling Itcl and Itk") + set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE) + set(ENABLE_itk OFF CACHE BOOL "Enable incr Tk interface code" FORCE) + endif(NOT IWIDGETS_RC) + else(ITK_LIBRARY) + message(STATUS "Looking for itk library - not found") + message(STATUS "WARNING: Disabling incr Tk interface code") + set(ENABLE_itk OFF CACHE BOOL "Enable incr Tk interface code" FORCE) + endif(ITK_LIBRARY) + else(ITK_INCLUDE_PATH) + message(STATUS "Looking for itk.h - not found") message(STATUS "WARNING: Disabling incr Tk interface code") set(ENABLE_itk OFF CACHE BOOL "Enable incr Tk interface code" FORCE) - endif(ITK_LIBRARY) - else(ITK_INCLUDE_PATH) - message(STATUS "Looking for itk.h - not found") + endif(ITK_INCLUDE_PATH) + else(NOT ITK_RC) + message(STATUS "Itk not available or not compatible with current Tcl shell") message(STATUS "WARNING: Disabling incr Tk interface code") + set(HAVE_ITK OFF) set(ENABLE_itk OFF CACHE BOOL "Enable incr Tk interface code" FORCE) - endif(ITK_INCLUDE_PATH) + endif(NOT ITK_RC) endif(ENABLE_itk) + if(ENABLE_itk) message(STATUS "ITK_INCLUDE_PATH = ${ITK_INCLUDE_PATH}") message(STATUS "ITK_LIBRARY = ${ITK_LIBRARY}") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2014-03-06 17:56:26
|
Revision: 13046 http://sourceforge.net/p/plplot/code/13046 Author: airwin Date: 2014-03-06 17:56:23 +0000 (Thu, 06 Mar 2014) Log Message: ----------- Set svn:eol-style property to native. Modified Paths: -------------- trunk/cmake/modules/FindFreetype.cmake trunk/cmake/modules/FindwxWidgets.cmake Property Changed: ---------------- trunk/cmake/modules/FindFreetype.cmake trunk/cmake/modules/FindwxWidgets.cmake Modified: trunk/cmake/modules/FindFreetype.cmake =================================================================== --- trunk/cmake/modules/FindFreetype.cmake 2014-03-06 13:26:33 UTC (rev 13045) +++ trunk/cmake/modules/FindFreetype.cmake 2014-03-06 17:56:23 UTC (rev 13046) @@ -1,142 +1,142 @@ -#.rst: -# FindFreetype -# ------------ -# -# Locate FreeType library -# -# This module defines -# -# :: -# -# FREETYPE_LIBRARIES, the library to link against -# FREETYPE_FOUND, if false, do not try to link to FREETYPE -# FREETYPE_INCLUDE_DIRS, where to find headers. -# FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8) -# This is the concatenation of the paths: -# FREETYPE_INCLUDE_DIR_ft2build -# FREETYPE_INCLUDE_DIR_freetype2 -# -# -# -# $FREETYPE_DIR is an environment variable that would correspond to the -# ./configure --prefix=$FREETYPE_DIR used in building FREETYPE. - -#============================================================================= -# Copyright 2007-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -# Created by Eric Wing. -# Modifications by Alexander Neundorf. -# This file has been renamed to "FindFreetype.cmake" instead of the correct -# "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex. - -# Ugh, FreeType seems to use some #include trickery which -# makes this harder than it should be. It looks like they -# put ft2build.h in a common/easier-to-find location which -# then contains a #include to a more specific header in a -# more specific location (#include <freetype/config/ftheader.h>). -# Then from there, they need to set a bunch of #define's -# so you can do something like: -# #include FT_FREETYPE_H -# Unfortunately, using CMake's mechanisms like include_directories() -# wants explicit full paths and this trickery doesn't work too well. -# I'm going to attempt to cut out the middleman and hope -# everything still works. -find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h - HINTS - ENV FREETYPE_DIR - PATHS - /usr/X11R6 - /usr/local/X11R6 - /usr/local/X11 - /usr/freeware - ENV GTKMM_BASEPATH - [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] - PATH_SUFFIXES include/freetype2 include -) - -find_path(FREETYPE_INCLUDE_DIR_freetype2 - NAMES - freetype/config/ftheader.h - config/ftheader.h - HINTS - ENV FREETYPE_DIR - PATHS - /usr/X11R6 - /usr/local/X11R6 - /usr/local/X11 - /usr/freeware - ENV GTKMM_BASEPATH - [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] - PATH_SUFFIXES include/freetype2 include -) - -find_library(FREETYPE_LIBRARY - NAMES freetype libfreetype freetype219 - HINTS - ENV FREETYPE_DIR - PATH_SUFFIXES lib - PATHS - /usr/X11R6 - /usr/local/X11R6 - /usr/local/X11 - /usr/freeware - ENV GTKMM_BASEPATH - [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] - [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] -) - -# set the user variables -if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) - set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}") - list(REMOVE_DUPLICATES FREETYPE_INCLUDE_DIRS) -endif() -set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}") - -if(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h") - set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h") -elseif(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h") - set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h") -endif() - -if(FREETYPE_INCLUDE_DIR_freetype2 AND FREETYPE_H) - file(STRINGS "${FREETYPE_H}" freetype_version_str - REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$") - - unset(FREETYPE_VERSION_STRING) - foreach(VPART MAJOR MINOR PATCH) - foreach(VLINE ${freetype_version_str}) - if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}") - string(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1" - FREETYPE_VERSION_PART "${VLINE}") - if(FREETYPE_VERSION_STRING) - set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}") - else() - set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}") - endif() - unset(FREETYPE_VERSION_PART) - endif() - endforeach() - endforeach() -endif() - - -# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if -# all listed variables are TRUE -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype - REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS - VERSION_VAR FREETYPE_VERSION_STRING) - -mark_as_advanced(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build) +#.rst: +# FindFreetype +# ------------ +# +# Locate FreeType library +# +# This module defines +# +# :: +# +# FREETYPE_LIBRARIES, the library to link against +# FREETYPE_FOUND, if false, do not try to link to FREETYPE +# FREETYPE_INCLUDE_DIRS, where to find headers. +# FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8) +# This is the concatenation of the paths: +# FREETYPE_INCLUDE_DIR_ft2build +# FREETYPE_INCLUDE_DIR_freetype2 +# +# +# +# $FREETYPE_DIR is an environment variable that would correspond to the +# ./configure --prefix=$FREETYPE_DIR used in building FREETYPE. + +#============================================================================= +# Copyright 2007-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# Created by Eric Wing. +# Modifications by Alexander Neundorf. +# This file has been renamed to "FindFreetype.cmake" instead of the correct +# "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex. + +# Ugh, FreeType seems to use some #include trickery which +# makes this harder than it should be. It looks like they +# put ft2build.h in a common/easier-to-find location which +# then contains a #include to a more specific header in a +# more specific location (#include <freetype/config/ftheader.h>). +# Then from there, they need to set a bunch of #define's +# so you can do something like: +# #include FT_FREETYPE_H +# Unfortunately, using CMake's mechanisms like include_directories() +# wants explicit full paths and this trickery doesn't work too well. +# I'm going to attempt to cut out the middleman and hope +# everything still works. +find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h + HINTS + ENV FREETYPE_DIR + PATHS + /usr/X11R6 + /usr/local/X11R6 + /usr/local/X11 + /usr/freeware + ENV GTKMM_BASEPATH + [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] + PATH_SUFFIXES include/freetype2 include +) + +find_path(FREETYPE_INCLUDE_DIR_freetype2 + NAMES + freetype/config/ftheader.h + config/ftheader.h + HINTS + ENV FREETYPE_DIR + PATHS + /usr/X11R6 + /usr/local/X11R6 + /usr/local/X11 + /usr/freeware + ENV GTKMM_BASEPATH + [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] + PATH_SUFFIXES include/freetype2 include +) + +find_library(FREETYPE_LIBRARY + NAMES freetype libfreetype freetype219 + HINTS + ENV FREETYPE_DIR + PATH_SUFFIXES lib + PATHS + /usr/X11R6 + /usr/local/X11R6 + /usr/local/X11 + /usr/freeware + ENV GTKMM_BASEPATH + [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path] + [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path] +) + +# set the user variables +if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) + set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}") + list(REMOVE_DUPLICATES FREETYPE_INCLUDE_DIRS) +endif() +set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}") + +if(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h") + set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h") +elseif(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h") + set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h") +endif() + +if(FREETYPE_INCLUDE_DIR_freetype2 AND FREETYPE_H) + file(STRINGS "${FREETYPE_H}" freetype_version_str + REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$") + + unset(FREETYPE_VERSION_STRING) + foreach(VPART MAJOR MINOR PATCH) + foreach(VLINE ${freetype_version_str}) + if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}") + string(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1" + FREETYPE_VERSION_PART "${VLINE}") + if(FREETYPE_VERSION_STRING) + set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}") + else() + set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}") + endif() + unset(FREETYPE_VERSION_PART) + endif() + endforeach() + endforeach() +endif() + + +# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if +# all listed variables are TRUE +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype + REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS + VERSION_VAR FREETYPE_VERSION_STRING) + +mark_as_advanced(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build) Property changes on: trunk/cmake/modules/FindFreetype.cmake ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/cmake/modules/FindwxWidgets.cmake =================================================================== --- trunk/cmake/modules/FindwxWidgets.cmake 2014-03-06 13:26:33 UTC (rev 13045) +++ trunk/cmake/modules/FindwxWidgets.cmake 2014-03-06 17:56:23 UTC (rev 13046) @@ -1,1104 +1,1104 @@ -#.rst: -# FindwxWidgets -# ------------- -# -# Find a wxWidgets (a.k.a., wxWindows) installation. -# -# This module finds if wxWidgets is installed and selects a default -# configuration to use. wxWidgets is a modular library. To specify the -# modules that you will use, you need to name them as components to the -# package: -# -# find_package(wxWidgets COMPONENTS core base ...) -# -# There are two search branches: a windows style and a unix style. For -# windows, the following variables are searched for and set to defaults -# in case of multiple choices. Change them if the defaults are not -# desired (i.e., these are the only variables you should change to -# select a configuration): -# -# :: -# -# wxWidgets_ROOT_DIR - Base wxWidgets directory -# (e.g., C:/wxWidgets-2.6.3). -# wxWidgets_LIB_DIR - Path to wxWidgets libraries -# (e.g., C:/wxWidgets-2.6.3/lib/vc_lib). -# wxWidgets_CONFIGURATION - Configuration to use -# (e.g., msw, mswd, mswu, mswunivud, etc.) -# wxWidgets_EXCLUDE_COMMON_LIBRARIES -# - Set to TRUE to exclude linking of -# commonly required libs (e.g., png tiff -# jpeg zlib regex expat). -# -# -# -# For unix style it uses the wx-config utility. You can select between -# debug/release, unicode/ansi, universal/non-universal, and -# static/shared in the QtDialog or ccmake interfaces by turning ON/OFF -# the following variables: -# -# :: -# -# wxWidgets_USE_DEBUG -# wxWidgets_USE_UNICODE -# wxWidgets_USE_UNIVERSAL -# wxWidgets_USE_STATIC -# -# -# -# There is also a wxWidgets_CONFIG_OPTIONS variable for all other -# options that need to be passed to the wx-config utility. For example, -# to use the base toolkit found in the /usr/local path, set the variable -# (before calling the FIND_PACKAGE command) as such: -# -# :: -# -# set(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr) -# -# -# -# The following are set after the configuration is done for both windows -# and unix style: -# -# :: -# -# wxWidgets_FOUND - Set to TRUE if wxWidgets was found. -# wxWidgets_INCLUDE_DIRS - Include directories for WIN32 -# i.e., where to find "wx/wx.h" and -# "wx/setup.h"; possibly empty for unices. -# wxWidgets_LIBRARIES - Path to the wxWidgets libraries. -# wxWidgets_LIBRARY_DIRS - compile time link dirs, useful for -# rpath on UNIX. Typically an empty string -# in WIN32 environment. -# wxWidgets_DEFINITIONS - Contains defines required to compile/link -# against WX, e.g. WXUSINGDLL -# wxWidgets_DEFINITIONS_DEBUG- Contains defines required to compile/link -# against WX debug builds, e.g. __WXDEBUG__ -# wxWidgets_CXX_FLAGS - Include dirs and compiler flags for -# unices, empty on WIN32. Essentially -# "`wx-config --cxxflags`". -# wxWidgets_USE_FILE - Convenience include file. -# -# -# -# Sample usage: -# -# :: -# -# # Note that for MinGW users the order of libs is important! -# find_package(wxWidgets COMPONENTS net gl core base) -# if(wxWidgets_FOUND) -# include(${wxWidgets_USE_FILE}) -# # and for each of your dependent executable/library targets: -# target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES}) -# endif() -# -# -# -# If wxWidgets is required (i.e., not an optional part): -# -# :: -# -# find_package(wxWidgets REQUIRED net gl core base) -# include(${wxWidgets_USE_FILE}) -# # and for each of your dependent executable/library targets: -# target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES}) - -#============================================================================= -# Copyright 2004-2009 Kitware, Inc. -# Copyright 2007-2009 Miguel A. Figueroa-Villanueva <miguelf at ieee dot org> -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -# -# FIXME: check this and provide a correct sample usage... -# Remember to connect back to the upper text. -# Sample usage with monolithic wx build: -# -# find_package(wxWidgets COMPONENTS mono) -# ... - -# NOTES -# -# This module has been tested on the WIN32 platform with wxWidgets -# 2.6.2, 2.6.3, and 2.5.3. However, it has been designed to -# easily extend support to all possible builds, e.g., static/shared, -# debug/release, unicode, universal, multilib/monolithic, etc.. -# -# If you want to use the module and your build type is not supported -# out-of-the-box, please contact me to exchange information on how -# your system is setup and I'll try to add support for it. -# -# AUTHOR -# -# Miguel A. Figueroa-Villanueva (miguelf at ieee dot org). -# Jan Woetzel (jw at mip.informatik.uni-kiel.de). -# -# Based on previous works of: -# Jan Woetzel (FindwxWindows.cmake), -# Jorgen Bodde and Jerry Fath (FindwxWin.cmake). - -# TODO/ideas -# -# (1) Option/Setting to use all available wx libs -# In contrast to expert developer who lists the -# minimal set of required libs in wxWidgets_USE_LIBS -# there is the newbie user: -# - who just wants to link against WX with more 'magic' -# - doesn't know the internal structure of WX or how it was built, -# in particular if it is monolithic or not -# - want to link against all available WX libs -# Basically, the intent here is to mimic what wx-config would do by -# default (i.e., `wx-config --libs`). -# -# Possible solution: -# Add a reserved keyword "std" that initializes to what wx-config -# would default to. If the user has not set the wxWidgets_USE_LIBS, -# default to "std" instead of "base core" as it is now. To implement -# "std" will basically boil down to a FOR_EACH lib-FOUND, but maybe -# checking whether a minimal set was found. - - -# FIXME: This and all the DBG_MSG calls should be removed after the -# module stabilizes. -# -# Helper macro to control the debugging output globally. There are -# two versions for controlling how verbose your output should be. -macro(DBG_MSG _MSG) -# message(STATUS -# "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") -endmacro() -macro(DBG_MSG_V _MSG) -# message(STATUS -# "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") -endmacro() - -# Clear return values in case the module is loaded more than once. -set(wxWidgets_FOUND FALSE) -set(wxWidgets_INCLUDE_DIRS "") -set(wxWidgets_LIBRARIES "") -set(wxWidgets_LIBRARY_DIRS "") -set(wxWidgets_CXX_FLAGS "") - -# Using SYSTEM with INCLUDE_DIRECTORIES in conjunction with wxWidgets on -# the Mac produces compiler errors. Set wxWidgets_INCLUDE_DIRS_NO_SYSTEM -# to prevent UsewxWidgets.cmake from using SYSTEM. -# -# See cmake mailing list discussions for more info: -# http://www.cmake.org/pipermail/cmake/2008-April/021115.html -# http://www.cmake.org/pipermail/cmake/2008-April/021146.html -# -if(APPLE OR CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") - set(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1) -endif() - -# DEPRECATED: This is a patch to support the DEPRECATED use of -# wxWidgets_USE_LIBS. -# -# If wxWidgets_USE_LIBS is set: -# - if using <components>, then override wxWidgets_USE_LIBS -# - else set wxWidgets_FIND_COMPONENTS to wxWidgets_USE_LIBS -if(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS) - set(wxWidgets_FIND_COMPONENTS ${wxWidgets_USE_LIBS}) -endif() -DBG_MSG("wxWidgets_FIND_COMPONENTS : ${wxWidgets_FIND_COMPONENTS}") - -# Add the convenience use file if available. -# -# Get dir of this file which may reside in: -# - CMAKE_MAKE_ROOT/Modules on CMake installation -# - CMAKE_MODULE_PATH if user prefers his own specialized version -set(wxWidgets_USE_FILE "") -get_filename_component( - wxWidgets_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) -# Prefer an existing customized version, but the user might override -# the FindwxWidgets module and not the UsewxWidgets one. -if(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") - set(wxWidgets_USE_FILE - "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") -else() - set(wxWidgets_USE_FILE UsewxWidgets) -endif() - -#===================================================================== -#===================================================================== -if(WIN32 AND NOT CYGWIN AND NOT MSYS) - set(wxWidgets_FIND_STYLE "win32") -else() - if(UNIX OR MSYS) - set(wxWidgets_FIND_STYLE "unix") - endif() -endif() - -#===================================================================== -# WIN32_FIND_STYLE -#===================================================================== -if(wxWidgets_FIND_STYLE STREQUAL "win32") - # Useful common wx libs needed by almost all components. - set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat) - - # DEPRECATED: Use find_package(wxWidgets COMPONENTS mono) instead. - if(NOT wxWidgets_FIND_COMPONENTS) - if(wxWidgets_USE_MONOLITHIC) - set(wxWidgets_FIND_COMPONENTS mono) - else() - set(wxWidgets_FIND_COMPONENTS core base) # this is default - endif() - endif() - - # Add the common (usually required libs) unless - # wxWidgets_EXCLUDE_COMMON_LIBRARIES has been set. - if(NOT wxWidgets_EXCLUDE_COMMON_LIBRARIES) - list(APPEND wxWidgets_FIND_COMPONENTS - ${wxWidgets_COMMON_LIBRARIES}) - endif() - - #------------------------------------------------------------------- - # WIN32: Helper MACROS - #------------------------------------------------------------------- - # - # Get filename components for a configuration. For example, - # if _CONFIGURATION = mswunivud, then _UNV=univ, _UCD=u _DBG=d - # if _CONFIGURATION = mswu, then _UNV="", _UCD=u _DBG="" - # - macro(WX_GET_NAME_COMPONENTS _CONFIGURATION _UNV _UCD _DBG) - string(REGEX MATCH "univ" ${_UNV} "${_CONFIGURATION}") - string(REGEX REPLACE "msw.*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}") - if(${_UCD} STREQUAL ${_CONFIGURATION}) - set(${_UCD} "") - endif() - string(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}") - endmacro() - - # - # Find libraries associated to a configuration. - # - macro(WX_FIND_LIBS _UNV _UCD _DBG) - DBG_MSG_V("m_unv = ${_UNV}") - DBG_MSG_V("m_ucd = ${_UCD}") - DBG_MSG_V("m_dbg = ${_DBG}") - - # FIXME: What if both regex libs are available. regex should be - # found outside the loop and only wx${LIB}${_UCD}${_DBG}. - # Find wxWidgets common libraries. - foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla) - find_library(WX_${LIB}${_DBG} - NAMES - wx${LIB}${_UCD}${_DBG} # for regex - wx${LIB}${_DBG} - PATHS ${WX_LIB_DIR} - NO_DEFAULT_PATH - ) - mark_as_advanced(WX_${LIB}${_DBG}) - endforeach() - - # Find wxWidgets multilib base libraries. - find_library(WX_base${_DBG} - NAMES - wxbase30${_UCD}${_DBG} - wxbase29${_UCD}${_DBG} - wxbase28${_UCD}${_DBG} - wxbase27${_UCD}${_DBG} - wxbase26${_UCD}${_DBG} - wxbase25${_UCD}${_DBG} - PATHS ${WX_LIB_DIR} - NO_DEFAULT_PATH - ) - mark_as_advanced(WX_base${_DBG}) - foreach(LIB net odbc xml) - find_library(WX_${LIB}${_DBG} - NAMES - wxbase30${_UCD}${_DBG}_${LIB} - wxbase29${_UCD}${_DBG}_${LIB} - wxbase28${_UCD}${_DBG}_${LIB} - wxbase27${_UCD}${_DBG}_${LIB} - wxbase26${_UCD}${_DBG}_${LIB} - wxbase25${_UCD}${_DBG}_${LIB} - PATHS ${WX_LIB_DIR} - NO_DEFAULT_PATH - ) - mark_as_advanced(WX_${LIB}${_DBG}) - endforeach() - - # Find wxWidgets monolithic library. - find_library(WX_mono${_DBG} - NAMES - wxmsw${_UNV}30${_UCD}${_DBG} - wxmsw${_UNV}29${_UCD}${_DBG} - wxmsw${_UNV}28${_UCD}${_DBG} - wxmsw${_UNV}27${_UCD}${_DBG} - wxmsw${_UNV}26${_UCD}${_DBG} - wxmsw${_UNV}25${_UCD}${_DBG} - PATHS ${WX_LIB_DIR} - NO_DEFAULT_PATH - ) - mark_as_advanced(WX_mono${_DBG}) - - # Find wxWidgets multilib libraries. - foreach(LIB core adv aui html media xrc dbgrid gl qa richtext - stc ribbon propgrid webview) - find_library(WX_${LIB}${_DBG} - NAMES - wxmsw${_UNV}30${_UCD}${_DBG}_${LIB} - wxmsw${_UNV}29${_UCD}${_DBG}_${LIB} - wxmsw${_UNV}28${_UCD}${_DBG}_${LIB} - wxmsw${_UNV}27${_UCD}${_DBG}_${LIB} - wxmsw${_UNV}26${_UCD}${_DBG}_${LIB} - wxmsw${_UNV}25${_UCD}${_DBG}_${LIB} - PATHS ${WX_LIB_DIR} - NO_DEFAULT_PATH - ) - mark_as_advanced(WX_${LIB}${_DBG}) - endforeach() - endmacro() - - # - # Clear all library paths, so that FIND_LIBRARY refinds them. - # - # Clear a lib, reset its found flag, and mark as advanced. - macro(WX_CLEAR_LIB _LIB) - set(${_LIB} "${_LIB}-NOTFOUND" CACHE FILEPATH "Cleared." FORCE) - set(${_LIB}_FOUND FALSE) - mark_as_advanced(${_LIB}) - endmacro() - # Clear all debug or release library paths (arguments are "d" or ""). - macro(WX_CLEAR_ALL_LIBS _DBG) - # Clear wxWidgets common libraries. - foreach(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla) - WX_CLEAR_LIB(WX_${LIB}${_DBG}) - endforeach() - - # Clear wxWidgets multilib base libraries. - WX_CLEAR_LIB(WX_base${_DBG}) - foreach(LIB net odbc xml) - WX_CLEAR_LIB(WX_${LIB}${_DBG}) - endforeach() - - # Clear wxWidgets monolithic library. - WX_CLEAR_LIB(WX_mono${_DBG}) - - # Clear wxWidgets multilib libraries. - foreach(LIB core adv aui html media xrc dbgrid gl qa richtext - stc ribbon propgrid) - WX_CLEAR_LIB(WX_${LIB}${_DBG}) - endforeach() - endmacro() - # Clear all wxWidgets debug libraries. - macro(WX_CLEAR_ALL_DBG_LIBS) - WX_CLEAR_ALL_LIBS("d") - endmacro() - # Clear all wxWidgets release libraries. - macro(WX_CLEAR_ALL_REL_LIBS) - WX_CLEAR_ALL_LIBS("") - endmacro() - - # - # Set the wxWidgets_LIBRARIES variable. - # Also, Sets output variable wxWidgets_FOUND to FALSE if it fails. - # - macro(WX_SET_LIBRARIES _LIBS _DBG) - DBG_MSG_V("Looking for ${${_LIBS}}") - if(WX_USE_REL_AND_DBG) - foreach(LIB ${${_LIBS}}) - DBG_MSG_V("Searching for ${LIB} and ${LIB}d") - DBG_MSG_V("WX_${LIB} : ${WX_${LIB}}") - DBG_MSG_V("WX_${LIB}d : ${WX_${LIB}d}") - if(WX_${LIB} AND WX_${LIB}d) - DBG_MSG_V("Found ${LIB} and ${LIB}d") - list(APPEND wxWidgets_LIBRARIES - debug ${WX_${LIB}d} optimized ${WX_${LIB}} - ) - else() - DBG_MSG_V("- not found due to missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}") - set(wxWidgets_FOUND FALSE) - endif() - endforeach() - else() - foreach(LIB ${${_LIBS}}) - DBG_MSG_V("Searching for ${LIB}${_DBG}") - DBG_MSG_V("WX_${LIB}${_DBG} : ${WX_${LIB}${_DBG}}") - if(WX_${LIB}${_DBG}) - DBG_MSG_V("Found ${LIB}${_DBG}") - list(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}}) - else() - DBG_MSG_V( - "- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}") - set(wxWidgets_FOUND FALSE) - endif() - endforeach() - endif() - - DBG_MSG_V("OpenGL") - list(FIND ${_LIBS} gl WX_USE_GL) - if(NOT WX_USE_GL EQUAL -1) - DBG_MSG_V("- is required.") - list(APPEND wxWidgets_LIBRARIES opengl32 glu32) - endif() - - list(APPEND wxWidgets_LIBRARIES winmm comctl32 rpcrt4 wsock32) - endmacro() - - #------------------------------------------------------------------- - # WIN32: Start actual work. - #------------------------------------------------------------------- - - # Look for an installation tree. - find_path(wxWidgets_ROOT_DIR - NAMES include/wx/wx.h - PATHS - ENV wxWidgets_ROOT_DIR - ENV WXWIN - "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]" # WX 2.6.x - C:/ - D:/ - ENV ProgramFiles - PATH_SUFFIXES - wxWidgets-3.0.0 - wxWidgets-2.9.5 - wxWidgets-2.9.4 - wxWidgets-2.9.3 - wxWidgets-2.9.2 - wxWidgets-2.9.1 - wxWidgets-2.9.0 - wxWidgets-2.8.9 - wxWidgets-2.8.8 - wxWidgets-2.8.7 - wxWidgets-2.8.6 - wxWidgets-2.8.5 - wxWidgets-2.8.4 - wxWidgets-2.8.3 - wxWidgets-2.8.2 - wxWidgets-2.8.1 - wxWidgets-2.8.0 - wxWidgets-2.7.4 - wxWidgets-2.7.3 - wxWidgets-2.7.2 - wxWidgets-2.7.1 - wxWidgets-2.7.0 - wxWidgets-2.7.0-1 - wxWidgets-2.6.4 - wxWidgets-2.6.3 - wxWidgets-2.6.2 - wxWidgets-2.6.1 - wxWidgets-2.5.4 - wxWidgets-2.5.3 - wxWidgets-2.5.2 - wxWidgets-2.5.1 - wxWidgets - DOC "wxWidgets base/installation directory" - ) - - # If wxWidgets_ROOT_DIR changed, clear lib dir. - if(NOT WX_ROOT_DIR STREQUAL wxWidgets_ROOT_DIR) - set(WX_ROOT_DIR ${wxWidgets_ROOT_DIR} - CACHE INTERNAL "wxWidgets_ROOT_DIR") - set(wxWidgets_LIB_DIR "wxWidgets_LIB_DIR-NOTFOUND" - CACHE PATH "Cleared." FORCE) - endif() - #include(CMakeDetermineCCompiler) - #message(STATUS "CMAKE_CROSSCOMPILING = ${CMAKE_CROSSCOMPILING}") - #message(STATUS "CMAKE_C_COMPILER = ${CMAKE_C_COMPILER}") - #message(STATUS "MSVC_C_ARCHITECTURE_ID = ${MSVC_C_ARCHITECTURE_ID}") - #message(STATUS "MSVC_CXX_ARCHITECTURE_ID = ${MSVC_CXX_ARCHITECTURE_ID}") - #message(STATUS "CMAKE_CL_64 = ${CMAKE_CL_64}") - #message(STATUS "LIB = $ENV{LIB}") - #message(STATUS "GENERATOR = ${CMAKE_GENERATOR}") - if(WX_ROOT_DIR) - # Select one default tree inside the already determined wx tree. - # Prefer static/shared order usually consistent with build - # settings. - if(MINGW) - set(WX_LIB_DIR_PREFIX gcc) - #The following should check for compiling 64 bit with nmake or VS - #Check for use of 64 bit NMake Makefile generator or a Visual Studio XX Win64 generator - elseif(CMAKE_CL_64) - set(WX_LIB_DIR_PREFIX vc_x64) - #unfortunately the above doesn't work on my system - can't find why, but workaround below - #Check for vs64 bit - elseif(${CMAKE_GENERATOR} MATCHES "Win64$") - set(WX_LIB_DIR_PREFIX vc_x64) - #Check for nmake 64 bit - elseif(${CMAKE_GENERATOR} STREQUAL "NMake Makefiles") - set(WX_LIB_DIR_PREFIX vc) - foreach(ENVLIBDIR $ENV{LIB}) - if( ENVLIBDIR MATCHES "amd64$") - set(WX_LIB_DIR_PREFIX vc_x64) - endif() - endforeach() - else() - set(WX_LIB_DIR_PREFIX vc) - endif() - if(BUILD_SHARED_LIBS) - find_path(wxWidgets_LIB_DIR - NAMES - msw/wx/setup.h - mswd/wx/setup.h - mswu/wx/setup.h - mswud/wx/setup.h - mswuniv/wx/setup.h - mswunivd/wx/setup.h - mswunivu/wx/setup.h - mswunivud/wx/setup.h - PATHS - ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll # prefer shared - ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib - DOC "Path to wxWidgets libraries" - NO_DEFAULT_PATH - ) - else() - find_path(wxWidgets_LIB_DIR - NAMES - msw/wx/setup.h - mswd/wx/setup.h - mswu/wx/setup.h - mswud/wx/setup.h - mswuniv/wx/setup.h - mswunivd/wx/setup.h - mswunivu/wx/setup.h - mswunivud/wx/setup.h - PATHS - ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_lib # prefer static - ${WX_ROOT_DIR}/lib/${WX_LIB_DIR_PREFIX}_dll - DOC "Path to wxWidgets libraries" - NO_DEFAULT_PATH - ) - endif() - - # If wxWidgets_LIB_DIR changed, clear all libraries. - if(NOT WX_LIB_DIR STREQUAL wxWidgets_LIB_DIR) - set(WX_LIB_DIR ${wxWidgets_LIB_DIR} CACHE INTERNAL "wxWidgets_LIB_DIR") - WX_CLEAR_ALL_DBG_LIBS() - WX_CLEAR_ALL_REL_LIBS() - endif() - - if(WX_LIB_DIR) - # If building shared libs, define WXUSINGDLL to use dllimport. - if(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*") - set(wxWidgets_DEFINITIONS WXUSINGDLL) - DBG_MSG_V("detected SHARED/DLL tree WX_LIB_DIR=${WX_LIB_DIR}") - endif() - - # Search for available configuration types. - foreach(CFG mswunivud mswunivd mswud mswd mswunivu mswuniv mswu msw) - set(WX_${CFG}_FOUND FALSE) - if(EXISTS ${WX_LIB_DIR}/${CFG}) - list(APPEND WX_CONFIGURATION_LIST ${CFG}) - set(WX_${CFG}_FOUND TRUE) - set(WX_CONFIGURATION ${CFG}) - endif() - endforeach() - DBG_MSG_V("WX_CONFIGURATION_LIST=${WX_CONFIGURATION_LIST}") - - if(WX_CONFIGURATION) - set(wxWidgets_FOUND TRUE) - - # If the selected configuration wasn't found force the default - # one. Otherwise, use it but still force a refresh for - # updating the doc string with the current list of available - # configurations. - if(NOT WX_${wxWidgets_CONFIGURATION}_FOUND) - set(wxWidgets_CONFIGURATION ${WX_CONFIGURATION} CACHE STRING - "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE) - else() - set(wxWidgets_CONFIGURATION ${wxWidgets_CONFIGURATION} CACHE STRING - "Set wxWidgets configuration (${WX_CONFIGURATION_LIST})" FORCE) - endif() - - # If release config selected, and both release/debug exist. - if(WX_${wxWidgets_CONFIGURATION}d_FOUND) - option(wxWidgets_USE_REL_AND_DBG - "Use release and debug configurations?" TRUE) - set(WX_USE_REL_AND_DBG ${wxWidgets_USE_REL_AND_DBG}) - else() - # If the option exists (already in cache), force it false. - if(wxWidgets_USE_REL_AND_DBG) - set(wxWidgets_USE_REL_AND_DBG FALSE CACHE BOOL - "No ${wxWidgets_CONFIGURATION}d found." FORCE) - endif() - set(WX_USE_REL_AND_DBG FALSE) - endif() - - # Get configuration parameters from the name. - WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG) - - # Set wxWidgets lib setup include directory. - if(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) - set(wxWidgets_INCLUDE_DIRS - ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}) - else() - DBG_MSG("wxWidgets_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.") - set(wxWidgets_FOUND FALSE) - endif() - - # Set wxWidgets main include directory. - if(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) - list(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include) - else() - DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h") - set(wxWidgets_FOUND FALSE) - endif() - - # Find wxWidgets libraries. - WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}") - if(WX_USE_REL_AND_DBG) - WX_FIND_LIBS("${UNV}" "${UCD}" "d") - endif() - - # Settings for requested libs (i.e., include dir, libraries, etc.). - WX_SET_LIBRARIES(wxWidgets_FIND_COMPONENTS "${DBG}") - - # Add necessary definitions for unicode builds - if("${UCD}" STREQUAL "u") - list(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE) - endif() - - # Add necessary definitions for debug builds - set(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__) - - endif() - endif() - endif() - -#===================================================================== -# UNIX_FIND_STYLE -#===================================================================== -else() - if(wxWidgets_FIND_STYLE STREQUAL "unix") - #----------------------------------------------------------------- - # UNIX: Helper MACROS - #----------------------------------------------------------------- - # - # Set the default values based on "wx-config --selected-config". - # - macro(WX_CONFIG_SELECT_GET_DEFAULT) - execute_process( - COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" - ${wxWidgets_CONFIG_OPTIONS} --selected-config - OUTPUT_VARIABLE _wx_selected_config - RESULT_VARIABLE _wx_result - ERROR_QUIET - ) - if(_wx_result EQUAL 0) - foreach(_opt_name debug static unicode universal) - string(TOUPPER ${_opt_name} _upper_opt_name) - if(_wx_selected_config MATCHES ".*${_opt_name}.*") - set(wxWidgets_DEFAULT_${_upper_opt_name} ON) - else() - set(wxWidgets_DEFAULT_${_upper_opt_name} OFF) - endif() - endforeach() - else() - foreach(_upper_opt_name DEBUG STATIC UNICODE UNIVERSAL) - set(wxWidgets_DEFAULT_${_upper_opt_name} OFF) - endforeach() - endif() - endmacro() - - # - # Query a boolean configuration option to determine if the system - # has both builds available. If so, provide the selection option - # to the user. - # - macro(WX_CONFIG_SELECT_QUERY_BOOL _OPT_NAME _OPT_HELP) - execute_process( - COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" - ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=yes - RESULT_VARIABLE _wx_result_yes - OUTPUT_QUIET - ERROR_QUIET - ) - execute_process( - COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" - ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=no - RESULT_VARIABLE _wx_result_no - OUTPUT_QUIET - ERROR_QUIET - ) - string(TOUPPER ${_OPT_NAME} _UPPER_OPT_NAME) - if(_wx_result_yes EQUAL 0 AND _wx_result_no EQUAL 0) - option(wxWidgets_USE_${_UPPER_OPT_NAME} - ${_OPT_HELP} ${wxWidgets_DEFAULT_${_UPPER_OPT_NAME}}) - else() - # If option exists (already in cache), force to available one. - if(DEFINED wxWidgets_USE_${_UPPER_OPT_NAME}) - if(_wx_result_yes EQUAL 0) - set(wxWidgets_USE_${_UPPER_OPT_NAME} ON CACHE BOOL ${_OPT_HELP} FORCE) - else() - set(wxWidgets_USE_${_UPPER_OPT_NAME} OFF CACHE BOOL ${_OPT_HELP} FORCE) - endif() - endif() - endif() - endmacro() - - # - # Set wxWidgets_SELECT_OPTIONS to wx-config options for selecting - # among multiple builds. - # - macro(WX_CONFIG_SELECT_SET_OPTIONS) - set(wxWidgets_SELECT_OPTIONS ${wxWidgets_CONFIG_OPTIONS}) - foreach(_opt_name debug static unicode universal) - string(TOUPPER ${_opt_name} _upper_opt_name) - if(DEFINED wxWidgets_USE_${_upper_opt_name}) - if(wxWidgets_USE_${_upper_opt_name}) - list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=yes) - else() - list(APPEND wxWidgets_SELECT_OPTIONS --${_opt_name}=no) - endif() - endif() - endforeach() - endmacro() - - #----------------------------------------------------------------- - # UNIX: Start actual work. - #----------------------------------------------------------------- - # Support cross-compiling, only search in the target platform. - find_program(wxWidgets_CONFIG_EXECUTABLE wx-config - DOC "Location of wxWidgets library configuration provider binary (wx-config)." - ONLY_CMAKE_FIND_ROOT_PATH - ) - - if(wxWidgets_CONFIG_EXECUTABLE) - set(wxWidgets_FOUND TRUE) - - # get defaults based on "wx-config --selected-config" - WX_CONFIG_SELECT_GET_DEFAULT() - - # for each option: if both builds are available, provide option - WX_CONFIG_SELECT_QUERY_BOOL(debug "Use debug build?") - WX_CONFIG_SELECT_QUERY_BOOL(unicode "Use unicode build?") - WX_CONFIG_SELECT_QUERY_BOOL(universal "Use universal build?") - WX_CONFIG_SELECT_QUERY_BOOL(static "Link libraries statically?") - - # process selection to set wxWidgets_SELECT_OPTIONS - WX_CONFIG_SELECT_SET_OPTIONS() - DBG_MSG("wxWidgets_SELECT_OPTIONS=${wxWidgets_SELECT_OPTIONS}") - - # run the wx-config program to get cxxflags - execute_process( - COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" - ${wxWidgets_SELECT_OPTIONS} --cxxflags - OUTPUT_VARIABLE wxWidgets_CXX_FLAGS - RESULT_VARIABLE RET - ERROR_QUIET - ) - if(RET EQUAL 0) - string(STRIP "${wxWidgets_CXX_FLAGS}" wxWidgets_CXX_FLAGS) - separate_arguments(wxWidgets_CXX_FLAGS) - - DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}") - - # parse definitions from cxxflags; - # drop -D* from CXXFLAGS and the -D prefix - string(REGEX MATCHALL "-D[^;]+" - wxWidgets_DEFINITIONS "${wxWidgets_CXX_FLAGS}") - string(REGEX REPLACE "-D[^;]+(;|$)" "" - wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}") - string(REGEX REPLACE ";$" "" - wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}") - string(REPLACE "-D" "" - wxWidgets_DEFINITIONS "${wxWidgets_DEFINITIONS}") - - # parse include dirs from cxxflags; drop -I prefix - string(REGEX MATCHALL "-I[^;]+" - wxWidgets_INCLUDE_DIRS "${wxWidgets_CXX_FLAGS}") - string(REGEX REPLACE "-I[^;]+;" "" - wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}") - string(REPLACE "-I" "" - wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}") - - DBG_MSG_V("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}") - DBG_MSG_V("wxWidgets_INCLUDE_DIRS=${wxWidgets_INCLUDE_DIRS}") - DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}") - - else() - set(wxWidgets_FOUND FALSE) - DBG_MSG_V( - "${wxWidgets_CONFIG_EXECUTABLE} --cxxflags FAILED with RET=${RET}") - endif() - - # run the wx-config program to get the libs - # - NOTE: wx-config doesn't verify that the libs requested exist - # it just produces the names. Maybe a TRY_COMPILE would - # be useful here... - string(REPLACE ";" "," - wxWidgets_FIND_COMPONENTS "${wxWidgets_FIND_COMPONENTS}") - execute_process( - COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" - ${wxWidgets_SELECT_OPTIONS} --libs ${wxWidgets_FIND_COMPONENTS} - OUTPUT_VARIABLE wxWidgets_LIBRARIES - RESULT_VARIABLE RET - ERROR_QUIET - ) - if(RET EQUAL 0) - string(STRIP "${wxWidgets_LIBRARIES}" wxWidgets_LIBRARIES) - separate_arguments(wxWidgets_LIBRARIES) - string(REPLACE "-framework;" "-framework " - wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}") - string(REPLACE "-arch;" "-arch " - wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}") - string(REPLACE "-isysroot;" "-isysroot " - wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}") - - # extract linkdirs (-L) for rpath (i.e., LINK_DIRECTORIES) - string(REGEX MATCHALL "-L[^;]+" - wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARIES}") - string(REPLACE "-L" "" - wxWidgets_LIBRARY_DIRS "${wxWidgets_LIBRARY_DIRS}") - - DBG_MSG_V("wxWidgets_LIBRARIES=${wxWidgets_LIBRARIES}") - DBG_MSG_V("wxWidgets_LIBRARY_DIRS=${wxWidgets_LIBRARY_DIRS}") - - else() - set(wxWidgets_FOUND FALSE) - DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${wxWidgets_FIND_COMPONENTS} FAILED with RET=${RET}") - endif() - endif() - -#===================================================================== -# Neither UNIX_FIND_STYLE, nor WIN32_FIND_STYLE -#===================================================================== - else() - if(NOT wxWidgets_FIND_QUIETLY) - message(STATUS - "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): \n" - " Platform unknown/unsupported. It's neither WIN32 nor UNIX " - "find style." - ) - endif() - endif() -endif() - -# Debug output: -DBG_MSG("wxWidgets_FOUND : ${wxWidgets_FOUND}") -DBG_MSG("wxWidgets_INCLUDE_DIRS : ${wxWidgets_INCLUDE_DIRS}") -DBG_MSG("wxWidgets_LIBRARY_DIRS : ${wxWidgets_LIBRARY_DIRS}") -DBG_MSG("wxWidgets_LIBRARIES : ${wxWidgets_LIBRARIES}") -DBG_MSG("wxWidgets_CXX_FLAGS : ${wxWidgets_CXX_FLAGS}") -DBG_MSG("wxWidgets_USE_FILE : ${wxWidgets_USE_FILE}") - -#===================================================================== -#===================================================================== -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(wxWidgets DEFAULT_MSG wxWidgets_FOUND) -# Maintain consistency with all other variables. -set(wxWidgets_FOUND ${WXWIDGETS_FOUND}) - -#===================================================================== -# Macros for use in wxWidgets apps. -# - This module will not fail to find wxWidgets based on the code -# below. Hence, it's required to check for validity of: -# -# wxWidgets_wxrc_EXECUTABLE -#===================================================================== - -# Resource file compiler. -find_program(wxWidgets_wxrc_EXECUTABLE wxrc - ${wxWidgets_ROOT_DIR}/utils/wxrc/vc_msw - DOC "Location of wxWidgets resource file compiler binary (wxrc)" - ) - -# -# WX_SPLIT_ARGUMENTS_ON(<keyword> <left> <right> <arg1> <arg2> ...) -# -# Sets <left> and <right> to contain arguments to the left and right, -# respectively, of <keyword>. -# -# Example usage: -# function(WXWIDGETS_ADD_RESOURCES outfiles) -# WX_SPLIT_ARGUMENTS_ON(OPTIONS wxrc_files wxrc_options ${ARGN}) -# ... -# endfunction() -# -# WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o file.C) -# -# NOTE: This is a generic piece of code that should be renamed to -# SPLIT_ARGUMENTS_ON and put in a file serving the same purpose as -# FindPackageStandardArgs.cmake. At the time of this writing -# FindQt4.cmake has a QT4_EXTRACT_OPTIONS, which I basically copied -# here a bit more generalized. So, there are already two find modules -# using this approach. -# -function(WX_SPLIT_ARGUMENTS_ON _keyword _leftvar _rightvar) - # FIXME: Document that the input variables will be cleared. - #list(APPEND ${_leftvar} "") - #list(APPEND ${_rightvar} "") - set(${_leftvar} "") - set(${_rightvar} "") - - set(_doing_right FALSE) - foreach(element ${ARGN}) - if("${element}" STREQUAL "${_keyword}") - set(_doing_right TRUE) - else() - if(_doing_right) - list(APPEND ${_rightvar} "${element}") - else() - list(APPEND ${_leftvar} "${element}") - endif() - endif() - endforeach() - - set(${_leftvar} ${${_leftvar}} PARENT_SCOPE) - set(${_rightvar} ${${_rightvar}} PARENT_SCOPE) -endfunction() - -# -# WX_GET_DEPENDENCIES_FROM_XML( -# <depends> -# <match_pattern> -# <clean_pattern> -# <xml_contents> -# <depends_path> -# ) -# -# FIXME: Add documentation here... -# -function(WX_GET_DEPENDENCIES_FROM_XML - _depends - _match_patt - _clean_patt - _xml_contents - _depends_path - ) - - string(REGEX MATCHALL - ${_match_patt} - dep_file_list - "${${_xml_contents}}" - ) - foreach(dep_file ${dep_file_list}) - string(REGEX REPLACE ${_clean_patt} "" dep_file "${dep_file}") - - # make the file have an absolute path - if(NOT IS_ABSOLUTE "${dep_file}") - set(dep_file "${${_depends_path}}/${dep_file}") - endif() - - # append file to dependency list - list(APPEND ${_depends} "${dep_file}") - endforeach() - - set(${_depends} ${${_depends}} PARENT_SCOPE) -endfunction() - -# -# WXWIDGETS_ADD_RESOURCES(<sources> <xrc_files> -# OPTIONS <options> [NO_CPP_CODE]) -# -# Adds a custom command for resource file compilation of the -# <xrc_files> and appends the output files to <sources>. -# -# Example usages: -# WXWIDGETS_ADD_RESOURCES(sources xrc/main_frame.xrc) -# WXWIDGETS_ADD_RESOURCES(sources ${xrc_files} OPTIONS -e -o altname.cxx) -# -function(WXWIDGETS_ADD_RESOURCES _outfiles) - WX_SPLIT_ARGUMENTS_ON(OPTIONS rc_file_list rc_options ${ARGN}) - - # Parse files for dependencies. - set(rc_file_list_abs "") - set(rc_depends "") - foreach(rc_file ${rc_file_list}) - get_filename_component(depends_path ${rc_file} PATH) - - get_filename_component(rc_file_abs ${rc_file} ABSOLUTE) - list(APPEND rc_file_list_abs "${rc_file_abs}") - - # All files have absolute paths or paths relative to the location - # of the rc file. - file(READ "${rc_file_abs}" rc_file_contents) - - # get bitmap/bitmap2 files - WX_GET_DEPENDENCIES_FROM_XML( - rc_depends - "<bitmap[^<]+" - "^<bitmap[^>]*>" - rc_file_contents - depends_path - ) - - # get url files - WX_GET_DEPENDENCIES_FROM_XML( - rc_depends - "<url[^<]+" - "^<url[^>]*>" - rc_file_contents - depends_path - ) - - # get wxIcon files - WX_GET_DEPENDENCIES_FROM_XML( - rc_depends - "<object[^>]*class=\"wxIcon\"[^<]+" - "^<object[^>]*>" - rc_file_contents - depends_path - ) - endforeach() - - # - # Parse options. - # - # If NO_CPP_CODE option specified, then produce .xrs file rather - # than a .cpp file (i.e., don't add the default --cpp-code option). - list(FIND rc_options NO_CPP_CODE index) - if(index EQUAL -1) - list(APPEND rc_options --cpp-code) - # wxrc's default output filename for cpp code. - set(outfile resource.cpp) - else() - list(REMOVE_AT rc_options ${index}) - # wxrc's default output filename for xrs file. - set(outfile resource.xrs) - endif() - - # Get output name for use in ADD_CUSTOM_COMMAND. - # - short option scanning - list(FIND rc_options -o index) - if(NOT index EQUAL -1) - math(EXPR filename_index "${index} + 1") - list(GET rc_options ${filename_index} outfile) - #list(REMOVE_AT rc_options ${index} ${filename_index}) - endif() - # - long option scanning - string(REGEX MATCH "--output=[^;]*" outfile_opt "${rc_options}") - if(outfile_opt) - string(REPLACE "--output=" "" outfile "${outfile_opt}") - endif() - #string(REGEX REPLACE "--output=[^;]*;?" "" rc_options "${rc_options}") - #string(REGEX REPLACE ";$" "" rc_options "${rc_options}") - - if(NOT IS_ABSOLUTE "${outfile}") - set(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}") - endif() - add_custom_command( - OUTPUT "${outfile}" - COMMAND ${wxWidgets_wxrc_EXECUTABLE} ${rc_options} ${rc_file_list_abs} - DEPENDS ${rc_file_list_abs} ${rc_depends} - ) - - # Add generated header to output file list. - list(FIND rc_options -e short_index) - list(FIND rc_options --extra-cpp-code long_index) - if(NOT short_index EQUAL -1 OR NOT long_index EQUAL -1) - get_filename_component(outfile_ext ${outfile} EXT) - string(REPLACE "${outfile_ext}" ".h" outfile_header "${outfile}") - list(APPEND ${_outfiles} "${outfile_header}") - set_source_files_properties( - "${outfile_header}" PROPERTIES GENERATED TRUE - ) - endif() - - # Add generated file to output file list. - list(APPEND ${_outfiles} "${outfile}") - - set(${_outfiles} ${${_outfiles}} PARENT_SCOPE) -endfunction() +#.rst: +# FindwxWidgets +# ------------- +# +# Find a wxWidgets (a.k.a., wxWindows) installation. +# +# This module finds if wxWidgets is installed and selects a default +# configuration to use. wxWidgets is a modular library. To specify the +# modules that you will use, you need to name them as components to the +# package: +# +# find_package(wxWidgets COMPONENTS core base ...) +# +# There are two search branches: a windows style and a unix style. For +# windows, the following variables are searched for and set to defaults +# in case of multiple choices. Change them if the defaults are not +# desired (i.e., these are the only variables you should change to +# select a configuration): +# +# :: +# +# wxWidgets_ROOT_DIR - Base wxWidgets directory +# (e.g., C:/wxWidgets-2.6.3). +# wxWidgets_LIB_DIR - Path to wxWidgets libraries +# (e.g., C:/wxWidgets-2.6.3/lib/vc_lib). +# wxWidgets_CONFIGURATION - Configuration to use +# (e.g., msw, mswd, mswu, mswunivud, etc.) +# wxWidgets_EXCLUDE_COMMON_LIBRARIES +# - Set to TRUE to exclude linking of +# commonly required libs (e.g., png tiff +# jpeg zlib regex expat). +# +# +# +# For unix style it uses the wx-config utility. You can select between +# debug/release, unicode/ansi, universal/non-universal, and +# static/shared in the QtDialog or ccmake interfaces by turning ON/OFF +# the following variables: +# +# :: +# +# wxWidgets_USE_DEBUG +# wxWidgets_USE_UNICODE +# wxWidgets_USE_UNIVERSAL +# wxWidgets_USE_STATIC +# +# +# +# There is also a wxWidgets_CONFIG_OPTIONS variable for all other +# options that need to be passed to the wx-config utility. For example, +# to use the base toolkit found in the /usr/local path, set the variable +# (before calling the FIND_PACKAGE command) as such: +# +# :: +# +# set(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr) +# +# +# +# The following are set after the configuration is done for both windows +# and unix style: +# +# :: +# +# wxWidgets_FOUND - Set to TRUE if wxWidgets was found. +# wxWidgets_INCLUDE_DIRS - Include directories for WIN32 +# i.e., where to find "wx/wx.h" and +# "wx/setup.h"; possibly empty for unices. +# wxWidgets_LIBRARIES - Path to the wxWidgets libraries. +# wxWidgets_LIBRARY_DIRS - compile time link dirs, useful for +# rpath on UNIX. Typically an empty string +# in WIN32 environment. +# wxWidgets_DEFINITIONS - Contains defines required to compile/link +# against WX, e.g. WXUSINGDLL +# wxWidgets_DEFINITIONS_DEBUG- Contains defines required to compile/link +# against WX debug builds, e.g. __WXDEBUG__ +# wxWidgets_CXX_FLAGS - Include dirs and compiler flags for +# unices, empty on WIN32. Essentially +# "`wx-config --cxxflags`". +# wxWidgets_USE_FILE - Convenience include file. +# +# +# +# Sample usage: +# +# :: +# +# # Note that for MinGW users the order of libs is important! +# find_package(wxWidgets COMPONENTS net gl core base) +# if(wxWidgets_FOUND) +# include(${wxWidgets_USE_FILE}) +# # and for each of your dependent executable/library targets: +# target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES}) +# endif() +# +# +# +# If wxWidgets is required (i.e., not an optional part): +# +# :: +# +# find_package(wxWidgets REQUIRED net gl core base) +# include(${wxWidgets_USE_FILE}) +# # and for each of your dependent executable/library targets: +# target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES}) + +#============================================================================= +# Copyright 2004-2009 Kitware, Inc. +# Copyright 2007-2009 Miguel A. Figueroa-Villanueva <miguelf at ieee dot org> +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# +# FIXME: check this and provide a correct sample usage... +# Remember to connect back to the upper text. +# Sample usage with monolithic wx build: +# +# find_package(wxWidgets COMPONENTS mono) +# ... + +# NOTES +# +# This module has been tested on the WIN32 platform with wxWidgets +# 2.6.2, 2.6.3, and 2.5.3. However, it has been designed to +# easily extend support to all possible builds, e.g., static/shared, +# debug/release, unicode, universal, multilib/monolithic, etc.. +# +# If you want to use the module and your build type is not supported +# out-of-the-box, please contact me to exchange information on how +# your system is setup and I'll try to add support for it. +# +# AUTHOR +# +# Miguel A. Figueroa-Villanueva (miguelf at ieee dot org). +# Jan Woetzel (jw at mip.informatik.uni-kiel.de). +# +# Based on previous works of: +# Jan Woetzel (FindwxWindows.cmake), +# Jorgen Bodde and Jerry Fath (FindwxWin.cmake). + +# TODO/ideas +# +# (1) Option/Setting to use all available wx libs +# In contrast to expert developer who lists the +# minimal set of required libs in wxWidgets_USE_LIBS +# there is the newbie user: +# - who just wants to link against WX with more 'magic' +# - doesn't know the internal structure of WX or how it was built, +# in particular if it is monolithic or not +# - want to link against all available WX libs +# Basically, the intent here is to mimic what wx-config would do by +# default (i.e., `wx-config --libs`). +# +# Possible solution: +# Add a reserved keyword "std" that initializes to what wx-config +# would default to. If the user has not set the wxWidgets_USE_LIBS, +# default to "std" instead of "base core" as it is now. To implement +# "std" will basically boil down to a FOR_EACH lib-FOUND, but maybe +# checking whether a minimal set was found. + + +# FIXME: This and all the DBG_MSG calls should be removed after the +# module stabilizes. +# +# Helper macro to control the debugging output globally. There are +# two versions for controlling how verbose your output should be. +macro(DBG_MSG _MSG) +# message(STATUS +# "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") +endmacro() +macro(DBG_MSG_V _MSG) +# message(STATUS +# "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}") +endmacro() + +# Clear return values in case the module is loaded more than once. +set(wxWidgets_FOUND FALSE) +set(wxWidgets_INCLUDE_DIRS "") +set(wxWidgets_LIBRARIES "") +set(wxWidgets_LIBRARY_DIRS "") +set(wxWidgets_CXX_FLAGS "") + +# Using SYSTEM with INCLUDE_DIRECTORIES in conjunction with wxWidgets on +# the Mac produces compiler errors. Set wxWidgets_INCLUDE_DIRS_NO_SYSTEM +# to prevent UsewxWidgets.cmake from using SYSTEM. +# +# See cmake mailing list discussions for more info: +# http://www.cmake.org/pipermail/cmake/2008-April/021115.html +# http://www.cmake.org/pipermail/cmake/2008-April/021146.html +# +if(APPLE OR CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") + set(wxWidgets_INCLUDE_DIRS_NO_SYSTEM 1) +endif() + +# DEPRECATED: This is a patch to support the DEPRECATED use of +# wxWidgets_USE_LIBS. +# +# If wxWidgets_USE_LIBS is set: +# - if using <components>, then override wxWidgets_USE_LIBS +# - else set wxWidgets_FIND_COMPONENTS to wxWidgets_USE_LIBS +if(wxWidgets_USE_LIBS AND NOT wxWidgets_FIND_COMPONENTS) + set(wxWidgets_FIND_COMPONENTS ${wxWidgets_USE_LIBS}) +endif() +DBG_MSG("wxWidgets_FIND_COMPONENTS : ${wxWidgets_FIND_COMPONENTS}") + +# Add the convenience use file if available. +# +# Get dir of this file which may reside in: +# - CMAKE_MAKE_ROOT/Modules on CMake installation +# - CMAKE_MODULE_PATH if user prefers his own specialized version +set(wxWidgets_USE_FILE "") +get_filename_component( + wxWidgets_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) +# Prefer an existing customized version, but the user might override +# the FindwxWidgets module and not the UsewxWidgets one. +if(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") + set(wxWidgets_USE_FILE + "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") +else() + set(wxWidgets_USE_FILE UsewxWidgets) +endif() + +#===================================================================== +#===================================================================== +if(WIN32 AND NOT CYGWIN AND NOT MSYS) + set(wxWidgets_FIND_STYLE "win32") +else() + if(UNIX OR MSYS) + set(wxWidgets_FIND_STYLE "unix") + endif() +endif() + +#===================================================================== +# WIN32_FIND_STYLE +#===================================================================== +if(wxWidgets_FIND_STYLE STREQUAL "win32") + # Useful common wx libs needed by almost all components. + set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat) + + # DEPRECATED: Use find_package(wxWidgets COMPONENTS mono) instead. + if(NOT wxWidgets_FIND_COMPONENTS) + if(wxWidgets_USE_MONOLITHIC) + set(wxWidgets_FIND_COMPONENTS mono) + else() + set(wxWidgets_FIND_COMPONENTS core base) # this is default +... [truncated message content] |
From: <ai...@us...> - 2014-05-14 05:36:28
|
Revision: 13115 http://sourceforge.net/p/plplot/code/13115 Author: airwin Date: 2014-05-14 05:36:26 +0000 (Wed, 14 May 2014) Log Message: ----------- Work around GTK+ pgk-config configuration issue where -lm is included in library flags for the Windows case when that math library does not separately exist on that platform. Modified Paths: -------------- trunk/cmake/modules/pkg-config.cmake trunk/cmake/modules/plplot.cmake Modified: trunk/cmake/modules/pkg-config.cmake =================================================================== --- trunk/cmake/modules/pkg-config.cmake 2014-04-30 08:10:03 UTC (rev 13114) +++ trunk/cmake/modules/pkg-config.cmake 2014-05-14 05:36:26 UTC (rev 13115) @@ -222,6 +222,16 @@ # (such as "-framework whatever") so preserve those by splitting into # separate list elements only if the next element starts with a hyphen. string(REGEX REPLACE " -" ";-" _link_flags_list "${_link_flags_in}") + if(NOT MATH_LIB) + # On systems (normally Windows) where MATH_LIB is not defined + # filter out -lm from link flags. This works around a pkg-config + # configuration bug on Windows for the GTK+ stack of libraries where + # -lm is supplied as a required library flag when that library does + # not exist on Windows platforms. + list(REMOVE_ITEM _link_flags_list "-lm") + endif(NOT MATH_LIB) + #message("_link_flags_list = ${_link_flags_list}") + # Extract list of directories from -L options. list(LENGTH _link_flags_list _link_flags_length) math(EXPR _link_flags_length "${_link_flags_length} - 1") @@ -236,11 +246,10 @@ endif(_list_element STREQUAL "-L${_list_element1}") endforeach(_list_index RANGE ${_link_flags_length}) #message("_index_list = ${_index_list}") - if("${_index_list}" STREQUAL "") - else("${_index_list}" STREQUAL "") + if(NOT "${_index_list}" STREQUAL "") # Remove -L options from list. list(REMOVE_AT _link_flags_list ${_index_list}) - endif("${_index_list}" STREQUAL "") + endif(NOT "${_index_list}" STREQUAL "") #message("_link_directory_list = ${_link_directory_list}") #message("_link_flags_list (without -L options) = ${_link_flags_list}") Modified: trunk/cmake/modules/plplot.cmake =================================================================== --- trunk/cmake/modules/plplot.cmake 2014-04-30 08:10:03 UTC (rev 13114) +++ trunk/cmake/modules/plplot.cmake 2014-05-14 05:36:26 UTC (rev 13115) @@ -398,8 +398,21 @@ check_perl_modules(PERL_XML_PARSER XML::Parser) check_perl_modules(PERL_XML_DOM XML::DOM) endif(PERL_FOUND) - + # ======================================================================= +# MATH_LIB must be defined (or not) before pkg-config. +# ======================================================================= + +# On windows systems the math library is not separated so do not specify +# it unless you are on a non-windows system. +if(NOT WIN32_OR_CYGWIN) + find_library(MATH_LIB NAMES m PATHS /usr/local/lib /usr/lib) + if(NOT MATH_LIB) + message(FATAL_ERROR "Cannot find required math library") + endif(NOT MATH_LIB) +endif(NOT WIN32_OR_CYGWIN) + +# ======================================================================= # pkg-config support as well as macros to put link flags in standard # *.pc (pkg-config) form as well as standard fullpath form used by cmake. # ======================================================================= @@ -521,14 +534,6 @@ # Support for shapelib library for reading shapefile map data include(shapelib) include(freetype) -# On windows systems the math library is not separated so do not specify -# it unless you are on a non-windows system. -if(NOT WIN32_OR_CYGWIN) - find_library(MATH_LIB NAMES m PATHS /usr/local/lib /usr/lib) - if(NOT MATH_LIB) - message(FATAL_ERROR "Cannot find required math library") - endif(NOT MATH_LIB) -endif(NOT WIN32_OR_CYGWIN) # csiro must come after MATH_LIB is defined (or not). # csiro must come after c++ and fortran because of use of filter_rpath include(csiro) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ai...@us...> - 2014-05-15 01:57:13
|
Revision: 13120 http://sourceforge.net/p/plplot/code/13120 Author: airwin Date: 2014-05-15 01:57:06 +0000 (Thu, 15 May 2014) Log Message: ----------- Implement additional diagnostic output when pkg-config processing is failing in some way. Modified Paths: -------------- trunk/cmake/modules/cairo.cmake trunk/cmake/modules/pkg-config.cmake Modified: trunk/cmake/modules/cairo.cmake =================================================================== --- trunk/cmake/modules/cairo.cmake 2014-05-14 11:12:17 UTC (rev 13119) +++ trunk/cmake/modules/cairo.cmake 2014-05-15 01:57:06 UTC (rev 13120) @@ -145,7 +145,7 @@ list(APPEND DRIVERS_LINK_FLAGS ${cairo_LINK_FLAGS}) else(linkflags) message("includedir = ${includedir}") - message("libdir = ${libdir}") + message("linkdir = ${linkdir}") message("linkflags = ${linkflags}") message("cflags = ${cflags}") message(STATUS Modified: trunk/cmake/modules/pkg-config.cmake =================================================================== --- trunk/cmake/modules/pkg-config.cmake 2014-05-14 11:12:17 UTC (rev 13119) +++ trunk/cmake/modules/pkg-config.cmake 2014-05-15 01:57:06 UTC (rev 13120) @@ -292,8 +292,10 @@ # If one or more of the libraries cannot be found, then return an # empty ${_link_flags_out} as a sign of that failure. if(NOT _success) + message(STATUS "cmake_link_flags WARNING: (original link flags) = ${_link_flags_in}") + message(STATUS "cmake_link_flags WARNING: ${_link_flags_out} = ${${_link_flags_out}}") + message(STATUS "cmake_link_flags WARNING: ${_link_flags_out} is invalid so it is set to nothing to signal the failure of cmake_link_flags for the original link flags printed out above.") set(${_link_flags_out}) endif(NOT _success) endif("${_link_flags_in}" STREQUAL "") endmacro(cmake_link_flags) - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |