Skip to content

Commit

Permalink
Update CMake to latest inc. fix for FetchContent (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF authored Jul 19, 2024
1 parent 629cb21 commit 6961ab8
Show file tree
Hide file tree
Showing 41 changed files with 300 additions and 324 deletions.
44 changes: 19 additions & 25 deletions BLOSC/config/cmake/H5BLOSCMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,19 @@ macro (EXTERNAL_BLOSC_LIBRARY compress_type)
URL_HASH ""
)
endif ()
FetchContent_GetProperties(BLOSC)
if(NOT blosc_POPULATED)
FetchContent_Populate(BLOSC)
set (BUILD_SHARED OFF CACHE BOOL "" FORCE)
set (BUILD_TESTS OFF CACHE BOOL "" FORCE)
set (BUILD_FUZZERS OFF CACHE BOOL "" FORCE)
set (BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE)
set (PREFER_EXTERNAL_SNAPPY OFF CACHE BOOL "" FORCE)
set (PREFER_EXTERNAL_ZLIB OFF CACHE BOOL "" FORCE)
set (PREFER_EXTERNAL_ZSTD OFF CACHE BOOL "" FORCE)
set (DEACTIVATE_SNAPPY ON CACHE BOOL "" FORCE)
set (BLOSC_IS_SUBPROJECT ON CACHE BOOL "" FORCE)
set (BLOSC_INSTALL OFF CACHE BOOL "" FORCE)

add_subdirectory(${blosc_SOURCE_DIR} ${blosc_BINARY_DIR})
endif()
set (BUILD_SHARED OFF CACHE BOOL "" FORCE)
set (BUILD_TESTS OFF CACHE BOOL "" FORCE)
set (BUILD_FUZZERS OFF CACHE BOOL "" FORCE)
set (BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE)
set (PREFER_EXTERNAL_SNAPPY OFF CACHE BOOL "" FORCE)
set (PREFER_EXTERNAL_ZLIB OFF CACHE BOOL "" FORCE)
set (PREFER_EXTERNAL_ZSTD OFF CACHE BOOL "" FORCE)
set (DEACTIVATE_SNAPPY ON CACHE BOOL "" FORCE)
set (BLOSC_IS_SUBPROJECT ON CACHE BOOL "" FORCE)
set (BLOSC_INSTALL OFF CACHE BOOL "" FORCE)

FetchContent_MakeAvailable(BLOSC)

##include (${BINARY_DIR}/${BLOSC_PACKAGE_NAME}${H5BLOSC_PACKAGE_EXT}-targets.cmake)
set (BLOSC_STATIC_LIBRARY "blosc_static")
Expand Down Expand Up @@ -69,23 +66,20 @@ macro (EXTERNAL_BLOSC_ZLIB_LIBRARY compress_type)
FetchContent_Declare (BLOSC_ZLIB
GIT_REPOSITORY ${BLOSC_ZLIB_URL}
GIT_TAG ${BLOSC_ZLIB_BRANCH}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${H5BLOSC_SOURCE_DIR}/config/zlib-CMakeLists.txt
<SOURCE_DIR>/CMakeLists.txt
)
elseif (${compress_type} MATCHES "TGZ")
FetchContent_Declare (BLOSC_ZLIB
URL ${BLOSC_ZLIB_URL}
URL_HASH ""
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
${H5BLOSC_SOURCE_DIR}/config/zlib-CMakeLists.txt
<SOURCE_DIR>/CMakeLists.txt
)
endif ()
FetchContent_GetProperties(BLOSC_ZLIB)
if(NOT blosc_zlib_POPULATED)
FetchContent_Populate(BLOSC_ZLIB)

# Copy an additional/replacement files into the populated source
file(COPY ${H5BLOSC_SOURCE_DIR}/config/zlib-CMakeLists.txt DESTINATION ${blosc_zlib_SOURCE_DIR})
file(RENAME ${blosc_zlib_SOURCE_DIR}/zlib-CMakeLists.txt ${blosc_zlib_SOURCE_DIR}/CMakeLists.txt)

add_subdirectory(${blosc_zlib_SOURCE_DIR} ${blosc_zlib_BINARY_DIR})
endif()
FetchContent_MakeAvailable(BLOSC_ZLIB)

set (BLOSC_ZLIB_STATIC_LIBRARY "zlibstat")
set (BLOSC_ZLIB_LIBRARY ${BLOSC_ZLIB_STATIC_LIBRARY})
Expand Down
8 changes: 4 additions & 4 deletions BLOSC/config/cmake/HDFPluginMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,21 @@ macro (BASIC_SETTINGS varname)
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
endif ()
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common")
endif ()

#-----------------------------------------------------------------------------
# This is in here to help some of the GCC based IDES like Eclipse
# and code blocks parse the compiler errors and warnings better.
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
endif ()
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
endif ()

Expand Down
8 changes: 4 additions & 4 deletions BLOSC/config/cmake/binex/config/cmake/HDFPluginMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ macro (BASIC_SETTINGS varname)
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
endif ()
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common")
endif ()

Expand Down Expand Up @@ -138,10 +138,10 @@ macro (BASIC_SETTINGS varname)
# This is in here to help some of the GCC based IDES like Eclipse
# and code blocks parse the compiler errors and warnings better.
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
endif ()
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
endif ()

Expand Down
2 changes: 1 addition & 1 deletion BLOSC/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ add_definitions (${HDF5_EXTRA_C_FLAGS})
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC OR (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX))
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
add_definitions ("-Wno-incompatible-pointer-types")
endif ()

Expand Down
37 changes: 17 additions & 20 deletions BLOSC2/config/cmake/H5BLOSC2Macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,25 @@ macro (EXTERNAL_BLOSC2_LIBRARY compress_type)
URL_HASH ""
)
endif ()
FetchContent_GetProperties(BLOSC2)
if(NOT blosc2_POPULATED)
FetchContent_Populate(BLOSC2)
set (BUILD_SHARED OFF CACHE BOOL "" FORCE)
set (BUILD_TESTS OFF CACHE BOOL "" FORCE)
set (BUILD_FUZZERS OFF CACHE BOOL "" FORCE)
set (BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE)
# Store the old value of the 'BUILD_EXAMPLES'
set (BUILD_EXAMPLES_OLD ${BUILD_EXAMPLES})
set (BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set (BUILD_PLUGINS OFF CACHE BOOL "" FORCE)
set (BLOSC_IS_SUBPROJECT ON CACHE BOOL "" FORCE)
set (BLOSC_INSTALL OFF CACHE BOOL "" FORCE)

add_subdirectory(${blosc2_SOURCE_DIR} ${blosc2_BINARY_DIR})
if (WIN32 AND CMAKE_C_COMPILER_ID MATCHES "IntelLLVM")
target_compile_options(blosc2_static PRIVATE -Wno-implicit-function-declaration)
endif ()
set (BUILD_SHARED OFF CACHE BOOL "" FORCE)
set (BUILD_TESTS OFF CACHE BOOL "" FORCE)
set (BUILD_FUZZERS OFF CACHE BOOL "" FORCE)
set (BUILD_BENCHMARKS OFF CACHE BOOL "" FORCE)
# Store the old value of the 'BUILD_EXAMPLES'
set (BUILD_EXAMPLES_OLD ${BUILD_EXAMPLES})
set (BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set (BUILD_PLUGINS OFF CACHE BOOL "" FORCE)
set (BLOSC_IS_SUBPROJECT ON CACHE BOOL "" FORCE)
set (BLOSC_INSTALL OFF CACHE BOOL "" FORCE)

# Restore the old value of the parameter
set (BUILD_EXAMPLES ${BUILD_EXAMPLES_OLD} CACHE BOOL "Build EXAMPLES" FORCE)
endif()
FetchContent_MakeAvailable(BLOSC2)
if (WIN32 AND CMAKE_C_COMPILER_ID MATCHES "IntelLLVM")
target_compile_options(blosc2_static PRIVATE -Wno-implicit-function-declaration)
endif ()

# Restore the old value of the parameter
set (BUILD_EXAMPLES ${BUILD_EXAMPLES_OLD} CACHE BOOL "Build EXAMPLES" FORCE)

##include (${BINARY_DIR}/${BLOSC2_PACKAGE_NAME}${H5BLOSC2_PACKAGE_EXT}-targets.cmake)
set (BLOSC2_STATIC_LIBRARY "blosc2_static")
Expand Down
8 changes: 4 additions & 4 deletions BLOSC2/config/cmake/HDFPluginMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,21 @@ macro (BASIC_SETTINGS varname)
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
endif ()
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common")
endif ()

#-----------------------------------------------------------------------------
# This is in here to help some of the GCC based IDES like Eclipse
# and code blocks parse the compiler errors and warnings better.
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
endif ()
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
endif ()

Expand Down
8 changes: 4 additions & 4 deletions BLOSC2/config/cmake/binex/config/cmake/HDFPluginMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ macro (BASIC_SETTINGS varname)
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
endif ()
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common")
endif ()

Expand Down Expand Up @@ -138,10 +138,10 @@ macro (BASIC_SETTINGS varname)
# This is in here to help some of the GCC based IDES like Eclipse
# and code blocks parse the compiler errors and warnings better.
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
endif ()
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
endif ()

Expand Down
37 changes: 14 additions & 23 deletions BSHUF/config/cmake/H5BSHUFMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,22 @@ macro (EXTERNAL_BSHUF_LIBRARY compress_type)
URL_HASH ""
)
endif ()
FetchContent_GetProperties(BSHUF)
if(NOT bshuf_POPULATED)
FetchContent_Populate(BSHUF)

# Store the old value of the 'BUILD_SHARED_LIBS'
set (BUILD_SHARED_LIBS_OLD ${BUILD_SHARED_LIBS})
# Make subproject to use 'BUILD_SHARED_LIBS=OFF' setting.
set (BUILD_SHARED_LIBS OFF CACHE INTERNAL "Build SHARED libraries" FORCE)
# Store the old value of the 'H5PL_BUILD_TESTING'
set (H5PL_BUILD_TESTING_OLD ${H5PL_BUILD_TESTING})
# Make subproject to use 'H5PL_BUILD_TESTING=OFF' setting.
set (H5PL_BUILD_TESTING OFF CACHE INTERNAL "Build Unit Testing" FORCE)
# Store the old value of the 'BUILD_SHARED_LIBS'
set (BUILD_SHARED_LIBS_OLD ${BUILD_SHARED_LIBS})
# Make subproject to use 'BUILD_SHARED_LIBS=OFF' setting.
set (BUILD_SHARED_LIBS OFF CACHE INTERNAL "Build SHARED libraries" FORCE)
# Store the old value of the 'H5PL_BUILD_TESTING'
set (H5PL_BUILD_TESTING_OLD ${H5PL_BUILD_TESTING})
# Make subproject to use 'H5PL_BUILD_TESTING=OFF' setting.
set (H5PL_BUILD_TESTING OFF CACHE INTERNAL "Build Unit Testing" FORCE)

add_subdirectory(${bshuf_SOURCE_DIR} ${bshuf_BINARY_DIR})
FetchContent_MakeAvailable(BSHUF)

# Restore the old value of the parameter
set (H5PL_BUILD_TESTING ${H5PL_BUILD_TESTING_OLD} CACHE BOOL "Build Unit Testing" FORCE)
# Restore the old value of the parameter
set (BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_OLD} CACHE BOOL "Type of libraries to build" FORCE)
endif()
# Restore the old value of the parameter
set (H5PL_BUILD_TESTING ${H5PL_BUILD_TESTING_OLD} CACHE BOOL "Build Unit Testing" FORCE)
# Restore the old value of the parameter
set (BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_OLD} CACHE BOOL "Type of libraries to build" FORCE)

# include (${BINARY_DIR}/BSHUF-targets.cmake)
set (BSHUF_LIBRARY "bshuf")
Expand Down Expand Up @@ -80,12 +76,7 @@ macro (EXTERNAL_LZ4_LIBRARY compress_type)
URL_HASH ""
)
endif ()
FetchContent_GetProperties(LZ4)
if(NOT lz4_POPULATED)
FetchContent_Populate(LZ4)

add_subdirectory(${lz4_SOURCE_DIR} ${lz4_BINARY_DIR})
endif()
FetchContent_MakeAvailable(LZ4)

# include (${BINARY_DIR}/LZ4-targets.cmake)
set (LZ4_LIBRARY "lz4")
Expand Down
8 changes: 4 additions & 4 deletions BSHUF/config/cmake/HDFPluginMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,21 @@ macro (BASIC_SETTINGS varname)
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
endif ()
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common")
endif ()

#-----------------------------------------------------------------------------
# This is in here to help some of the GCC based IDES like Eclipse
# and code blocks parse the compiler errors and warnings better.
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
endif ()
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
endif ()

Expand Down
4 changes: 3 additions & 1 deletion BSHUF/config/cmake/binex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ endif ()
#-----------------------------------------------------------------------------
# Build examples
#-----------------------------------------------------------------------------
add_subdirectory (example)
if (H5PL_BUILD_EXAMPLES)
add_subdirectory (example)
endif ()
8 changes: 4 additions & 4 deletions BSHUF/config/cmake/binex/config/cmake/HDFPluginMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ macro (BASIC_SETTINGS varname)
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
endif ()
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common")
endif ()

Expand Down Expand Up @@ -138,10 +138,10 @@ macro (BASIC_SETTINGS varname)
# This is in here to help some of the GCC based IDES like Eclipse
# and code blocks parse the compiler errors and warnings better.
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
endif ()
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
endif ()

Expand Down
8 changes: 4 additions & 4 deletions BZIP2/config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,21 @@ endif ()
#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
endif ()
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_LOADED)
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -fomit-frame-pointer -finline-functions -fno-common")
endif ()

#-----------------------------------------------------------------------------
# This is in here to help some of the GCC based IDES like Eclipse
# and code blocks parse the compiler errors and warnings better.
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
endif ()
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_LOADED)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
endif ()

Expand Down
Loading

0 comments on commit 6961ab8

Please sign in to comment.