1
- # Copyright 2014 Cloudera, Inc.
1
+ # Assembled from BSD/MIT/Apache-licensed code from a variety of copyright
2
+ # holders, including at least
2
3
#
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
4
+ # Copyright 2012-25 Cloudera, Inc.
5
+ # Copyright (C) 2011-15 DyND Developers
6
+ # Copyright (C) 2012-15 Continuum Analytics, Inc.
14
7
15
8
cmake_minimum_required (VERSION 2.7 )
16
9
@@ -518,6 +511,7 @@ include_directories(SYSTEM
518
511
${GFLAGS_INCLUDE_DIR}
519
512
${NUMPY_INCLUDE_DIRS}
520
513
${PYTHON_INCLUDE_DIRS}
514
+ pandas/
521
515
src )
522
516
523
517
############################################################
@@ -572,9 +566,8 @@ endif (UNIX)
572
566
add_subdirectory(src/pandas)
573
567
add_subdirectory(src/pandas/util)
574
568
575
- # NumPy shared library must be manually imported / linked
569
+ # Python and NumPy shared libraries must be manually imported / linked
576
570
set(LINK_LIBS
577
- python
578
571
)
579
572
580
573
add_library(pandas SHARED
@@ -584,3 +577,49 @@ set_target_properties(pandas PROPERTIES LINKER_LANGUAGE CXX)
584
577
585
578
# install(TARGETS pandas
586
579
# LIBRARY DESTINATION lib)
580
+
581
+ ############################################################
582
+ # Setup and build Cython modules
583
+ ############################################################
584
+
585
+ foreach(pyx_api_file
586
+ pandas/native.pyx)
587
+ set_source_files_properties(${pyx_api_file} PROPERTIES CYTHON_API 1)
588
+ endforeach(pyx_api_file)
589
+
590
+ foreach(module native)
591
+ string(REPLACE " . " " ; " directories ${module} )
592
+ list(GET directories -1 module_name)
593
+ list(REMOVE_AT directories -1)
594
+
595
+ string(REPLACE " . " " / " module_root " ${module} ")
596
+ set(module_SRC pandas/${module_root} .pyx)
597
+ set_source_files_properties(${module_SRC} PROPERTIES CYTHON_IS_CXX 1)
598
+
599
+ cython_add_module(${module_name}
600
+ ${module_name} _pyx
601
+ ${module_name} _output
602
+ ${module_SRC} )
603
+
604
+ if (directories)
605
+ string(REPLACE " ; " " / " module_output_directory ${directories} )
606
+ set_target_properties(${module_name} PROPERTIES
607
+ LIBRARY_OUTPUT_DIRECTORY ${module_output_directory} )
608
+ endif()
609
+
610
+ if(APPLE)
611
+ set(module_install_rpath " @loader_path ")
612
+ else()
613
+ set(module_install_rpath " $ORIGIN ")
614
+ endif()
615
+ list(LENGTH directories i)
616
+ while(${i} GREATER 0)
617
+ set(module_install_rpath " ${module_install_rpath} /.. ")
618
+ math(EXPR i " ${i} - 1 " )
619
+ endwhile(${i} GREATER 0)
620
+ set_target_properties(${module_name} PROPERTIES
621
+ INSTALL_RPATH ${module_install_rpath} )
622
+ target_link_libraries(${module_name} pandas)
623
+ endforeach(module)
624
+
625
+ add_dependencies(pandas native_pyx)
0 commit comments