Changeset: 2c7f0d2c7233 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2c7f0d2c7233 Added Files: sql/backends/monet5/vaults/bam/bam_config.h.in Modified Files: monetdb_config.h.in sql/backends/monet5/vaults/bam/CMakeLists.txt sql/backends/monet5/vaults/bam/bam_export.c sql/backends/monet5/vaults/bam/bam_wrapper.c sql/backends/monet5/vaults/bam/bam_wrapper.h Branch: cmake-fun Log Message:
Moved samtools/bam include files tests into proper header file. diffs (146 lines): diff --git a/monetdb_config.h.in b/monetdb_config.h.in --- a/monetdb_config.h.in +++ b/monetdb_config.h.in @@ -1,3 +1,10 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. + */ /* monetdb_config.h.in. Generated from CMakeLists.txt */ #ifndef _SEEN_MONETDB_CONFIG_H @@ -100,18 +107,6 @@ /* Define to 1 if you have the `backtrace' function. */ #cmakedefine HAVE_BACKTRACE 1 -/* Define to 1 if you have the <bam/bam.h> header file. */ -#cmakedefine HAVE_BAM_BAM_H 1 - -/* Define to 1 if you have the <bam/bgzf.h> header file. */ -#cmakedefine HAVE_BAM_BGZF_H 1 - -/* Define to 1 if you have the <bam/kstring.h> header file. */ -#cmakedefine HAVE_BAM_KSTRING_H 1 - -/* Define to 1 if you have the <bam/sam.h> header file. */ -#cmakedefine HAVE_BAM_SAM_H 1 - /* Define to 1 if you have the `clock_gettime' function. */ #cmakedefine HAVE_CLOCK_GETTIME 1 @@ -274,18 +269,6 @@ /* Define to 1 if you have the samtools version 0.1.x (providing the bam library) */ #cmakedefine HAVE_SAMTOOLS 1 -/* Define to 1 if you have the <samtools/bam.h> header file. */ -#cmakedefine HAVE_SAMTOOLS_BAM_H 1 - -/* Define to 1 if you have the <samtools/bgzf.h> header file. */ -#cmakedefine HAVE_SAMTOOLS_BGZF_H 1 - -/* Define to 1 if you have the <samtools/kstring.h> header file. */ -#cmakedefine HAVE_SAMTOOLS_KSTRING_H 1 - -/* Define to 1 if you have the <samtools/sam.h> header file. */ -#cmakedefine HAVE_SAMTOOLS_SAM_H 1 - /* Define to 1 if semtimedop exists */ #cmakedefine HAVE_SEMTIMEDOP 1 diff --git a/sql/backends/monet5/vaults/bam/CMakeLists.txt b/sql/backends/monet5/vaults/bam/CMakeLists.txt --- a/sql/backends/monet5/vaults/bam/CMakeLists.txt +++ b/sql/backends/monet5/vaults/bam/CMakeLists.txt @@ -6,15 +6,11 @@ # Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. #]] -if(NOT ${ENABLE_SAMTOOLS} STREQUAL "NO") +if(NOT ${ENABLE_SAMTOOLS} STREQUAL "NO" AND ZLIB_FOUND) cmake_push_check_state() set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};${MATH_LIBRARIES};${THREAD_LIBRARIES};${ZLIB_LIBRARIES};bam") check_include_file("samtools/bam.h" HAVE_SAMTOOLS_BAM_H) - check_include_file("bam/bam.h" HAVE_BAM_BAM_H) check_include_file("samtools/sam.h" HAVE_SAMTOOLS_SAM_H) - check_include_file("bam/sam.h" HAVE_BAM_SAM_H) - check_include_file("samtools/bgzf.h" HAVE_SAMTOOLS_BGZF_H) - check_include_file("bam/bgzf.h" HAVE_BAM_BGZF_H) check_include_file("samtools/kstring.h" HAVE_SAMTOOLS_KSTRING_H) check_include_file("bam/kstring.h" HAVE_BAM_KSTRING_H) check_symbol_exists("bam_header_read" "samtools/bam.h" HAVE_BAM_HEADER_READ) @@ -29,8 +25,9 @@ if(NOT ${ENABLE_SAMTOOLS} STREQUAL "NO") cmake_pop_check_state() endif() if(HAVE_SAMTOOLS) - include_directories(.. ../.. ../../../../include ../../../../common ../../../../storage ../../../../server - ../../../../../monetdb5/modules/atoms ../../../../../monetdb5/modules/kernel + configure_file(bam_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/bam_config.h) + include_directories(${CMAKE_CURRENT_BINARY_DIR} .. ../.. ../../../../include ../../../../common ../../../../storage + ../../../../server ../../../../../monetdb5/modules/atoms ../../../../../monetdb5/modules/kernel ../../../../../monetdb5/mal ../../../../../monetdb5/modules/mal ../../../../../monetdb5/optimizer ../../../../../common/stream ../../../../../common/utils ../../../../../gdk ../../../../../tools/merovingian ../../../../../tools/merovingian/daemon) diff --git a/sql/backends/monet5/vaults/bam/bam_config.h.in b/sql/backends/monet5/vaults/bam/bam_config.h.in new file mode 100644 --- /dev/null +++ b/sql/backends/monet5/vaults/bam/bam_config.h.in @@ -0,0 +1,24 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. + */ + +#ifndef BAM_CONFIG_H +#define BAM_CONFIG_H + +/* Define to 1 if you have the <bam/kstring.h> header file. */ +#cmakedefine HAVE_BAM_KSTRING_H 1 + +/* Define to 1 if you have the <samtools/bam.h> header file. */ +#cmakedefine HAVE_SAMTOOLS_BAM_H 1 + +/* Define to 1 if you have the <samtools/kstring.h> header file. */ +#cmakedefine HAVE_SAMTOOLS_KSTRING_H 1 + +/* Define to 1 if you have the <samtools/sam.h> header file. */ +#cmakedefine HAVE_SAMTOOLS_SAM_H 1 + +#endif //BAM_CONFIG_H diff --git a/sql/backends/monet5/vaults/bam/bam_export.c b/sql/backends/monet5/vaults/bam/bam_export.c --- a/sql/backends/monet5/vaults/bam/bam_export.c +++ b/sql/backends/monet5/vaults/bam/bam_export.c @@ -15,6 +15,7 @@ */ #include "monetdb_config.h" +#include "bam_config.h" #ifdef HAVE_SAMTOOLS_BAM_H #include <samtools/bam.h> diff --git a/sql/backends/monet5/vaults/bam/bam_wrapper.c b/sql/backends/monet5/vaults/bam/bam_wrapper.c --- a/sql/backends/monet5/vaults/bam/bam_wrapper.c +++ b/sql/backends/monet5/vaults/bam/bam_wrapper.c @@ -11,6 +11,7 @@ */ #include "monetdb_config.h" +#include "bam_config.h" #include "mal_exception.h" #include "stream.h" #include "bam_globals.h" diff --git a/sql/backends/monet5/vaults/bam/bam_wrapper.h b/sql/backends/monet5/vaults/bam/bam_wrapper.h --- a/sql/backends/monet5/vaults/bam/bam_wrapper.h +++ b/sql/backends/monet5/vaults/bam/bam_wrapper.h @@ -17,6 +17,7 @@ #define _BAM_WRAPPER_H #include "gdk.h" +#include "bam_config.h" #ifdef HAVE_SAMTOOLS_SAM_H #include <samtools/sam.h> _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list