SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} -ldl)
ENDIF(WINDOWS)
-SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=4 -DSIZEOF_INT=4)
+SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4)
# SET(PLATFORM_CPPFLAGS)
# # # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT -D_CRT_SECURE_NO_WARNINGS)
SET(var ${var} ${AM_CPPFLAGS})
SET(var ${var} ${AM_CXXFLAGS})
''')
+ # --
+ newlines.append(r'''
+ IF(type STREQUAL STATIC)
+ SET(var ${var} -fPIC)
+ ENDIF(type STREQUAL STATIC)
+ ''')
+ # --
if self.module == "yacs":
newlines.append(r'''
SET(var ${var} -DYACS_PTHREAD)
STRING(REPLACE ".f" ".c" src ${src})
SET(src ${CMAKE_CURRENT_BINARY_DIR}/${src})
SET(output ${src})
+ SET(cmd f2c)
+ IF(NOT WINDOWS)
+ IF(CMAKE_SIZEOF_VOID_P STREQUAL 8)
+ SET(cmd valgrind f2c) # f2c seems to be buggy on 64 bits ... but with valgrind, it works :)
+ ENDIF()
+ ENDIF(NOT WINDOWS)
ADD_CUSTOM_COMMAND(
OUTPUT ${output}
- COMMAND f2c ${input}
+ COMMAND ${cmd} ${input}
MAIN_DEPENDENCY ${input}
)
ELSE(src STREQUAL trte.f)