Skip to content

Commit

Permalink
added the MacOS paths (#430)
Browse files Browse the repository at this point in the history
* feat: added the MacOS paths in the cmake files of MobilityDB and MEOS.
* fix: Added const in function spanset_compact in meos_internal.h to match

---------

Co-authored-by: Mariana Duarte <marianaduarte@Marianas-MacBook-Pro.local>
  • Loading branch information
marianaGarcez and Mariana Duarte authored Jan 25, 2024
1 parent e28f344 commit a434163
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 17 deletions.
47 changes: 32 additions & 15 deletions meos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,38 @@ target_link_libraries(${MEOS_LIB_NAME} ${GSL_CBLAS_LIBRARY})
# Belongs to MEOS
#--------------------------------

install(
FILES "${CMAKE_BINARY_DIR}/meos_export.h"
DESTINATION "/usr/local/include"
RENAME "meos.h")
install(
FILES "${CMAKE_BINARY_DIR}/meos_internal_export.h"
DESTINATION "/usr/local/include"
RENAME "meos_internal.h")
install(
FILES "${CMAKE_SOURCE_DIR}/meos/include/general/meos_catalog.h"
DESTINATION "/usr/local/include")
install(TARGETS ${MEOS_LIB_NAME} DESTINATION "/usr/local/lib")
message(STATUS "Building MEOS:")
message(STATUS " Library file: '/usr/local/lib'")
message(STATUS " Include file: '/usr/local/include'")
if(APPLE AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
install(FILES "${CMAKE_BINARY_DIR}/meos_export.h"
DESTINATION "/opt/homebrew/include"
RENAME "meos.h")
install(
FILES "${CMAKE_BINARY_DIR}/meos_internal_export.h"
DESTINATION "/opt/homebrew/include"
RENAME "meos_internal.h")
install(
FILES "${CMAKE_SOURCE_DIR}/meos/include/general/meos_catalog.h"
DESTINATION "/opt/homebrew/include")
install(TARGETS ${MEOS_LIB_NAME} DESTINATION "/opt/homebrew/lib")
message(STATUS "Building MEOS:")
message(STATUS " Library file: '/opt/homebrew/lib'")
message(STATUS " Include file: '/opt/homebrew/include'")
else()
install(
FILES "${CMAKE_BINARY_DIR}/meos_export.h"
DESTINATION "/usr/local/include"
RENAME "meos.h")
install(
FILES "${CMAKE_BINARY_DIR}/meos_internal_export.h"
DESTINATION "/usr/local/include"
RENAME "meos_internal.h")
install(
FILES "${CMAKE_SOURCE_DIR}/meos/include/general/meos_catalog.h"
DESTINATION "/usr/local/include")
install(TARGETS ${MEOS_LIB_NAME} DESTINATION "/usr/local/lib")
message(STATUS "Building MEOS:")
message(STATUS " Library file: '/usr/local/lib'")
message(STATUS " Include file: '/usr/local/include'")
endif()

#-----------------------------------------------------------------------------
# Documentation
Expand Down
2 changes: 1 addition & 1 deletion meos/include/meos_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ extern Span *numspan_shift_scale(const Span *s, Datum shift, Datum width, bool h
extern SpanSet *numspanset_shift_scale(const SpanSet *ss, Datum shift, Datum width, bool hasshift, bool haswidth);
extern Set *set_compact(const Set *s);
extern void span_expand(const Span *s1, Span *s2);
extern SpanSet *spanset_compact(SpanSet *ss);
extern SpanSet *spanset_compact(const SpanSet *ss);
extern Set *textcat_textset_text_int(const Set *s, const text *txt, bool invert);
extern void tstzspan_set_datespan(const Span *s1, Span *s2);

Expand Down
9 changes: 8 additions & 1 deletion mobilitydb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,15 @@ endif()
# Build the library
add_library(${MOBILITYDB_LIB_NAME} MODULE ${PROJECT_OBJECTS})
if(APPLE)
set_target_properties(${MOBILITYDB_LIB_NAME} PROPERTIES
If(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
message(STATUS "Building for arm architecture")
set_target_properties(${MOBILITYDB_LIB_NAME} PROPERTIES
LINK_FLAGS "-Wl,-undefined,dynamic_lookup -bundle_loader /opt/homebrew/bin/postgres")
else()
message(STATUS "Building for x86 architecture")
set_target_properties(${MOBILITYDB_LIB_NAME} PROPERTIES
LINK_FLAGS "-Wl,-undefined,dynamic_lookup -bundle_loader /usr/local/bin/postgres")
endif()
endif()

#--------------------------------
Expand Down

0 comments on commit a434163

Please sign in to comment.