Permalink
Browse files

CMake files added to generate makefiles/projectfiles for FoX

Rationale:
- Not everyone is comfortable with using autoconf and friends.
- Current build system only works on unix-like platforms, I think.
- I use CMake to generate makefiles for my Fortran code, which
  works really well since CMake 2.6. This would mean less work
  for me when a new FoX version is released, as CMakeFiles would
  be included.

Features:
- Parallel build works ok, execute:
  $ mkdir build/ && cd build/ && cmake ../ && make -j
  from the top-level directory
- Switching to a different compiler:
  e.g. when gfortran is default and you want g95:
  $ g95 && cd build/ && cmake ../ && make -j
  note that commercial compilers get picked by cmake by default,
  so if you have both gfortran/g95 and ifort in your path, then
  ifort is picked as default.
- Only compiles the FoX library
- Does not interfere with the current build system.

Notes:
- It is encouraged to do out-of-source builds, from
  within the 'build' directory as shown above. This means that
  a 'make very clean' is done as follows:
  cd build/ && rm -rf *
- f90 files are generated from m4 sources if necessary, but
  only where m4 is available
- Some work done detecting ABORT and FLUSH intrinsics,
  and the associated in restricted expression bug.
  fortran test files for these are located in cmake subdir.
- Every directory that contains sources now also contains a
  CMakeLists.txt file that tells CMake what to do when
  generating makefiles.
- Unused test program cmake/output_eol.f90 that might be used
  to check end-of-line characters as produced by compiler.
  at the moment, this is done by determining the platform
  (mac, unix or win32) and setting the preprocessor directive
  according to their default line endings. I do not know
  wether this works with e.g. mingw or cygwin...

Todo:
- get feedback from using cmake on other platforms (especially
  windows with visual studio project files)
- add unit tests
  • Loading branch information...
1 parent 5fcff6d commit d54d07b4639dd8ce068cb65c4d7c194442d5febf @wim wim committed with Dec 7, 2008
View
105 CMakeLists.txt
@@ -0,0 +1,105 @@
+PROJECT(fox Fortran)
+
+SET(CMAKE_VERBOSE_MAKEFILE FALSE)
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+#======================#
+# set another compiler #
+#======================#
+# to set another compiler than the default,
+# do the usual from within the build directory:
+# $ FC=g95
+# $ rm -rf * && cmake ../
+# $ make
+
+#=====================#
+# verbose make output #
+#=====================#
+# to see out all commands used during building,
+# do as follows:
+# $ rm -rf * && cmake ../
+# $ make VERBOSE=1
+
+#======================#
+# speed up compilation #
+#======================#
+# to speed up compilation by using multiple cores/processors,
+# do the following:
+# $ rm -rf * && cmake ../
+# $ make -j
+
+#==============================#
+# get the machine architecture #
+#==============================#
+
+SET(OS ${CMAKE_SYSTEM})
+SET(MACHINE_ARCH ${CMAKE_SYSTEM_PROCESSOR})
+
+MESSAGE(STATUS "determining operating system and architecture:")
+MESSAGE(" -> your operating system is : ${OS}")
+MESSAGE(" -> your architecture is : ${MACHINE_ARCH}")
+
+
+#==========================#
+# check if m4 is available #
+#==========================#
+
+MESSAGE(STATUS "Searching for m4 scripting language")
+FIND_PROGRAM(M4_PROGRAM m4)
+IF(${M4_PROGRAM} MATCHES "NOTFOUND")
+ MESSAGE(" -> WARNING : could not find m4, cannot generate fortran files from m4 sources")
+ELSE(${M4_PROGRAM} MATCHES "NOTFOUND")
+ MESSAGE(" -> ${M4_PROGRAM}")
+ENDIF(${M4_PROGRAM} MATCHES "NOTFOUND")
+
+#============================#
+# set some other definitions #
+#============================#
+
+# file name extensions
+SET(m4_ext .m4)
+SET(f90pp_ext .F90)
+SET(f90_ext .f90)
+
+###===================================###
+###===================================###
+### determine some preprocessor flags ###
+###===================================###
+###===================================###
+
+#===========================================================#
+# determine end-of-line character based on operating system #
+#===========================================================#
+
+INCLUDE(./cmake/DetermineEOL.cmake)
+
+#============================================#
+# determine if and how FLUSH intrinsic works #
+#============================================#
+
+INCLUDE(./cmake/CheckFlushIntrinsic.cmake)
+
+#=====================================================#
+# check for 'associated in restricted expression' bug #
+#=====================================================#
+
+INCLUDE(./cmake/CheckAssociatedBug.cmake)
+
+#============================================#
+# determine if and how ABORT intrinsic works #
+#============================================#
+
+INCLUDE(./cmake/CheckAbortIntrinsic.cmake)
+
+SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${FPPFLAGS}")
+
+
+ADD_SUBDIRECTORY(fsys)
+ADD_SUBDIRECTORY(utils)
+ADD_SUBDIRECTORY(common)
+ADD_SUBDIRECTORY(wxml)
+ADD_SUBDIRECTORY(wcml)
+ADD_SUBDIRECTORY(sax)
+ADD_SUBDIRECTORY(dom)
+
View
43 cmake/CMakeLists.txt
@@ -0,0 +1,43 @@
+project(fox_config Fortran)
+
+SET(CMAKE_BUILD_TYPE Debug)
+
+SET(ASSOCIATED_SRCS
+ associated_bug.f90
+)
+
+ADD_LIBRARY(
+ expr_bug
+ ${ASSOCIATED_SRCS}
+)
+
+# abort: bare
+SET(ABORT_BARE_SRC
+ abort_bare.f90
+)
+
+ADD_EXECUTABLE(
+ abort_bare
+ ${ABORT_BARE_SRC}
+)
+
+# abort: nag
+SET(ABORT_NAG_SRC
+ abort_nag.f90
+)
+
+ADD_EXECUTABLE(
+ abort_nag
+ ${ABORT_NAG_SRC}
+)
+
+# abort: xlf
+SET(ABORT_XLF_SRC
+ abort_xlf.f90
+)
+
+ADD_EXECUTABLE(
+ abort_xlf
+ ${ABORT_XLF_SRC}
+)
+
View
64 cmake/CheckAbortIntrinsic.cmake
@@ -0,0 +1,64 @@
+#============================================#
+# determine if and how ABORT intrinsic works #
+#============================================#
+
+MESSAGE(STATUS "Determining method to call abort intrinsic")
+SET(TEST_ABORT_OK FALSE)
+
+# intel abort
+IF(NOT DEFINED ABORT)
+ TRY_COMPILE(TEST_ABORT_INTEL ${fox_BINARY_DIR}/abort_intel ${fox_SOURCE_DIR}/cmake
+ fox_config abort_intel
+ OUTPUT_VARIABLE BUILD_OUTPUT
+ )
+ IF(${TEST_ABORT_INTEL} MATCHES TRUE)
+ MESSAGE(" abort : intel works")
+ SET(ABORT "INTEL")
+ SET(ABORT_METHOD "with argument")
+ SET(FPPFLAGS "${FPPFLAGS} -DFC_HAVE_ABORT -DFC_ABORT_ARG")
+ ENDIF(${TEST_ABORT_INTEL} MATCHES TRUE)
+ENDIF(NOT DEFINED ABORT)
+
+# xlf abort
+IF(NOT DEFINED ABORT)
+ TRY_COMPILE(TEST_ABORT_XLF ${fox_BINARY_DIR}/abort_xlf ${fox_SOURCE_DIR}/cmake
+ fox_config abort_xlf
+ OUTPUT_VARIABLE BUILD_OUTPUT
+ )
+ IF(${TEST_ABORT_XLF} MATCHES TRUE)
+ MESSAGE(" abort : xlf works")
+ SET(ABORT "XLF")
+ SET(ABORT_METHOD "with underscore")
+ SET(FPPFLAGS "${FPPFLAGS} -DFC_HAVE_ABORT -DFC_ABORT_UNDERSCORE")
+ ENDIF(${TEST_ABORT_XLF} MATCHES TRUE)
+ENDIF(NOT DEFINED ABORT)
+
+# bare abort
+IF(NOT DEFINED ABORT)
+ TRY_COMPILE(TEST_ABORT_BARE ${fox_BINARY_DIR}/abort_bare ${fox_SOURCE_DIR}/cmake
+ fox_config abort_bare
+ OUTPUT_VARIABLE BUILD_OUTPUT
+ )
+ IF(${TEST_ABORT_BARE} MATCHES TRUE)
+ MESSAGE(" abort : bare works")
+ SET(ABORT "BARE")
+ SET(ABORT_METHOD "default")
+ SET(FPPFLAGS "${FPPFLAGS} -DFC_HAVE_ABORT")
+ ENDIF(${TEST_ABORT_BARE} MATCHES TRUE)
+ENDIF(NOT DEFINED ABORT)
+
+# nag abort
+IF(NOT DEFINED ABORT)
+ TRY_COMPILE(TEST_ABORT_NAG ${fox_BINARY_DIR}/abort_nag ${fox_SOURCE_DIR}/cmake
+ fox_config abort_nag
+ OUTPUT_VARIABLE BUILD_OUTPUT
+ )
+ IF(${TEST_ABORT_NAG} MATCHES TRUE)
+ MESSAGE(" abort : nag works")
+ SET(ABORT "NAG")
+ SET(ABORT_METHOD "with f90_unix_proc")
+ SET(FPPFLAGS "${FPPFLAGS} -DFC_HAVE_ABORT")
+ ENDIF(${TEST_ABORT_NAG} MATCHES TRUE)
+ENDIF(NOT DEFINED ABORT)
+
+
View
16 cmake/CheckAssociatedBug.cmake
@@ -0,0 +1,16 @@
+#=====================================================#
+# check for 'associated in restricted expression' bug #
+#=====================================================#
+
+MESSAGE(STATUS "Checking for 'associated in restricted expression' bug")
+TRY_COMPILE(TEST_ASSOCIATED ${fox_BINARY_DIR}/associated ${fox_SOURCE_DIR}/cmake
+ fox_config expr_bug
+ OUTPUT_VARIABLE BUILD_OUTPUT
+)
+
+IF(${TEST_ASSOCIATED} MATCHES FALSE)
+ MESSAGE(" -> yes")
+ SET(FPPFLAGS "${FPPFLAGS} -DRESTRICTED_ASSOCIATED_BUG")
+ENDIF(${TEST_ASSOCIATED} MATCHES FALSE)
+
+
View
64 cmake/CheckFlushIntrinsic.cmake
@@ -0,0 +1,64 @@
+#============================================#
+# determine if and how FLUSH intrinsic works #
+#============================================#
+
+MESSAGE(STATUS "Determining method to call flush intrinsic")
+SET(TEST_FLUSH_OK FALSE)
+
+# try standard (bare) flush call
+IF(NOT DEFINED FLUSH)
+ TRY_COMPILE(TEST_FLUSH_OK ${fox_BINARY_DIR} ${fox_SOURCE_DIR}/cmake/flush_bare.f90
+ OUTPUT_VARIABLE BUILD_OUTPUT
+ )
+ IF(${TEST_FLUSH_OK} MATCHES TRUE)
+ SET(FLUSH "bare")
+ SET(FLUSH_METHOD "default")
+ SET(FPPFLAGS "${FPPFLAGS} -DFC_HAVE_FLUSH")
+ ENDIF(${TEST_FLUSH_OK} MATCHES TRUE)
+ENDIF(NOT DEFINED FLUSH)
+
+# try standard flush with -Vaxlib as command line option
+IF(NOT DEFINED FLUSH)
+ TRY_COMPILE(TEST_FLUSH_OK ${fox_BINARY_DIR} ${fox_SOURCE_DIR}/cmake/flush_bare.f90
+ COMPILE_DEFINITIONS " -Vaxlib "
+ OUTPUT_VARIABLE BUILD_OUTPUT
+ )
+ IF(${TEST_FLUSH_OK} MATCHES TRUE)
+ SET(FLUSH "INTEL")
+ SET(FLUSH_METHOD "with -Vaxlib")
+ SET(FPPFLAGS "${FPPFLAGS} -DFC_HAVE_FLUSH")
+ SET(LDFLAGS "${LD_FLAGS} -Vaxlib")
+ ENDIF(${TEST_FLUSH_OK} MATCHES TRUE)
+ENDIF(NOT DEFINED FLUSH)
+
+# NAG flush call
+IF(NOT DEFINED FLUSH)
+ TRY_COMPILE(TEST_FLUSH_OK ${fox_BINARY_DIR} ${fox_SOURCE_DIR}/cmake/flush_nag.f90
+ OUTPUT_VARIABLE BUILD_OUTPUT
+ )
+ IF(${TEST_FLUSH_OK} MATCHES TRUE)
+ SET(FLUSH "NAG")
+ SET(FLUSH_METHOD "with f90_unix_io")
+ SET(FPPFLAGS "${FPPFLAGS} -DFC_HAVE_FLUSH")
+ ENDIF(${TEST_FLUSH_OK} MATCHES TRUE)
+ENDIF(NOT DEFINED FLUSH)
+
+# XLF flush call
+IF(NOT DEFINED FLUSH)
+ TRY_COMPILE(TEST_FLUSH_OK ${fox_BINARY_DIR} ${fox_SOURCE_DIR}/cmake/flush_xlf.f90
+ OUTPUT_VARIABLE BUILD_OUTPUT
+ )
+ IF(${TEST_FLUSH_OK} MATCHES TRUE)
+ SET(FLUSH "xlf")
+ SET(FLUSH_METHOD "with underscore")
+ SET(FPPFLAGS "${FPPFLAGS} -DFC_HAVE_FLUSH")
+ ENDIF(${TEST_FLUSH_OK} MATCHES TRUE)
+ENDIF(NOT DEFINED FLUSH)
+
+IF(DEFINED FLUSH)
+ MESSAGE(" -> flush intrinsic method is ${FLUSH_METHOD}")
+ELSE(DEFINED FLUSH)
+ MESSAGE(FATAL_ERROR " -> ERROR : could not determine how to call FLUSH intrinsic")
+ENDIF(DEFINED FLUSH)
+
+
View
22 cmake/DetermineEOL.cmake
@@ -0,0 +1,22 @@
+#===========================================================#
+# determine end-of-line character based on operating system #
+#===========================================================#
+
+MESSAGE(STATUS "Determining end-of-line character by the host name")
+IF(${CMAKE_HOST_APPLE})
+ SET(FPPFLAGS ${FPPFLAGS} "-DFC_EOR_CR")
+ SET(EOLCHAR "CR")
+ELSEIF(${CMAKE_HOST_WIN32})
+ SET(FPPFLAGS ${FPPFLAGS} "-DFC_EOR_CRLF")
+ SET(EOLCHAR "CRLF")
+ELSEIF(${CMAKE_HOST_UNIX})
+ SET(FPPFLAGS ${FPPFLAGS} "-DFC_EOR_LF")
+ SET(EOLCHAR "LF")
+ELSE(${CMAKE_HOST_APPLE})
+ SET(FPPFLAGS ${FPPFLAGS})
+ MESSAGE(STATUS "warning: could not determine host system: not unix, not win32 and not mac")
+ SET(EOLCHAR "")
+ENDIF(${CMAKE_HOST_APPLE})
+MESSAGE(" -> end-of-line character is ${EOLCHAR}")
+
+
View
7 cmake/Fortran_Have_Flush.cmake
@@ -0,0 +1,7 @@
+#==========================================#
+# does the compiler have a flush statement #
+#==========================================#
+
+
+
+
View
4 cmake/abort_bare.f90
@@ -0,0 +1,4 @@
+program abort_bare
+ call abort
+end program abort_bare
+
View
4 cmake/abort_intel.f90
@@ -0,0 +1,4 @@
+program abort_intel
+ call abort("")
+end program abort_intel
+
View
5 cmake/abort_nag.f90
@@ -0,0 +1,5 @@
+program abort_nag
+ use f90_unix_proc, only: abort
+ call abort
+end program abort_nag
+
View
4 cmake/abort_xlf.f90
@@ -0,0 +1,4 @@
+program abort_xlf
+ call abort_
+end program abort_xlf
+
View
6 cmake/associated_bug.f90
@@ -0,0 +1,6 @@
+function associated_bug(a) result(b)
+ integer , pointer :: a
+ integer , dimension(merge(1,2,associated(a))) :: b
+ b = 0
+end function associated_bug
+
View
5 cmake/flush_bare.f90
@@ -0,0 +1,5 @@
+program flush_bare
+ print*
+ call flush(5)
+end program flush_bare
+
View
6 cmake/flush_nag.f90
@@ -0,0 +1,6 @@
+program flush_nag
+ use f90_unix_io, only: flush
+ print*
+ call flush(5)
+end program flush_nag
+
View
5 cmake/flush_xlf.f90
@@ -0,0 +1,5 @@
+program flush_xlf
+ print*
+ call flush_(5)
+end program flush_xlf
+
View
52 cmake/output_eol.f90
@@ -0,0 +1,52 @@
+program output_eol
+
+ character(len=1) :: single_char = "a"
+ integer :: ios
+ integer(kind=1) :: n1,n2,n3
+
+ n1 = 0
+ n2 = 0
+ n3 = 0
+ ! open a file, write a single character and close it again
+ open(unit=10,file="eol.out",status="unknown")
+ write(10,"(a)") single_char
+ close(10)
+
+ ! open the file unformatted, stream
+ open(unit=11,file="eol.out",status="old",form="unformatted",access="stream",iostat=ios)
+
+ ! read first character (should be an a)
+ read(11,iostat=ios) n1 ! should be 97 (ascii a)
+ if ( ios < 0 ) then
+ !print *, "end of file reached after 0 characters"
+ else
+ ! read second character, should be lf (ascii 10) on dos and unix,
+ ! and cr on mac (ascii 13)
+ read(11,iostat=ios) n2
+ if ( ios < 0 ) then
+ ! this should not happen now, there are at least 2 characters in the file
+ !print *, "end of file reached after 1 character"
+ else
+ ! read third character if we're on dos
+ read(11,iostat=ios) n3
+ if ( ios < 0 ) then
+ !print *, "end of file reached after 2 characters"
+ end if
+ end if
+ end if
+
+ ! analyse n2 and n3
+ if ( n2 == 10 .and. n3 == 0 ) then
+ print *, "LF"
+ elseif ( n2 == 13 .and. n3 == 10 ) then
+ print *, "CRLF"
+ elseif ( n2 == 13 .and. n3 == 0 ) then
+ print *, "CR"
+ else
+ print *, "could not determine line-ending convention"
+ end if
+ close(11)
+
+
+end program
+
View
38 common/CMakeLists.txt
@@ -0,0 +1,38 @@
+set(fox_common_srcs
+ FoX_common.F90
+)
+
+set(fox_common_srcs_pp
+ m_common_attrs.F90
+ m_common_buffer.F90
+ m_common_charset.F90
+ m_common_content_model.F90
+ m_common_element.F90
+ m_common_elstack.F90
+ m_common_entities.F90
+ m_common_entity_expand.F90
+ m_common_error.F90
+ m_common_io.F90
+ m_common_namecheck.F90
+ m_common_namespaces.F90
+ m_common_notations.F90
+ m_common_struct.F90
+)
+
+add_library(
+ fox_common STATIC
+ ${fox_common_srcs}
+ ${fox_common_srcs_pp}
+)
+
+target_link_libraries(
+ fox_common
+ fox_utils
+ fox_fsys
+)
+
+include_directories(
+ ${fox_BINARY_DIR}/fsys
+ ${fox_BINARY_DIR}/utils
+)
+
View
109 dom/CMakeLists.txt
@@ -0,0 +1,109 @@
+
+
+set(m_dom_dom_srcs
+ m_dom_types.m4
+ m_dom_node.m4
+ m_dom_nodelist.m4
+ m_dom_namednodemap.m4
+ m_dom_implementation.m4
+ m_dom_document.m4
+ m_dom_document_type.m4
+ m_dom_element.m4
+ m_dom_attribute.m4
+ m_dom_character_data.m4
+ m_dom_entity.m4
+ m_dom_processing_instruction.m4
+ m_dom_text.m4
+ m_dom_common.m4
+ m_dom_exception.m4
+ m_dom_dom.m4
+ m_dom_namespaces.m4
+ m_dom_configuration.m4
+ m_dom_treewalk.m4
+ m_dom_exception.m4
+ m_dom_object.m4
+)
+
+# m_dom_extras.F90: m_dom_extras.m4
+# m4 -I ../m4 $< > $@
+IF(NOT ${M4_PROGRAM} MATCHES "NOTFOUND")
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/m_dom_extras.F90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/m_dom_extras.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/m_dom_extras.F90
+ DEPENDS m_dom_extras.m4
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ VERBATIM
+ )
+
+ # m_dom_parse.f90: m_dom_parse.m4
+ # m4 -I ../m4 $< > $@
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/m_dom_parse.f90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/m_dom_parse.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/m_dom_parse.f90
+ DEPENDS m_dom_parse.m4
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ VERBATIM
+ )
+
+ # m_dom_utils.f90: m_dom_utils.m4
+ # m4 -I ../m4 $< > $@
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/m_dom_utils.f90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/m_dom_utils.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/m_dom_utils.f90
+ DEPENDS m_dom_utils.m4
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ VERBATIM
+ )
+
+ # m_dom_dom.F90: $(M4FILES)
+ # m4 -I ../m4 m_dom_dom.m4 > $@
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/m_dom_dom.F90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/m_dom_dom.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/m_dom_dom.F90
+ DEPENDS ${m_dom_dom_srcs}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ VERBATIM
+ )
+ENDIF(NOT ${M4_PROGRAM} MATCHES "NOTFOUND")
+
+
+set(fox_dom_srcs_pp
+ m_dom_dom.F90
+ m_dom_extras.F90
+)
+
+set(fox_dom_srcs
+ FoX_dom.f90
+ m_dom_error.f90
+ m_dom_parse.f90
+ m_dom_utils.f90
+)
+
+add_library(
+ fox_dom STATIC
+ ${fox_dom_srcs}
+ ${fox_dom_srcs_pp}
+)
+
+## add_dependencies(
+## fox_dom
+## dom_generate
+## )
+
+target_link_libraries(
+ fox_dom
+ fox_wxml
+ fox_sax
+)
+
+include_directories(
+ ${fox_BINARY_DIR}/dom
+ ${fox_BINARY_DIR}/wxml
+ ${fox_BINARY_DIR}/common
+ ${fox_BINARY_DIR}/utils
+ ${fox_BINARY_DIR}/fsys
+ ${fox_BINARY_DIR}/sax
+)
+
+
+
View
32 fsys/CMakeLists.txt
@@ -0,0 +1,32 @@
+# fox_m_fsys_parse_input.F90: fox_m_fsys_parse_input.m4
+# m4 -I ../m4 $< > $@
+IF(NOT ${M4_PROGRAM} MATCHES "NOTFOUND")
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/fox_m_fsys_parse_input.F90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/fox_m_fsys_parse_input.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/fox_m_fsys_parse_input.F90
+ DEPENDS fox_m_fsys_parse_input.m4
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ VERBATIM
+ )
+ENDIF(NOT ${M4_PROGRAM} MATCHES "NOTFOUND")
+
+set(fox_fsys_srcs
+ fox_m_fsys_realtypes.f90
+# m_ieee.f90
+)
+
+set(fox_fsys_srcs_pp
+ fox_m_fsys_abort_flush.F90
+ fox_m_fsys_array_str.F90
+ fox_m_fsys_format.F90
+ fox_m_fsys_parse_input.F90
+ fox_m_fsys_string.F90
+ fox_m_fsys_string_list.F90
+)
+
+add_library(
+ fox_fsys STATIC
+ ${fox_fsys_srcs}
+ ${fox_fsys_srcs_pp}
+)
+
View
33 sax/CMakeLists.txt
@@ -0,0 +1,33 @@
+set(fox_sax_srcs
+ FoX_sax.f90
+)
+
+set(fox_sax_srcs_pp
+ m_sax_operate.F90
+ m_sax_parser.F90
+ m_sax_reader.F90
+ m_sax_tokenizer.F90
+ m_sax_types.F90
+ m_sax_xml_source.F90
+)
+
+
+add_library(
+ fox_sax STATIC
+ ${fox_sax_srcs}
+ ${fox_sax_srcs_pp}
+)
+
+target_link_libraries(
+ fox_sax
+ fox_common
+ fox_utils
+ fox_fsys
+)
+
+include_directories(
+ ${fox_BINARY_DIR}/common
+ ${fox_BINARY_DIR}/utils
+ ${fox_BINARY_DIR}/fsys
+)
+
View
25 utils/CMakeLists.txt
@@ -0,0 +1,25 @@
+set(fox_utils_srcs
+ FoX_utils.f90
+)
+
+set(fox_utils_srcs_pp
+ fox_m_utils_mtprng.F90
+ fox_m_utils_uri.F90
+ fox_m_utils_uuid.F90
+)
+
+add_library(
+ fox_utils STATIC
+ ${fox_utils_srcs}
+ ${fox_utils_srcs_pp}
+)
+
+target_link_libraries(
+ fox_utils
+ fox_fsys
+)
+
+include_directories(
+ ${fox_BINARY_DIR}/fsys
+)
+
View
111 wcml/CMakeLists.txt
@@ -0,0 +1,111 @@
+# m_wcml_coma.F90: m_wcml_coma.m4
+# m4 -I ../m4 $< > $@
+IF(NOT ${M4_PROGRAM} MATCHES "NOTFOUND")
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_coma.F90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_coma.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_coma.F90
+ DEPENDS m_wcml_coma.m4
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+ # m_wcml_geometry.F90: m_wcml_geometry.m4
+ # m4 -I ../m4 $< > $@
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_geometry.F90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_geometry.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_geometry.F90
+ DEPENDS m_wcml_geometry.m4
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+ # m_wcml_lattice.F90: m_wcml_lattice.m4
+ # m4 -I ../m4 $< > $@
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_lattice.F90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_lattice.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_lattice.F90
+ DEPENDS m_wcml_lattice.m4
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+ # m_wcml_lists.F90: m_wcml_lists.m4
+ # m4 -I ../m4 $< > $@
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_lists.F90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_lists.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_lists.F90
+ DEPENDS m_wcml_lists.m4
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+ # m_wcml_molecule.F90: m_wcml_molecule.m4
+ # m4 -I ../m4 $< > $@
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_molecule.F90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_molecule.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_molecule.F90
+ DEPENDS m_wcml_molecule.m4
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+ # m_wcml_parameter.F90: m_wcml_parameter.m4
+ # m4 -I ../m4 $< > $@
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_parameter.F90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_parameter.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_parameter.F90
+ DEPENDS m_wcml_parameter.m4
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+ # m_wcml_property.F90: m_wcml_property.m4
+ # m4 -I ../m4 $< > $@
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_property.F90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_property.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_property.F90
+ DEPENDS m_wcml_property.m4
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+ # m_wcml_stml.F90: m_wcml_stml.m4
+ # m4 -I ../m4 $< > $@
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_stml.F90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_stml.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/m_wcml_stml.F90
+ DEPENDS m_wcml_stml.m4
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+ENDIF(NOT ${M4_PROGRAM} MATCHES "NOTFOUND")
+
+
+set(fox_wcml_srcs
+ FoX_wcml.f90
+)
+
+set(fox_wcml_srcs_pp
+ m_wcml_coma.F90
+ m_wcml_core.F90
+ m_wcml_geometry.F90
+ m_wcml_lattice.F90
+ m_wcml_lists.F90
+ m_wcml_metadata.F90
+ m_wcml_molecule.F90
+ m_wcml_parameter.F90
+ m_wcml_property.F90
+ m_wcml_stml.F90
+)
+
+add_library(
+ fox_wcml STATIC
+ ${fox_wcml_srcs}
+ ${fox_wcml_srcs_pp}
+)
+
+target_link_libraries(
+ fox_wcml
+ fox_utils
+ fox_wxml
+)
+
+include_directories(
+ ${fox_BINARY_DIR}/fsys
+ ${fox_BINARY_DIR}/utils
+ ${fox_BINARY_DIR}/wxml
+ ${fox_BINARY_DIR}/common
+)
+
View
40 wxml/CMakeLists.txt
@@ -0,0 +1,40 @@
+# m_wxml_overloads.F90: m_wxml_overloads.m4
+# m4 -I ../m4 $< > $@
+IF(NOT ${M4_PROGRAM} MATCHES "NOTFOUND")
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/m_wxml_overloads.F90
+ COMMAND ${M4_PROGRAM} -I ../m4 ${CMAKE_CURRENT_SOURCE_DIR}/m_wxml_overloads.m4 > ${CMAKE_CURRENT_SOURCE_DIR}/m_wxml_overloads.F90
+ DEPENDS m_wxml_overloads.m4
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ VERBATIM
+ )
+ENDIF(NOT ${M4_PROGRAM} MATCHES "NOTFOUND")
+
+set(fox_wxml_srcs
+ FoX_wxml.f90
+)
+
+set(fox_wxml_srcs_pp
+ m_wxml_core.F90
+ m_wxml_escape.F90
+ m_wxml_overloads.F90
+)
+
+add_library(
+ fox_wxml STATIC
+ ${fox_wxml_srcs}
+ ${fox_wxml_srcs_pp}
+)
+
+target_link_libraries(
+ fox_wxml
+ fox_common
+ fox_fsys
+)
+
+include_directories(
+ ${fox_BINARY_DIR}/fsys
+ ${fox_BINARY_DIR}/common
+ ${fox_BINARY_DIR}/utils
+)
+

0 comments on commit d54d07b

Please sign in to comment.