diff --git a/CMakeLists.txt b/CMakeLists.txt index f5dc868c..c8e32915 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,16 +32,8 @@ if(TESTS) endif() if(ARROW) - option(ARROW_INCLUDE_PATH "Include path of Apache Arrow" "") - option(ARROW_LIBRARY_PATH "Library path of Apache Arrow" "") - if(NOT ARROW_INCLUDE_PATH) - message(FATAL_ERROR "Missing Apache Arrow include path (-D ARROW_INCLUDE_PATH).") - elseif(NOT ARROW_LIBRARY_PATH) - message(FATAL_ERROR "Missing Apache Arrow library path (-D ARROW_LIBRARY_PATH).") - else() - add_subdirectory(arrow/xlntarrow) - add_subdirectory(arrow/xlntpyarrow) - endif() + add_subdirectory(arrow/xlntarrow) + add_subdirectory(arrow/xlntpyarrow) endif() add_subdirectory(source) diff --git a/arrow/xlntarrow/CMakeLists.txt b/arrow/xlntarrow/CMakeLists.txt index 78319058..459827c2 100644 --- a/arrow/xlntarrow/CMakeLists.txt +++ b/arrow/xlntarrow/CMakeLists.txt @@ -1,18 +1,30 @@ cmake_minimum_required(VERSION 3.2) project(xlntarrow) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) +option(CONDA_ROOT "Path to Conda directory." "") +if(NOT CONDA_ROOT) + message(FATAL_ERROR "Missing Conda root directory option (-D CONDA_ROOT).") +endif() + set(XLNT_ARROW ${CMAKE_CURRENT_SOURCE_DIR}/xlntarrow.hpp ${CMAKE_CURRENT_SOURCE_DIR}/xlntarrow.cpp) -link_directories(${ARROW_LIBRARY_PATH}) -add_library(xlntarrow SHARED ${XLNT_ARROW}) -target_compile_definitions(xlntarrow PRIVATE XLNT_EXPORT=1) +link_directories(${CONDA_ROOT}/lib) + +if(NOT STATIC) + add_library(xlntarrow SHARED ${XLNT_ARROW}) + target_compile_definitions(xlntarrow PRIVATE XLNT_EXPORT=1) +else() + add_library(xlntarrow STATIC ${XLNT_ARROW}) +endif() + target_link_libraries(xlntarrow PRIVATE xlnt) target_link_libraries(xlntarrow PRIVATE arrow) + target_include_directories(xlntarrow PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -target_include_directories(xlntarrow PRIVATE ${ARROW_INCLUDE_PATH}) -target_include_directories(xlntarrow PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../include) +target_include_directories(xlntarrow PRIVATE ${CONDA_ROOT}/include) + diff --git a/arrow/xlntpyarrow/setup.py.cmake b/arrow/xlntpyarrow/setup.py.cmake index aba74c6c..88660f2c 100644 --- a/arrow/xlntpyarrow/setup.py.cmake +++ b/arrow/xlntpyarrow/setup.py.cmake @@ -12,13 +12,13 @@ if 'CFLAGS' in cfg_vars: cfg_vars['CFLAGS'] = cfg_vars['CFLAGS'].replace('-Wstrict-prototypes', '') project_root = '${CMAKE_SOURCE_DIR}' -conda_root = '${ARROW_INCLUDE_PATH}' +conda_root = '${CONDA_ROOT}' include_dirs = [ os.path.join(project_root, 'include'), os.path.join(project_root, 'arrow/xlntarrow'), os.path.join(project_root, 'arrow/xlntpyarrow'), - conda_root + os.path.join(conda_root, 'include') ] subdirectory = '' @@ -29,7 +29,7 @@ if os.name == 'nt': library_dirs = [ os.path.join(project_root, 'build/arrow/xlntarrow' + subdirectory), os.path.join(project_root, 'build/source' + subdirectory), - os.path.join(conda_root, '../lib') + os.path.join(conda_root, 'lib') ] compile_args = '${CMAKE_CXX_FLAGS}'.split()