|
From: <ai...@us...> - 2009-09-13 17:22:21
|
Revision: 10406
http://plplot.svn.sourceforge.net/plplot/?rev=10406&view=rev
Author: airwin
Date: 2009-09-13 17:22:14 +0000 (Sun, 13 Sep 2009)
Log Message:
-----------
Clean up some dependency overkill that was not needed.
Configure plflt.inc rather than writing it. Writing that file caused the f95
bindings to get rebuilt in error any time _any_ CMakeLists.txt file was
edited. Configuring that file, solves that issue.
Modified Paths:
--------------
trunk/bindings/f95/CMakeLists.txt
Added Paths:
-----------
trunk/bindings/f95/plflt.inc.in
Modified: trunk/bindings/f95/CMakeLists.txt
===================================================================
--- trunk/bindings/f95/CMakeLists.txt 2009-09-13 17:08:28 UTC (rev 10405)
+++ trunk/bindings/f95/CMakeLists.txt 2009-09-13 17:22:14 UTC (rev 10406)
@@ -30,28 +30,19 @@
${CMAKE_CURRENT_BINARY_DIR}
)
- # Generate the include file that specifies the kind of floating
- # point (single vs double) PLplot supports
- #
- FILE(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/plflt.inc" INC_FILE)
- FILE(WRITE "${INC_FILE}"
- "! Include file to control the kind of floating point number\n"
- "! used by PLplot (single vs double)\n"
- "! This file is automatically generated by CMake\n")
+ # Configure the Fortran include file that specifies the kind of
+ # floating-point (single vs double) PLplot supports.
if(PL_DOUBLE)
- FILE(APPEND "${INC_FILE}"
- "integer, parameter :: plflt = kind(1.0d0)\n")
+ set(ONE_IN_DEFAULT_PRECISION "1.0d0")
else(PL_DOUBLE)
- FILE(APPEND "${INC_FILE}"
- "integer, parameter :: plflt = kind(1.0)\n")
+ set(ONE_IN_DEFAULT_PRECISION "1.0")
endif(PL_DOUBLE)
- # Only 4 bytes required in Fortran to represent an unsigned 32-bit
- # PLUNICODE.
- FILE(APPEND "${INC_FILE}"
- "integer, parameter :: plunicode = 4\n")
- # Mark the include file as being generated
- set_source_files_properties(plflt.inc PROPERTIES GENERATED ON)
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/plflt.inc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/plflt.inc
+ @ONLY
+ )
## Build C part of F95 bindings
if(WIN32)
@@ -65,7 +56,6 @@
endif(WIN32)
set(plplotf95c${LIB_TAG}_LIB_SRCS
- plstubs.h
sc3d.c
sccont.c
scstubs.c
@@ -105,7 +95,18 @@
RUNTIME DESTINATION ${BIN_DIR}
)
- ## Build fortran part of F95 bindings
+ # Build fortran part of F95 bindings.
+ # Notes:
+
+ # configurable.f90 is actually not currently configurable.
+
+ # The CMake Fortran dependency scanner finds the Fortran include
+ # file, sfstub.h, and the configured Fortran include file,
+ # ${CMAKE_CURRENT_BINARY_DIR}/plflt.inc, and also deals properly with
+ # the dependencies on those files. Therefore, there is no need to
+ # include those files in the SRCS list or do anything special with
+ # their dependencies.
+
if(STATIC_OPTS)
set(plplotf95opts${LIB_TAG}_LIB_SRCS
configurable.f90
@@ -113,14 +114,12 @@
set(plplotf95${LIB_TAG}_LIB_SRCS
strutil.f90
sfstubsf95.f90
- sfstubs.h
)
else(STATIC_OPTS)
set(plplotf95${LIB_TAG}_LIB_SRCS
strutil.f90
configurable.f90
sfstubsf95.f90
- sfstubs.h
)
endif(STATIC_OPTS)
@@ -128,10 +127,6 @@
SET(plplotf95${LIB_TAG}_LIB_SRCS ${plplotf95${LIB_TAG}_LIB_SRCS} plplotf95.def)
endif(WIN32 AND BUILD_SHARED_LIBS AND NOT MINGW AND NOT CYGWIN)
- # Explicitly include dependencies for sfstubsf95.f90
- include(AddFileDependencies)
- add_file_dependencies(sfstubsf95.f90 ${CMAKE_CURRENT_BINARY_DIR}/plflt.inc)
-
add_library(plplotf95${LIB_TAG} ${plplotf95${LIB_TAG}_LIB_SRCS})
if(STATIC_OPTS)
Added: trunk/bindings/f95/plflt.inc.in
===================================================================
--- trunk/bindings/f95/plflt.inc.in (rev 0)
+++ trunk/bindings/f95/plflt.inc.in 2009-09-13 17:22:14 UTC (rev 10406)
@@ -0,0 +1,5 @@
+! Include file to control the kind of floating point number
+! used by PLplot (single vs double)
+! This file is automatically configured by CMake
+integer, parameter :: plflt = kind(@ONE_IN_DEFAULT_PRECISION@)
+integer, parameter :: plunicode = 4
Property changes on: trunk/bindings/f95/plflt.inc.in
___________________________________________________________________
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|