From 3117ffcbb40a88e41b2f3d28bc3c60eeb04d7499 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 19 Sep 2012 09:32:13 -0500 Subject: [svn-r22788] HDFFV-8153: Pull POSIX_C_SOURCE define out to separate variable. Use ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) in non-fortran CMakeLists.txt folders Tested: local --- c++/CMakeLists.txt | 5 +++++ config/cmake/ConfigureChecks.cmake | 5 ++++- examples/CMakeLists.txt | 5 +++++ hl/CMakeLists.txt | 5 +++++ perform/CMakeLists.txt | 5 +++++ src/CMakeLists.txt | 5 +++++ test/CMakeLists.txt | 5 +++++ testpar/CMakeLists.txt | 5 +++++ tools/CMakeLists.txt | 5 +++++ tools/lib/CMakeLists.txt | 5 +++++ 10 files changed, 49 insertions(+), 1 deletion(-) diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt index dad98f8..0076335 100644 --- a/c++/CMakeLists.txt +++ b/c++/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_CPP) #----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + +#----------------------------------------------------------------------------- # Shared/Static Libs #----------------------------------------------------------------------------- IF (BUILD_SHARED_LIBS) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index e5669c5..84ee5b3 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -413,6 +413,7 @@ CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" H5_HAVE_NETINET_IN_H) # The linux-lfs option is deprecated. SET (LINUX_LFS 0) +SET (HDF5_EXTRA_C_FLAGS) SET (HDF5_EXTRA_FLAGS) IF (NOT WINDOWS) # Linux Specific flags @@ -422,7 +423,9 @@ IF (NOT WINDOWS) # correctly. # POSIX feature information can be found in the gcc manual at: # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - SET (HDF5_EXTRA_FLAGS -D_POSIX_C_SOURCE=199506L -D_BSD_SOURCE) + SET (HDF5_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=199506L) + SET (HDF5_EXTRA_FLAGS -D_BSD_SOURCE) + OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) IF (HDF5_ENABLE_LARGE_FILE) SET (msg "Performing TEST_LFS_WORKS") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 56206a5..b23c6f8 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_EXAMPLES) #----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + +#----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- SET (examples diff --git a/hl/CMakeLists.txt b/hl/CMakeLists.txt index d1db6ca..e66329e 100644 --- a/hl/CMakeLists.txt +++ b/hl/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_HL C CXX) #----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + +#----------------------------------------------------------------------------- # Shared Libs #----------------------------------------------------------------------------- IF (BUILD_SHARED_LIBS) diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 421caba..4059803 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_PERFORM ) #----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + +#----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ae99dc4..fe42210 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_SRC C CXX) #----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + +#----------------------------------------------------------------------------- # List Source Files #----------------------------------------------------------------------------- SET (H5_SRCS diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 36d6ca4..d6ffe42 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TEST) #----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + +#----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- SET (TEST_LIB_SRCS diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index f42af9f..5d594a6 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -1,6 +1,11 @@ cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TEST_PAR) +#----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR}) INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib ) #----------------------------------------------------------------------------- diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 6cdfcac..b48a1b9 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS) #----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + +#----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_TOOLS_SOURCE_DIR}/lib) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 6d48d5f..0b17320 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -2,6 +2,11 @@ cmake_minimum_required (VERSION 2.8.6) PROJECT (HDF5_TOOLS_LIB) #----------------------------------------------------------------------------- +# Apply Definitions to compiler in this directory and below +#----------------------------------------------------------------------------- +ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS}) + +#----------------------------------------------------------------------------- # Define Sources #----------------------------------------------------------------------------- -- cgit v0.12