From 641a70b7e0e9c7516c830f309d93c456a546e385 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 4 Feb 2011 15:07:30 -0500 Subject: [svn-r20043] Add option to build static executables on non-windows machines --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5685cc..7dd9551 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -251,6 +251,17 @@ ELSE (BUILD_SHARED_LIBS) ENDIF (BUILD_SHARED_LIBS) #----------------------------------------------------------------------------- +# Option to Build Static executables +#----------------------------------------------------------------------------- +OPTION (BUILD_STATIC_EXECS "Build Static Executabless" OFF) +IF (BUILD_STATIC_EXECS) + IF (NOT WIN32) + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static") + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") + ENDIF (NOT WIN32) +ENDIF (BUILD_STATIC_EXECS) + +#----------------------------------------------------------------------------- # Option to use code coverage #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_COVERAGE "Enable code coverage for Libraries and Programs" OFF) -- cgit v0.12