Commit 6aa83276 authored by Berk Onat's avatar Berk Onat

Added UNIX installation options

parent cbbe9860
......@@ -7,7 +7,8 @@ find_package(EXPAT)
find_package(TCL)
include (FindNetCDF.cmake)
set (NETCDF_CXX "YES")
find_package(NetCDF REQUIRED)
#find_package(NetCDF REQUIRED)
find_package(NetCDF)
set(TNG_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../external/tng")
message(TNG_DIR= ${TNG_INSTALL_DIR})
......@@ -54,21 +55,25 @@ endif()
if(LINUX)
if(CMAKE_CXX_COMPILER_ID MATCHES "^.*GNU.*$")
if(ARCH64BIT)
set(TARGET_COPT -fPIC;-m64;-o)
set(TARGET_LOPT -fPIC;-m64;-lstdc++;-o)
set(TARGET_CFLAGS -m64;-O2;-fPIC;-Wall;${CMAKE_C_FLAGS})
set(TARGET_CXXFLG -m64;-O2;-fPIC;-Wall;${CMAKE_CXX_FLAGS})
set(TARGET_COPT -fPIC -m64 -o )
set(TARGET_LOPT -fPIC -m64 -lstdc++ -o )
set(TARGET_CFLAGS -m64 -O2 -fPIC -Wall )
set(TARGET_CXXFLG -m64 -O2 -fPIC -Wall )
#set(TARGET_COPT " -fPIC -m64 -o ")
#set(TARGET_LOPT " -fPIC -m64 -lstdc++ -o ")
#set(TARGET_CFLAGS " -m64 -O2 -fPIC -Wall ${CMAKE_C_FLAGS}")
#set(TARGET_CXXFLG " -m64 -O2 -fPIC -Wall ${CMAKE_CXX_FLAGS}")
else()
set(TARGET_COPT -fPIC;-m32;-o)
set(TARGET_LOPT -fPIC;-m32;-lstdc++;-o)
set(TARGET_CFLAGS -m32;-O2;-fPIC;-Wall;${CMAKE_C_FLAGS})
set(TARGET_CXXFLG -m32;-O2;-fPIC;-Wall;${CMAKE_CXX_FLAGS})
set(TARGET_COPT " -fPIC -m32 -o ")
set(TARGET_LOPT " -fPIC -m32 -lstdc++ -o ")
set(TARGET_CFLAGS " -m32 -O2 -fPIC -Wall ${CMAKE_C_FLAGS}")
set(TARGET_CXXFLG " -m32 -O2 -fPIC -Wall ${CMAKE_CXX_FLAGS}")
endif()
else()
set(TARGET_COPT -o)
set(TARGET_LOPT -o)
set(TARGET_CFLAGS -O2;-Wall;${CMAKE_C_FLAGS})
set(TARGET_CXXFLG -O2;-Wall;${CMAKE_CXX_FLAGS})
set(TARGET_COPT " -o ")
set(TARGET_LOPT " -o ")
set(TARGET_CFLAGS " -O2 -Wall ${CMAKE_C_FLAGS}")
set(TARGET_CXXFLG " -O2 -Wall ${CMAKE_CXX_FLAGS}")
endif()
endif()
......@@ -97,41 +102,74 @@ endif()
if(UNIX)
set(TARGET_DEF "-D")
set(TARGET_SHLD ${CMAKE_CXX_COMPILER} ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
set(TARGET_LIBTOOL libtool;-dynamic)
if(APPLE)
set(TARGET_LIBTOOL libtool;-dynamic)
set(TARGET_NM ${CMAKE_NM};-p)
else()
set(TARGET_LIBTOOL "libtool -dynamic")
set(TARGET_NM "${CMAKE_NM} -p")
endif()
set(TARGET_AR ${CMAKE_AR})
set(TARGET_NM ${CMAKE_NM};-p)
set(TARGET_RANLIB ${CMAKE_RANLIB})
set(TARGET_MOL_LIBS "")
if(TCL_FOUND)
set(TCLLDFLAGS -ltcl;-L${TCL_LIBRARY})
set(TCLINC "-I${TCL_INCLUDE_PATH}")
set(TCLLIB "-L${TCL_LIBRARY}")
set(TARGET_MOL_LIBS ${TARGET_MOL_LIBS} \"TCLLDFLAGS=${TCLLDFLAGS}\";\"TCLINC=${TCLINC}\";\"TCLLIB=${TCLLIB}\";)
if(APPLE)
set(TCLLDFLAGS -ltcl;-L${TCL_LIBRARY})
set(TCLINC "-I${TCL_INCLUDE_PATH}")
set(TCLLIB "-L${TCL_LIBRARY}")
set(TARGET_MOL_LIBS ${TARGET_MOL_LIBS} \"TCLLDFLAGS=${TCLLDFLAGS}\";\"TCLINC=${TCLINC}\";\"TCLLIB=${TCLLIB}\";)
else()
set(TCLLDFLAGS "-ltcl -L${TCL_LIBRARY}")
set(TCLINC "-I${TCL_INCLUDE_PATH}")
set(TCLLIB "-L${TCL_LIBRARY}")
set(TARGET_MOL_LIBS ${TARGET_MOL_LIBS} "\"TCLLDFLAGS=${TCLLDFLAGS}\" \"TCLINC=${TCLINC}\" \"TCLLIB=${TCLLIB}\"")
endif()
message(TCL_FOUND= ${TCL_LIBRARY})
endif()
if(EXPAT_FOUND)
set(EXPATLDFLAGS ${EXPAT_LIBRARIES})
set(EXPATINC "-I${EXPAT_INCLUDE_DIRS}")
set(EXPATLIB "-I${EXPAT_INCLUDE_DIRS}")
set(TARGET_MOL_LIBS ${TARGET_MOL_LIBS} \"EXPATLDFLAGS=${EXPATLDFLAGS}\";\"EXPATINC=${EXPATINC}\";\"EXPATLIB=${EXPATLIB}\";)
if(APPLE)
set(EXPATLDFLAGS ${EXPAT_LIBRARIES})
set(EXPATINC "-I${EXPAT_INCLUDE_DIRS}")
set(EXPATLIB "-I${EXPAT_INCLUDE_DIRS}")
set(TARGET_MOL_LIBS ${TARGET_MOL_LIBS} \"EXPATLDFLAGS=${EXPATLDFLAGS}\";\"EXPATINC=${EXPATINC}\";\"EXPATLIB=${EXPATLIB}\";)
else()
set(EXPATLDFLAGS ${EXPAT_LIBRARIES})
set(EXPATINC "-I${EXPAT_INCLUDE_DIRS}")
set(EXPATLIB "-I${EXPAT_INCLUDE_DIRS}")
set(TARGET_MOL_LIBS ${TARGET_MOL_LIBS} \"EXPATLDFLAGS=${EXPATLDFLAGS}\" \"EXPATINC=${EXPATINC}\" \"EXPATLIB=${EXPATLIB}\")
endif()
message(EXPAT_FOUND= ${EXPAT_LIBRARIES})
endif()
if(NETCDF_FOUND)
set(NETCDFLDFLAGS ${NETCDF_LIBRARIES})
set(NETCDFINC "-I${NETCDF_INCLUDES}")
set(NETCDFLIB "-L${NETCDF_INCLUDES}")
set(TARGET_MOL_LIBS ${TARGET_MOL_LIBS} \"NETCDFLDFLAGS=${NETCDFLDFLAGS}\";\"NETCDFINC=${NETCDFINC}\";\"NETCDFLIB=${NETCDFLIB}\";)
if(APPLE)
set(NETCDFLDFLAGS ${NETCDF_LIBRARIES})
set(NETCDFINC "-I${NETCDF_INCLUDES}")
set(NETCDFLIB "-L${NETCDF_INCLUDES}")
set(TARGET_MOL_LIBS ${TARGET_MOL_LIBS} \"NETCDFLDFLAGS=${NETCDFLDFLAGS}\";\"NETCDFINC=${NETCDFINC}\";\"NETCDFLIB=${NETCDFLIB}\";)
else()
set(NETCDFLDFLAGS ${NETCDF_LIBRARIES})
set(NETCDFINC "-I${NETCDF_INCLUDES}")
set(NETCDFLIB "-L${NETCDF_INCLUDES}")
set(TARGET_MOL_LIBS ${TARGET_MOL_LIBS} \"NETCDFLDFLAGS=${NETCDFLDFLAGS}\" \"NETCDFINC=${NETCDFINC}\" \"NETCDFLIB=${NETCDFLIB}\")
endif()
message(NETCDF_FOUND= ${NETCDF_LIBRARIES})
message(NETCDF_FOUND= ${NETCDF_INCLUDES})
endif()
if(TNGIO_FOUND)
set(TNGIOLDFLAGS ${TNGIO_LIBRARIES})
set(TNGIOINC "-I${TNGIO_INCLUDE_DIRS}")
set(TNGIOLIB "-L${TNGIO_LIBRARY_DIRS}")
set(TARGET_MOL_LIBS ${TARGET_MOL_LIBS} \"TNGLDFLAGS=${TNGIOLDFLAGS}\";\"TNGINC=${TNGIOINC}\";\"TNGLIB=${TNGIOLIB}\";)
if(APPLE)
set(TNGIOLDFLAGS ${TNGIO_LIBRARIES})
set(TNGIOINC "-I${TNGIO_INCLUDE_DIRS}")
set(TNGIOLIB "-L${TNGIO_LIBRARY_DIRS}")
set(TARGET_MOL_LIBS ${TARGET_MOL_LIBS} \"TNGLDFLAGS=${TNGIOLDFLAGS}\";\"TNGINC=${TNGIOINC}\";\"TNGLIB=${TNGIOLIB}\";)
else()
set(TNGIOLDFLAGS ${TNGIO_LIBRARIES})
set(TNGIOINC "-I${TNGIO_INCLUDE_DIRS}")
set(TNGIOLIB "-L${TNGIO_LIBRARY_DIRS}")
set(TARGET_MOL_LIBS ${TARGET_MOL_LIBS} \"TNGLDFLAGS=${TNGIOLDFLAGS}\" \"TNGINC=${TNGIOINC}\" \"TNGLIB=${TNGIOLIB}\")
endif()
message(TNGIO_FOUND= ${TNGIO_LIBRARIES})
endif()
# message(MAKE_COMMAND= "make dynlibs staticlibs bins \"ARCH = ${TARGET_ARCH}\" \"COPTO = ${TARGET_COPT} \" \"LOPTO = ${TARGET_LOPT} \" \"CC = ${CMAKE_C_COMPILER} \" \"CXX = ${CMAKE_CXX_COMPILER} \" \"DEF = ${TARGET_DEF}\" \"CCFLAGS = ${TARGET_CFLAGS} \" \"CXXFLAGS = ${TARGET_CXXFLG} \" \"AR = ${TARGET_AR}\" \"NM = ${TARGET_NM}\" \"RANLIB = ${TARGET_RANLIB}\" \"LIBTOOL = ${TARGET_LIBTOOL} \" ${TARGET_MOL_LIBS}")
message(MAKE_COMMAND= "make dynlibs staticlibs bins \"ARCH = ${TARGET_ARCH}\" \"COPTO = ${TARGET_COPT} \" \"LOPTO = ${TARGET_LOPT} \" \"CC = ${CMAKE_C_COMPILER} \" \"CXX = ${CMAKE_CXX_COMPILER} \" \"DEF = ${TARGET_DEF}\" \"CCFLAGS = ${TARGET_CFLAGS} \" \"CXXFLAGS = ${TARGET_CXXFLG} \" \"AR = ${TARGET_AR}\" \"NM = ${TARGET_NM}\" \"RANLIB = ${TARGET_RANLIB}\" \"LIBTOOL = ${TARGET_LIBTOOL} \" ${TARGET_MOL_LIBS}")
add_custom_command(
OUTPUT ${LIB_MOLFILE_FILES}
COMMAND make dynlibs staticlibs bins \"ARCH = ${TARGET_ARCH}\" \"COPTO = ${TARGET_COPT} \" \"LOPTO = ${TARGET_LOPT} \" \"CC = ${CMAKE_C_COMPILER} \" \"CXX = ${CMAKE_CXX_COMPILER} \" \"DEF = ${TARGET_DEF}\" \"CCFLAGS = ${TARGET_CFLAGS} \" \"CXXFLAGS = ${TARGET_CXXFLG} \" \"AR = ${TARGET_AR}\" \"NM = ${TARGET_NM}\" \"RANLIB = ${TARGET_RANLIB}\" \"LIBTOOL = ${TARGET_LIBTOOL} \" ${TARGET_MOL_LIBS}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment