[Kst] branches/work/kst/portto4/kst/cmake

Peter Kümmel syntheticpp at gmx.net
Mon Dec 6 18:50:37 CET 2010


SVN commit 1204311 by kuemmel:

cmake: fix pkg support

 M  +7 -6      modules/FindGsl.cmake  
 M  +6 -2      modules/FindNetcdf.cmake  
 M  +3 -2      modules/KstMacros.cmake  
 M  +5 -1      src/datasources/CMakeLists.txt  


--- branches/work/kst/portto4/kst/cmake/modules/FindGsl.cmake #1204310:1204311
@@ -1,9 +1,11 @@
 
 include(FindPkgConfig)
 
-pkg_check_modules(GSL QUIET)
+pkg_check_modules(GSL gsl)
 
-if(NOT GSL_INCLUDEDIR AND NOT GSL_LIBRARIES)
+if(GSL_INCLUDEDIR AND GSL_LIBRARIES)
+	set(GSL_LIBRARY -L${GSL_LIBRARY_DIRS} ${GSL_LIBRARIES})
+else()
 	set(GSL_INCLUDEDIR GSL_INCLUDEDIR-NOTFOUND CACHE STRING "" FORCE)
 	FIND_PATH(GSL_INCLUDEDIR gsl_version.h
 		HINTS
@@ -11,7 +13,7 @@
 		PATH_SUFFIXES include/gsl include
 		PATHS
 		)
-	FIND_LIBRARY(GSL_LIBRARY_C gsl 
+	FIND_LIBRARY(GSL_LIBRARIES gsl 
 		HINTS
 		ENV GSL_DIR
 		PATH_SUFFIXES lib
@@ -20,10 +22,9 @@
 endif()
 
 #message(STATUS "GSL: ${GSL_INCLUDEDIR}")
-#message(STATUS "GSL: ${GSL_LIBRARY}")
-IF(GSL_INCLUDEDIR AND GSL_LIBRARY)
+#message(STATUS "GSL: ${GSL_LIBRARIES}")
+IF(GSL_INCLUDEDIR AND GSL_LIBRARIES)
 	MESSAGE(STATUS "Gsl found at ${GSL_INCLUDEDIR}")
-    SET(GSL_LIBRARIES ${GSL_LIBRARY_C})
 	SET(GSL_INCLUDE_DIR ${GSL_INCLUDEDIR} ${GSL_INCLUDEDIR}/..)
     if (UNIX)
 		SET(GSL_LIBRARIES ${GSL_LIBRARIES} m)
--- branches/work/kst/portto4/kst/cmake/modules/FindNetcdf.cmake #1204310:1204311
@@ -1,9 +1,13 @@
 
 include(FindPkgConfig)
 
-pkg_check_modules(NETCDF QUIET)
+pkg_check_modules(NETCDF netcdf)
 
-if(NOT NETCDF_INCLUDEDIR AND NOT NETCDF_LIBRARIES)
+if(NETCDF_INCLUDEDIR AND NETCDF_LIBRARIES)
+	FIND_LIBRARY(NETCDF_LIBRARY_CPP netcdf_c++ 
+		HINTS ${NETCDF_LIBRARY_DIRS})	
+	set(NETCDF_LIBRARY_C -L${NETCDF_LIBRARY_DIRS} ${NETCDF_LIBRARIES})
+else()
 	set(NETCDF_INCLUDEDIR NETCDF_INCLUDEDIR-NOTFOUND CACHE STRING "" FORCE)
 	FIND_PATH(NETCDF_INCLUDEDIR netcdf.h
 		HINTS
--- branches/work/kst/portto4/kst/cmake/modules/KstMacros.cmake #1204310:1204311
@@ -46,7 +46,7 @@
 	string(TOUPPER BUILD_${kst_name} _build_macro)
 	add_definitions(-D${_build_macro})
 	if(kst_merge_files)
-		set(merge_rebuild 1)
+		set(merge_rebuild 0)
 		foreach(_it ${kst_${kst_name}_dont_merge})
 			list(REMOVE_ITEM kst_${kst_name}_sources ${_it})
 		endforeach()
@@ -67,11 +67,12 @@
 	include_directories(${CMAKE_BINARY_DIR}/${dir})
 	kst_include_directories(kstcore kstmath kstwidgets)
 	set(kst_plugin_dir ${dir})
+	set(kst_plugin_prefix ${ARGN})
 endmacro()
 
 
 macro(kst_add_plugin folder name)
-	set(_name kstplugin_${folder}_${name})
+	set(_name kstplugin_${kst_plugin_prefix}_${folder}_${name})
 	string(REPLACE . _  _name ${_name})
 	string(REPLACE / _  _name ${_name})
 	string(REPLACE __ _ _name ${_name})
--- branches/work/kst/portto4/kst/cmake/src/datasources/CMakeLists.txt #1204310:1204311
@@ -1,7 +1,11 @@
 
 
-kst_init_plugin(src/datasources)
+kst_init_plugin(src/datasources datasource)
 
+if(MSVC)
+	add_definitions(-DKST_USE_KST_ATOF)
+endif()
+
 kst_add_plugin(. ascii)
 kst_add_plugin(. qimagesource)
 kst_add_plugin(. sampledatasource)


More information about the Kst mailing list