Commit f00eb928 authored by Chris Cantwell's avatar Chris Cantwell

Updated to use CMake for Zlib build.

Explicitly reference ZLIB_LIBRARY in Cmake, rather than the Boost version.
parent d869b035
......@@ -167,10 +167,10 @@ MACRO(ADD_NEKTAR_EXECUTABLE name component sources)
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_ZLIB_LIBRARY}
${ZLIB_LIBRARY}
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
)
ADD_DEPENDENCIES(${name} boost tinyxml zlib)
ADD_DEPENDENCIES(${name} boost tinyxml zlib-1.2.7)
IF( NEKTAR_USE_MPI )
TARGET_LINK_LIBRARIES(${name} ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
......@@ -221,7 +221,8 @@ MACRO(ADD_NEKTAR_LIBRARY name component type)
# NIST Sparse BLAS only static, so link into Nektar libraries directly.
TARGET_LINK_LIBRARIES( ${name} ${NIST_SPARSE_BLAS} ${METIS_LIB})
ADD_DEPENDENCIES(${name} spblastk0.9b modmetis-5.0.2 boost tinyxml zlib)
ADD_DEPENDENCIES(${name} spblastk0.9b modmetis-5.0.2 boost tinyxml
zlib-1.2.7)
SET_PROPERTY(TARGET ${name} PROPERTY FOLDER ${component})
IF (NEKTAR_USE_MPI)
TARGET_LINK_LIBRARIES( ${name} ${GSMPI_LIBRARY} ${XXT_LIBRARY})
......
......@@ -40,10 +40,10 @@ IF (THIRDPARTY_BUILD_BOOST)
INSTALL_COMMAND ""
BUILD_IN_SOURCE 1
)
# If building ThirdParty zlib, force zlib build before boost
IF (THIRDPARTY_BUILD_ZLIB)
ADD_DEPENDENCIES(boost zlib)
ADD_DEPENDENCIES(boost zlib-1.2.7)
ENDIF(THIRDPARTY_BUILD_ZLIB)
# Set up CMake variables
......@@ -95,15 +95,15 @@ ELSE (THIRDPARTY_BUILD_BOOST)
IF (DEFINED TEST_ENV)
SET(Boost_NO_SYSTEM_PATHS ON)
SET(BOOST_ROOT $ENV{BOOST_HOME})
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams zlib date_time
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time
filesystem system program_options regex )
ELSE ()
SET(BOOST_ROOT ${CMAKE_SOURCE_DIR}/ThirdParty/boost)
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams zlib date_time filesystem system program_options regex)
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time filesystem system program_options regex)
SET(BOOST_ROOT ${CMAKE_SOURCE_DIR}/../ThirdParty/boost)
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams zlib date_time filesystem system program_options regex)
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time filesystem system program_options regex)
SET(BOOST_ROOT ${CMAKE_SOURCE_DIR}/ThirdParty/dist)
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams zlib date_time filesystem system program_options regex)
FIND_PACKAGE( Boost QUIET COMPONENTS thread iostreams date_time filesystem system program_options regex)
ENDIF()
ELSE()
FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options regex)
......@@ -129,9 +129,6 @@ ELSE (THIRDPARTY_BUILD_BOOST)
IF (Boost_REGEX_FOUND)
MESSAGE(STATUS "Found Boost regex library: ${Boost_REGEX_LIBRARY}")
ENDIF ()
IF (Boost_ZLIB_FOUND)
MESSAGE(STATUS "-- Found Boost zlib library: ${Boost_ZLIB_LIBRARY}")
ENDIF ()
ENDIF (THIRDPARTY_BUILD_BOOST)
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
......@@ -3,17 +3,16 @@ OPTION(THIRDPARTY_BUILD_ZLIB "Build ZLib library" OFF)
IF (THIRDPARTY_BUILD_ZLIB)
# Build the Zlib library separately
EXTERNALPROJECT_ADD(
zlib
zlib-1.2.7
PREFIX ${TPSRC}
URL ${TPURL}/zlib-1.2.7.tar.gz
URL_MD5 "60df6a37c56e7c1366cca812414f7b85"
DOWNLOAD_DIR ${TPSRC}
CONFIGURE_COMMAND ./configure --shared --prefix=${TPSRC}/dist
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist -DCMAKE_C_FLAGS:STRING=-fPIC ${TPSRC}/src/zlib-1.2.7
)
SET(Boost_ZLIB_LIBRARY z)
SET(Boost_ZLIB_LIBRARY_DEBUG z)
SET(Boost_ZLIB_LIBRARY_RELEASE z)
SET(ZLIB_LIBRARY z)
SET(ZLIB_LIBRARY_DEBUG z)
SET(ZLIB_LIBRARY_RELEASE z)
ELSE (THIRDPARTY_BUILD_ZLIB)
# Attempt to identify Macports libraries, if they exist. This prevents
# cmake warnings later on.
......@@ -29,11 +28,11 @@ ELSE (THIRDPARTY_BUILD_ZLIB)
ENDIF()
ENDIF()
IF (ZLIB_LIBRARY)
SET(Boost_ZLIB_LIBRARY ${ZLIB_LIBRARY})
SET(Boost_ZLIB_LIBRARY_RELEASE ${ZLIB_LIBRARY})
SET(Boost_ZLIB_LIBRARY_DEBUG ${ZLIB_LIBRARY})
ENDIF()
# IF (ZLIB_LIBRARY)
# SET(Boost_ZLIB_LIBRARY ${ZLIB_LIBRARY})
# SET(Boost_ZLIB_LIBRARY_RELEASE ${ZLIB_LIBRARY})
# SET(Boost_ZLIB_LIBRARY_DEBUG ${ZLIB_LIBRARY})
#ENDIF()
IF (ZLIB_FOUND)
MESSAGE(STATUS "Found Zlib library: ${ZLIB_LIBRARY}")
......
......@@ -5,7 +5,7 @@ SET(LinkLibraries
optimized LibUtilities debug LibUtilities-g
optimized ${Boost_THREAD_LIBRARY_RELEASE} debug ${Boost_THREAD_LIBRARY_DEBUG}
optimized ${Boost_IOSTREAMS_LIBRARY_RELEASE} debug ${Boost_IOSTREAMS_LIBRARY_DEBUG}
optimized ${Boost_ZLIB_LIBRARY_RELEASE} debug ${Boost_ZLIB_LIBRARY_DEBUG}
optimized ${ZLIB_LIBRARY_RELEASE} debug ${ZLIB_LIBRARY_DEBUG}
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
)
......
......@@ -6,7 +6,7 @@ SET(LinkLibraries
optimized LibUtilities debug LibUtilities-g
optimized ${Boost_THREAD_LIBRARY_RELEASE} debug ${Boost_THREAD_LIBRARY_DEBUG}
optimized ${Boost_IOSTREAMS_LIBRARY_RELEASE} debug ${Boost_IOSTREAMS_LIBRARY_DEBUG}
optimized ${Boost_ZLIB_LIBRARY_RELEASE} debug ${Boost_ZLIB_LIBRARY_DEBUG}
optimized ${ZLIB_LIBRARY_RELEASE} debug ${ZLIB_LIBRARY_DEBUG}
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
optimized sbtk debug sbtk
)
......
......@@ -6,7 +6,7 @@ SET(LinkLibraries
optimized LibUtilities debug LibUtilities-g
optimized ${Boost_THREAD_LIBRARY_RELEASE} debug ${Boost_THREAD_LIBRARY_DEBUG}
optimized ${Boost_IOSTREAMS_LIBRARY_RELEASE} debug ${Boost_IOSTREAMS_LIBRARY_DEBUG}
optimized ${Boost_ZLIB_LIBRARY_RELEASE} debug ${Boost_ZLIB_LIBRARY_DEBUG}
optimized ${ZLIB_LIBRARY_RELEASE} debug ${ZLIB_LIBRARY_DEBUG}
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
optimized sbtk debug sbtk
)
......
......@@ -6,7 +6,7 @@ SET(LinkLibraries
optimized LibUtilities debug LibUtilities-g
optimized ${Boost_THREAD_LIBRARY_RELEASE} debug ${Boost_THREAD_LIBRARY_DEBUG}
optimized ${Boost_IOSTREAMS_LIBRARY_RELEASE} debug ${Boost_IOSTREAMS_LIBRARY_DEBUG}
optimized ${Boost_ZLIB_LIBRARY_RELEASE} debug ${Boost_ZLIB_LIBRARY_DEBUG}
optimized ${ZLIB_LIBRARY_RELEASE} debug ${ZLIB_LIBRARY_DEBUG}
optimized ${Boost_DATE_TIME_LIBRARY_RELEASE} debug ${Boost_DATE_TIME_LIBRARY_DEBUG}
optimized ${Boost_FILESYSTEM_LIBRARY_RELEASE} debug ${Boost_FILESYSTEM_LIBRARY_DEBUG}
optimized ${Boost_SYSTEM_LIBRARY_RELEASE} debug ${Boost_SYSTEM_LIBRARY_DEBUG}
......
......@@ -14,7 +14,7 @@ MACRO(ADD_SOLVER_EXECUTABLE name component source)
${NEKTAR++_LIBRARIES}
${Boost_THREAD_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_ZLIB_LIBRARY}
${ZLIB_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
......
......@@ -6,7 +6,7 @@ SET(LinkLibraries
optimized LibUtilities debug LibUtilities-g
optimized ${Boost_THREAD_LIBRARY_RELEASE} debug ${Boost_THREAD_LIBRARY_DEBUG}
optimized ${Boost_IOSTREAMS_LIBRARY_RELEASE} debug ${Boost_IOSTREAMS_LIBRARY_DEBUG}
optimized ${Boost_ZLIB_LIBRARY_RELEASE} debug ${Boost_ZLIB_LIBRARY_DEBUG}
optimized ${ZLIB_LIBRARY_RELEASE} debug ${ZLIB_LIBRARY_DEBUG}
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
optimized sbtk debug sbtk
)
......
......@@ -10,7 +10,7 @@ MACRO(ADD_UTILITIES_EXECUTABLE name component source)
${NEKTAR++_LIBRARIES}
${Boost_THREAD_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_ZLIB_LIBRARY}
${ZLIB_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
optimized ${TINYXML_LIB} debug ${TINYXML_LIB}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment