clean up some paths

This commit is contained in:
Thomas Fussell 2017-07-08 21:18:46 -07:00
parent 84a6fdcc14
commit dfc5983155
3 changed files with 23 additions and 19 deletions

View File

@ -32,16 +32,8 @@ if(TESTS)
endif() endif()
if(ARROW) if(ARROW)
option(ARROW_INCLUDE_PATH "Include path of Apache Arrow" "") add_subdirectory(arrow/xlntarrow)
option(ARROW_LIBRARY_PATH "Library path of Apache Arrow" "") add_subdirectory(arrow/xlntpyarrow)
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()
endif() endif()
add_subdirectory(source) add_subdirectory(source)

View File

@ -1,18 +1,30 @@
cmake_minimum_required(VERSION 3.2) cmake_minimum_required(VERSION 3.2)
project(xlntarrow) project(xlntarrow)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) 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 set(XLNT_ARROW
${CMAKE_CURRENT_SOURCE_DIR}/xlntarrow.hpp ${CMAKE_CURRENT_SOURCE_DIR}/xlntarrow.hpp
${CMAKE_CURRENT_SOURCE_DIR}/xlntarrow.cpp) ${CMAKE_CURRENT_SOURCE_DIR}/xlntarrow.cpp)
link_directories(${ARROW_LIBRARY_PATH}) link_directories(${CONDA_ROOT}/lib)
add_library(xlntarrow SHARED ${XLNT_ARROW})
target_compile_definitions(xlntarrow PRIVATE XLNT_EXPORT=1) 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 xlnt)
target_link_libraries(xlntarrow PRIVATE arrow) target_link_libraries(xlntarrow PRIVATE arrow)
target_include_directories(xlntarrow PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(xlntarrow PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(xlntarrow PRIVATE ${ARROW_INCLUDE_PATH}) target_include_directories(xlntarrow PRIVATE ${CONDA_ROOT}/include)
target_include_directories(xlntarrow PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../include)

View File

@ -12,13 +12,13 @@ if 'CFLAGS' in cfg_vars:
cfg_vars['CFLAGS'] = cfg_vars['CFLAGS'].replace('-Wstrict-prototypes', '') cfg_vars['CFLAGS'] = cfg_vars['CFLAGS'].replace('-Wstrict-prototypes', '')
project_root = '${CMAKE_SOURCE_DIR}' project_root = '${CMAKE_SOURCE_DIR}'
conda_root = '${ARROW_INCLUDE_PATH}' conda_root = '${CONDA_ROOT}'
include_dirs = [ include_dirs = [
os.path.join(project_root, 'include'), os.path.join(project_root, 'include'),
os.path.join(project_root, 'arrow/xlntarrow'), os.path.join(project_root, 'arrow/xlntarrow'),
os.path.join(project_root, 'arrow/xlntpyarrow'), os.path.join(project_root, 'arrow/xlntpyarrow'),
conda_root os.path.join(conda_root, 'include')
] ]
subdirectory = '' subdirectory = ''
@ -29,7 +29,7 @@ if os.name == 'nt':
library_dirs = [ library_dirs = [
os.path.join(project_root, 'build/arrow/xlntarrow' + subdirectory), os.path.join(project_root, 'build/arrow/xlntarrow' + subdirectory),
os.path.join(project_root, 'build/source' + 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() compile_args = '${CMAKE_CXX_FLAGS}'.split()