|
From: <ai...@us...> - 2009-06-29 20:23:13
|
Revision: 10095
http://plplot.svn.sourceforge.net/plplot/?rev=10095&view=rev
Author: airwin
Date: 2009-06-29 20:23:11 +0000 (Mon, 29 Jun 2009)
Log Message:
-----------
For new build system handle ENABLE_c case like others (i.e., with a ENABLE_c
cmake option that can be set by the user).
Make all enable_language commands OPTIONAL to deal smoothly with the case
when a compiler is broken.
Modified Paths:
--------------
trunk/examples/plplot_configure.cmake_installed_examples.in
Modified: trunk/examples/plplot_configure.cmake_installed_examples.in
===================================================================
--- trunk/examples/plplot_configure.cmake_installed_examples.in 2009-06-29 01:48:32 UTC (rev 10094)
+++ trunk/examples/plplot_configure.cmake_installed_examples.in 2009-06-29 20:23:11 UTC (rev 10095)
@@ -40,10 +40,9 @@
# potentially is a maintenance issue. However, cannot make this list
# automatically with a foreach loop because explicit configuration of
# each name is required.
-# N.B. c handled separately below so it is excluded from this list of
-# set commands. (Also, the core never sets ENABLE_c since C is always
-# on for the core.)
set(CORE_ENABLE_ada @ENABLE_ada@)
+# N.B. The core never sets ENABLE_c since C is always on for the core.
+set(CORE_ENABLE_c ON)
set(CORE_ENABLE_cxx @ENABLE_cxx@)
set(CORE_ENABLE_d @ENABLE_d@)
set(CORE_ENABLE_f77 @ENABLE_f77@)
@@ -79,51 +78,79 @@
foreach(language_info tk:? gnome2:? wxwidgets:? qt:? ${language_info_LIST})
string(REGEX REPLACE "^(.*):.*$" "\\1" language ${language_info})
#message("DEBUG: language = ${language}")
- if(language STREQUAL "c")
- # Special case where C is always on by definition since PLplot core
- # library is written in C.
- set(ENABLE_c ON)
- else(language STREQUAL "c")
- if(CORE_ENABLE_${language})
- if(NOT PRESET_DEFAULT)
- set(DEFAULT ${CORE_ENABLE_${language}})
- endif(NOT PRESET_DEFAULT)
- option(ENABLE_${language} "Enable ${language} bindings" ${DEFAULT})
- else(CORE_ENABLE_${language})
- set(ENABLE_${language} OFF CACHE BOOL "Enable ${language} bindings" FORCE)
- endif(CORE_ENABLE_${language})
- endif(language STREQUAL "c")
+ if(CORE_ENABLE_${language})
+ if(NOT PRESET_DEFAULT)
+ set(DEFAULT ${CORE_ENABLE_${language}})
+ endif(NOT PRESET_DEFAULT)
+ option(ENABLE_${language} "Enable ${language} bindings" ${DEFAULT})
+ else(CORE_ENABLE_${language})
+ set(ENABLE_${language} OFF CACHE BOOL "Enable ${language} bindings" FORCE)
+ endif(CORE_ENABLE_${language})
endforeach(language_info ${language_info_LIST})
if(ENABLE_c)
- enable_language(C)
+ enable_language(C OPTIONAL)
+ if(NOT CMAKE_C_COMPILER_WORKS)
+ message(STATUS: "WARNING: C compiler does not work so disabling C examples.")
+ set(ENABLE_c OFF CACHE BOOL "Enable c bindings" FORCE)
+ endif(NOT CMAKE_C_COMPILER_WORKS)
endif(ENABLE_c)
if(ENABLE_ada)
- enable_language(Ada)
+ enable_language(Ada OPTIONAL)
+ if(NOT CMAKE_Ada_COMPILER_WORKS)
+ message(STATUS: "WARNING: Ada compiler does not work so disabling Ada examples.")
+ set(ENABLE_ada OFF CACHE BOOL "Enable ada bindings" FORCE)
+ endif(NOT CMAKE_Ada_COMPILER_WORKS)
+endif(ENABLE_ada)
+
+if(ENABLE_ada)
set(ADA_INCLUDE_DIR @ADA_INCLUDE_DIR@)
set(ADA_LIB_DIR @ADA_LIB_DIR@)
endif(ENABLE_ada)
if(ENABLE_cxx)
- enable_language(CXX)
+ enable_language(CXX OPTIONAL)
+ if(NOT CMAKE_CXX_COMPILER_WORKS)
+ message(STATUS: "WARNING: C++ compiler does not work so disabling C++ examples.")
+ set(ENABLE_cxx OFF CACHE BOOL "Enable cxx bindings" FORCE)
+ endif(NOT CMAKE_CXX_COMPILER_WORKS)
endif(ENABLE_cxx)
if(ENABLE_d)
- enable_language(D)
+ enable_language(D OPTIONAL)
+ if(NOT CMAKE_D_COMPILER_WORKS)
+ message(STATUS: "WARNING: D compiler does not work so disabling D examples.")
+ set(ENABLE_d OFF CACHE BOOL "Enable d bindings" FORCE)
+ endif(NOT CMAKE_D_COMPILER_WORKS)
endif(ENABLE_d)
-if(ENABLE_F77 OR ENABLE_f95)
+if(ENABLE_f77 OR ENABLE_f95)
set(STATIC_OPTS @STATIC_OPTS@)
- enable_language(Fortran)
-endif(ENABLE_F77 OR ENABLE_f95)
+endif(ENABLE_f77 OR ENABLE_f95)
+if(ENABLE_f77 OR ENABLE_f95)
+ enable_language(Fortran OPTIONAL)
+ if(NOT CMAKE_Fortran_COMPILER_WORKS)
+ message(STATUS: "WARNING: Fortran compiler does not work so disabling Fortran examples.")
+ set(ENABLE_f77 OFF CACHE BOOL "Enable f77 bindings" FORCE)
+ set(ENABLE_f95 OFF CACHE BOOL "Enable f95 bindings" FORCE)
+ endif(NOT CMAKE_Fortran_COMPILER_WORKS)
+endif(ENABLE_f77 OR ENABLE_f95)
+
if(ENABLE_f95)
set(F95_MOD_DIR @F95_MOD_DIR@)
endif(ENABLE_f95)
if(ENABLE_java)
- enable_language(Java)
+ enable_language(Java OPTIONAL)
+ if(NOT CMAKE_Java_COMPILER_WORKS)
+ message(STATUS: "WARNING: Java compiler does not work so disabling Java examples.")
+ set(ENABLE_java OFF CACHE BOOL "Enable java bindings" FORCE)
+ endif(NOT CMAKE_Java_COMPILER_WORKS)
+endif(ENABLE_java)
+
+if(ENABLE_java)
find_package(JNI)
set(JAR_DIR @JAR_DIR@)
endif(ENABLE_java)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|