[Kst] branches/work/kst/portto4/kst
Peter Kümmel
syntheticpp at gmx.net
Fri Jan 14 15:22:42 CET 2011
SVN commit 1214396 by kuemmel:
also build netcdf 4.1.1 with msvc
M +23 -9 cmake/modules/FindNetcdf.cmake
M +18 -1 misc/netcdf-windows/CMakeLists.txt
--- branches/work/kst/portto4/kst/cmake/modules/FindNetcdf.cmake #1214395:1214396
@@ -17,20 +17,34 @@
~/Library/Frameworks
/Library/Frameworks
)
- FIND_LIBRARY(NETCDF_LIBRARY_C netcdf
+
+ macro(find_netcdf_lib var libname)
+ FIND_LIBRARY(${var} ${libname}
HINTS
ENV NETCDF_DIR
PATH_SUFFIXES lib
- PATHS
- )
- FIND_LIBRARY(NETCDF_LIBRARY_CPP netcdf_c++
- HINTS
- ENV NETCDF_DIR
- PATH_SUFFIXES lib
- PATHS
- )
+ PATHS)
+ endmacro()
+
+ find_netcdf_lib(netcdf_c netcdf)
+ find_netcdf_lib(netcdf_c_debug netcdfd)
+ find_netcdf_lib(netcdf_cpp netcdf_c++)
+ find_netcdf_lib(netcdf_cpp_debug netcdf_c++d)
+
+ if(netcdf_c AND netcdf_c_debug)
+ set(NETCDF_LIBRARY_C optimized ${netcdf_c} debug ${netcdf_c_debug})
endif()
+ if(netcdf_cpp AND netcdf_cpp_debug)
+ set(NETCDF_LIBRARY_CPP optimized ${netcdf_cpp} debug ${netcdf_cpp_debug})
+ endif()
+ if(NOT MSVC)
+ # only msvc needs debug and release
+ set(NETCDF_LIBRARY_C ${netcdf_c})
+ set(NETCDF_LIBRARY_CPP ${netcdf_cpp})
+ endif()
+endif()
+
#message(STATUS "NETCDF: ${NETCDF_INCLUDEDIR}")
#message(STATUS "NETCDF: ${NETCDF_LIBRARY_C}")
#message(STATUS "NETCDF: ${NETCDF_LIBRARY_CPP}")
--- branches/work/kst/portto4/kst/misc/netcdf-windows/CMakeLists.txt #1214395:1214396
@@ -1,10 +1,27 @@
-cmake_minimum_required(VERSION 2.6.4)
+cmake_minimum_required(VERSION 2.8)
project( netcdf)
+if(netcdf_sources)
+ set(TOP_DIR ${netcdf_sources})
+else()
set (TOP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
+endif()
+if(netcdf_install_prefix)
+ set(CMAKE_INSTALL_PREFIX ${netcdf_install_prefix} CACHE PATH "User's choice for install prefix" FORCE)
+ set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+endif()
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/INSTALLED CACHE PATH "Kst's default install prefix" FORCE)
+endif()
+
+message(STATUS)
+message(STATUS "Using netCDF soures from: ${TOP_DIR}")
+message(STATUS "Installing netCDF at : ${CMAKE_INSTALL_PREFIX}")
+message(STATUS)
+
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DNOMINMAX)
More information about the Kst
mailing list