Skip to content

Commit

Permalink
Fixes in cmake for Mac OS X.
Browse files Browse the repository at this point in the history
  • Loading branch information
stavrospapadopoulos committed Jan 21, 2017
1 parent a5840d5 commit db6f24c
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 14 deletions.
26 changes: 21 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ cmake_minimum_required(VERSION 2.8)
# Set the cmake Module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")

# Set shared library suffix
if(APPLE)
set(SHARED_LIB_SUFFIX ".dylib")
else()
set(SHARED_LIB_SUFFIX ".so")
endif()

# Only for Mac OS X warnings
if(APPLE)
set(CMAKE_MACOSX_RPATH 1)
endif()

# Default user definitions
set(USE_MPI False CACHE BOOL "Enables MPI")
if(APPLE)
Expand Down Expand Up @@ -65,7 +77,7 @@ find_package(ZSTD REQUIRED)
include_directories(${ZSTD_INCLUDE_DIR})
set(TILEDB_LIB_DEPENDENCIES ${TILEDB_LIB_DEPENDENCIES} ${ZSTD_LIBRARIES})
find_package(OpenSSL REQUIRED)
include_directories(${OpenSSL_INCLUDE_DIR})
include_directories(${OPENSSL_INCLUDE_DIR})
set(TILEDB_LIB_DEPENDENCIES ${TILEDB_LIB_DEPENDENCIES} ${OPENSSL_LIBRARIES})

# Find optional library dependencies
Expand All @@ -91,7 +103,9 @@ include(SetCXX2011Flag)
set(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -g3 -gdwarf-3 -Wall -fvisibility=hidden")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -fvisibility=hidden")
set(CMAKE_CXX_FLAGS_COVERAGE "-DDEBUG -g3 -gdwarf-3 --coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-literal-suffix")
if(NOT APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-literal-suffix")
endif()
if(USE_MPI)
set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
endif()
Expand Down Expand Up @@ -137,9 +151,13 @@ endif()
# Enable testing
enable_testing()

# Add subdirectories
# Build TileDB library
add_subdirectory(core)

# Build examples
add_subdirectory(examples)

# Build unit tests
if(GTEST_FOUND)
add_subdirectory(test)
endif()
Expand All @@ -163,8 +181,6 @@ if(DOXYGEN_FOUND)
)
endif(DOXYGEN_FOUND)



# Uninstall
set(CMD "xargs printf '-- Uninstalling: %s\\\\n' <install_manifest.txt")
add_custom_target(
Expand Down
6 changes: 3 additions & 3 deletions cmake/Modules/FindBLOSC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# Find header files
if(BLOSC_SEARCH_HEADER_PATHS)
find_path(
BLOSC_INCLUDE_DIR lz4.h
BLOSC_INCLUDE_DIR blosc.h
PATHS ${BLOSC_SEARCH_HEADER_PATHS}
NO_DEFAULT_PATH
)
Expand All @@ -43,12 +43,12 @@ endif()
# Find library
if(BLOSC_SEARCH_LIB_PATH)
find_library(
BLOSC_LIBRARIES NAMES libblosc.so
BLOSC_LIBRARIES NAMES libblosc${SHARED_LIB_SUFFIX}
PATHS ${BLOSC_SEARCH_LIB_PATH}$
NO_DEFAULT_PATH
)
else()
find_library(BLOSC_LIBRARIES NAMES libblosc.so)
find_library(BLOSC_LIBRARIES NAMES libblosc${SHARED_LIB_SUFFIX})
endif()

if(BLOSC_INCLUDE_DIR AND BLOSC_LIBRARIES)
Expand Down
4 changes: 2 additions & 2 deletions cmake/Modules/FindZSTD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ endif()
# Find library
if(ZSTD_SEARCH_LIB_PATH)
find_library(
ZSTD_LIBRARIES NAMES libzstd.so
ZSTD_LIBRARIES NAMES libzstd${SHARED_LIB_SUFFIX}
PATHS ${ZSTD_SEARCH_LIB_PATH}$
NO_DEFAULT_PATH
)
else()
find_library(ZSTD_LIBRARIES NAMES libzstd.so)
find_library(ZSTD_LIBRARIES NAMES libzstd${SHARED_LIB_SUFFIX})
endif()

if(ZSTD_INCLUDE_DIR AND ZSTD_LIBRARIES)
Expand Down
3 changes: 3 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ endfunction()
# Get the example sources
file(GLOB TILEDB_EXAMPLE_SOURCES "src/*.cc")

# Include TileDB C API headers
include_directories("${CMAKE_SOURCE_DIR}/core/include/c_api/")

# Initialize name for example binaries
set(EXAMPLE_BINS)

Expand Down
8 changes: 4 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
# Include GTest headers
include_directories(${GTEST_INCLUDE_DIRS})

# Include core header directories
file(GLOB TILEDB_CORE_INCLUDE_DIRS "../core/include/*")
include_directories(${TILEDB_CORE_INCLUDE_DIRS})

# Include test header directories
file(GLOB TILEDB_TEST_INCLUDE_DIRS "include/*")
include_directories(${TILEDB_TEST_INCLUDE_DIRS})

# Include TileDB core header directories
file(GLOB TILEDB_CORE_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/core/include/*")
include_directories(${TILEDB_CORE_INCLUDE_DIRS})

# Get test source files
file(GLOB_RECURSE TILEDB_TEST_SOURCES "src/*.cc")

Expand Down

0 comments on commit db6f24c

Please sign in to comment.