Moved Linux directives into ifdef

Use INSTALL_ERT to control shared/static library type on non-MSVC
p4#: 21478
This commit is contained in:
Magne Sjaastad 2013-04-29 13:21:36 +02:00
parent ca856f7603
commit 5cc4c9a231

View File

@ -19,13 +19,14 @@ ENABLE_TESTING()
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(ERT_LINUX TRUE )
add_definitions( -DERT_LINUX )
set( CMAKE_C_FLAGS "-g -O2 -Wall -std=gnu99" )
set( CMAKE_CXX_FLAGS "-g -O2 -Wall" )
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(ERT_WINDOWS TRUE)
add_definitions( -DERT_WINDOWS )
endif()
set( CMAKE_C_FLAGS "-g -O2 -Wall -std=gnu99" )
set( CMAKE_CXX_FLAGS "-g -O2 -Wall" )
set( CMAKE_C_FLAGS "-O2" )
set( CMAKE_CXX_FLAGS "-O2" )
endif()
include(cmake/ert_check.cmake)
include(cmake/ert_find.cmake)
@ -39,9 +40,14 @@ if (MSVC)
set( LIBRARY_TYPE STATIC )
set( SHARED_LIB OFF )
else()
if (INSTALL_ERT)
set( LIBRARY_TYPE SHARED )
set( SHARED_LIB ON )
endif()
else()
set( LIBRARY_TYPE STATIC )
set( SHARED_LIB OFF )
endif(INSTALL_ERT)
endif(MSVC)