mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
clean up some paths
This commit is contained in:
parent
84a6fdcc14
commit
dfc5983155
@ -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)
|
||||||
|
@ -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)
|
|
||||||
|
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user