|
From: <ai...@us...> - 2009-07-15 20:23:39
|
Revision: 10150
http://plplot.svn.sourceforge.net/plplot/?rev=10150&view=rev
Author: airwin
Date: 2009-07-15 20:23:29 +0000 (Wed, 15 Jul 2009)
Log Message:
-----------
We have now removed the necessity of having a working C++ compiler from the
PLplot build.
For c++.cmake use simple warning messages (just like all other languages) if
a working C++ compiler cannot be found. Also, only do all further extra C++
checks if there is a working C++ compiler.
For plplot.cmake, move the include(c++) line back to its normal location
within plplot.cmake (since check_prototype_exists no longer depends on a
working C++ compiler).
Modified Paths:
--------------
trunk/cmake/modules/c++.cmake
trunk/cmake/modules/plplot.cmake
Modified: trunk/cmake/modules/c++.cmake
===================================================================
--- trunk/cmake/modules/c++.cmake 2009-07-15 20:17:12 UTC (rev 10149)
+++ trunk/cmake/modules/c++.cmake 2009-07-15 20:23:29 UTC (rev 10150)
@@ -28,50 +28,40 @@
OPTION(ENABLE_cxx "Enable C++ bindings" ON)
endif(DEFAULT_NO_BINDINGS)
-# Always carry out C++ checks, since C++ used for more than just
-# C++ bindings.
-set(alwayscxx ON)
-
# OPTIONAL below currently does not work properly with CMake so attempt
# to deal with a possibly missing compiler first as a workaround.
-if(alwayscxx OR ENABLE_cxx)
+if(ENABLE_cxx)
include(CMakeDetermineCXXCompiler)
if(NOT CMAKE_CXX_COMPILER)
- # This is FATAL_ERROR rather than STATUS message because C++ absolutely
- # required for check_prototype_exists test (and perhaps other preliminary
- # tests as well).
- message(FATAL_ERROR "C++ compiler absolutely required to build this project.")
message(STATUS "WARNING: C++ compiler not found so disabling C++ bindings and examples.")
set(ENABLE_cxx OFF CACHE BOOL "Enable C++ bindings" FORCE)
endif(NOT CMAKE_CXX_COMPILER)
-endif(alwayscxx OR ENABLE_cxx)
+endif(ENABLE_cxx)
-if(alwayscxx OR ENABLE_cxx)
+if(ENABLE_cxx)
# Find and check C++ compiler.
enable_language(CXX OPTIONAL)
if(NOT CMAKE_CXX_COMPILER_WORKS)
- # This is FATAL_ERROR rather than STATUS message because C++ absolutely
- # required for check_prototype_exists test (and perhaps other preliminary
- # tests as well).
- message(FATAL_ERROR "C++ compiler absolutely required to build this project.")
message(STATUS "No working C++ compiler found so PLplot cannot be built.")
set(ENABLE_cxx OFF CACHE BOOL "Enable C++ bindings" FORCE)
endif(NOT CMAKE_CXX_COMPILER_WORKS)
-endif(alwayscxx OR ENABLE_cxx)
+endif(ENABLE_cxx)
-# Check if "using namespace std;" works
-INCLUDE(TestForNamespace)
+if(ENABLE_cxx)
+ # Check if "using namespace std;" works
+ INCLUDE(TestForNamespace)
-# Check for <cmath>
-INCLUDE(CheckIncludeFileCXX)
-CHECK_INCLUDE_FILE_CXX(cmath HAVE_CMATH)
+ # Check for <cmath>
+ INCLUDE(CheckIncludeFileCXX)
+ CHECK_INCLUDE_FILE_CXX(cmath HAVE_CMATH)
-if(NOT MSVC)
- # Need to add check for broken cmath with isnan missing (BROKEN_ISNAN_CXX)
- # but not for Visual C++ compilers
- include(TestBrokenIsnanCXX)
-endif(NOT MSVC)
+ if(NOT MSVC)
+ # Need to add check for broken cmath with isnan missing (BROKEN_ISNAN_CXX)
+ # but not for Visual C++ compilers
+ include(TestBrokenIsnanCXX)
+ endif(NOT MSVC)
-# Need to add check if stdint.h can be used from c++ (HAVE_CXX_STDINT_H)
-INCLUDE(TestForStdintCXX)
+ # Need to add check if stdint.h can be used from c++ (HAVE_CXX_STDINT_H)
+ INCLUDE(TestForStdintCXX)
+endif(ENABLE_cxx)
Modified: trunk/cmake/modules/plplot.cmake
===================================================================
--- trunk/cmake/modules/plplot.cmake 2009-07-15 20:17:12 UTC (rev 10149)
+++ trunk/cmake/modules/plplot.cmake 2009-07-15 20:23:29 UTC (rev 10150)
@@ -123,9 +123,6 @@
# the ctype.h' macros work on characters with the high bit set, as
# ANSI C requires.
-# check_prototype_exists requires C++
-include(c++)
-
message(STATUS "Checking whether system has ANSI C header files")
check_include_files("stdlib.h;stdarg.h;string.h;float.h" StandardHeadersExist)
if(StandardHeadersExist)
@@ -382,8 +379,7 @@
"All language bindings are disabled by default"
OFF
)
-# Load language specific files
-# C++ done much earlier because check_prototype_exists macro requires it.
+include(c++)
include(fortran)
include(java)
include(python)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|