Skip to content

Commit

Permalink
Code review: rename cython as python (make target and directory
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentRouvreau committed Sep 9, 2019
1 parent dcbdaa0 commit 68753b3
Show file tree
Hide file tree
Showing 122 changed files with 117 additions and 131 deletions.
4 changes: 2 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ build_script:
- cd build
- cmake -G "Visual Studio 15 2017 Win64" %CMAKE_FLAGS% -DCMAKE_TOOLCHAIN_FILE=c:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake ..
- if [%target%]==[Python] (
cd src/cython &
MSBuild Cython.sln /m /p:Configuration=Release /p:Platform=x64 &
cd src/python &
MSBuild Python.sln /m /p:Configuration=Release /p:Platform=x64 &
ctest -j 1 -C Release
) else (
MSBuild GUDHIdev.sln /m /p:Configuration=Release /p:Platform=x64 &
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
cd build;
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_EXAMPLE=OFF -DWITH_GUDHI_UTILITIES=OFF -DWITH_GUDHI_PYTHON=ON -DPython_ADDITIONAL_VERSIONS=3 ..;
make all test sphinx;
cp -R cython/sphinx /tmp/sphinx;
cp -R python/sphinx /tmp/sphinx;
- store_artifacts:
path: /tmp/sphinx
Expand Down
16 changes: 1 addition & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,7 @@
build/

# Generated by Cython
src/cython/gudhi/simplex_tree.cpp
src/cython/gudhi/alpha_complex.cpp
src/cython/gudhi/bottleneck.cpp
src/cython/gudhi/cubical_complex.cpp
src/cython/gudhi/euclidean_strong_witness_complex.cpp
src/cython/gudhi/off_reader.cpp
src/cython/gudhi/periodic_cubical_complex.cpp
src/cython/gudhi/reader_utils.cpp
src/cython/gudhi/rips_complex.cpp
src/cython/gudhi/subsampling.cpp
src/cython/gudhi/euclidean_witness_complex.cpp
src/cython/gudhi/nerve_gic.cpp
src/cython/gudhi/strong_witness_complex.cpp
src/cython/gudhi/tangential_complex.cpp
src/cython/gudhi/witness_complex.cpp
src/python/gudhi/*.cpp

# Generated by tests
data/points/COIL_database/lucky_cat.off_dist
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(GUDHI_MODULES "" CACHE INTERNAL "GUDHI_MODULES")
set(GUDHI_MISSING_MODULES "" CACHE INTERNAL "GUDHI_MISSING_MODULES")

# This variable is used by Cython CMakeLists.txt and by GUDHI_third_party_libraries to know its path
set(GUDHI_CYTHON_PATH "src/cython")
set(GUDHI_PYTHON_PATH "src/python")

# For third parties libraries management - To be done last as CGAL updates CMAKE_MODULE_PATH
include(GUDHI_third_party_libraries NO_POLICY_SCOPE)
Expand Down Expand Up @@ -54,7 +54,7 @@ add_subdirectory(src/GudhUI)

if (WITH_GUDHI_PYTHON)
# specific for cython module
add_subdirectory(${GUDHI_CYTHON_PATH})
add_subdirectory(${GUDHI_PYTHON_PATH})
else()
message("++ Python module will not be compiled because WITH_GUDHI_PYTHON is set to OFF")
set(GUDHI_MISSING_MODULES ${GUDHI_MISSING_MODULES} "python")
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set(GUDHI_MODULES "" CACHE INTERNAL "GUDHI_MODULES")
set(GUDHI_MISSING_MODULES "" CACHE INTERNAL "GUDHI_MISSING_MODULES")

# This variable is used by Cython CMakeLists.txt and by GUDHI_third_party_libraries to know its path
set(GUDHI_CYTHON_PATH "cython")
set(GUDHI_PYTHON_PATH "python")

# For third parties libraries management - To be done last as CGAL updates CMAKE_MODULE_PATH
include(GUDHI_third_party_libraries NO_POLICY_SCOPE)
Expand Down Expand Up @@ -61,7 +61,7 @@ add_subdirectory(GudhUI)

if (WITH_GUDHI_PYTHON)
# specific for cython module
add_subdirectory(${GUDHI_CYTHON_PATH})
add_subdirectory(${GUDHI_PYTHON_PATH})
else()
message("++ Python module will not be compiled because WITH_GUDHI_PYTHON is set to OFF")
set(GUDHI_MISSING_MODULES ${GUDHI_MISSING_MODULES} "python")
Expand Down
2 changes: 1 addition & 1 deletion src/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ EXCLUDE = data/ \
example/ \
GudhUI/ \
cmake/ \
cython/ \
python/ \
README.md

# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
Expand Down
20 changes: 11 additions & 9 deletions src/cmake/modules/GUDHI_third_party_libraries.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,18 @@ function( find_python_module PYTHON_MODULE_NAME )
RESULT_VARIABLE PYTHON_MODULE_RESULT
OUTPUT_VARIABLE PYTHON_MODULE_VERSION
ERROR_VARIABLE PYTHON_MODULE_ERROR)
message ("PYTHON_MODULE_NAME = ${PYTHON_MODULE_NAME}
- PYTHON_MODULE_RESULT = ${PYTHON_MODULE_RESULT}
- PYTHON_MODULE_VERSION = ${PYTHON_MODULE_VERSION}
- PYTHON_MODULE_ERROR = ${PYTHON_MODULE_ERROR}")
if(PYTHON_MODULE_RESULT EQUAL 0)
# Remove carriage return
string(STRIP ${PYTHON_MODULE_VERSION} PYTHON_MODULE_VERSION)
message ("++ Python module ${PYTHON_MODULE_NAME} - Version ${PYTHON_MODULE_VERSION} found")

set(${PYTHON_MODULE_NAME_UP}_VERSION ${PYTHON_MODULE_VERSION} PARENT_SCOPE)
set(${PYTHON_MODULE_NAME_UP}_FOUND TRUE PARENT_SCOPE)
else()
message ("PYTHON_MODULE_NAME = ${PYTHON_MODULE_NAME}
- PYTHON_MODULE_RESULT = ${PYTHON_MODULE_RESULT}
- PYTHON_MODULE_VERSION = ${PYTHON_MODULE_VERSION}
- PYTHON_MODULE_ERROR = ${PYTHON_MODULE_ERROR}")
unset(${PYTHON_MODULE_NAME_UP}_VERSION PARENT_SCOPE)
set(${PYTHON_MODULE_NAME_UP}_FOUND FALSE PARENT_SCOPE)
endif()
Expand All @@ -125,11 +127,11 @@ if( PYTHONINTERP_FOUND )
find_python_module("sphinx")
endif()

if(NOT GUDHI_CYTHON_PATH)
message(FATAL_ERROR "ERROR: GUDHI_CYTHON_PATH is not valid.")
endif(NOT GUDHI_CYTHON_PATH)
if(NOT GUDHI_PYTHON_PATH)
message(FATAL_ERROR "ERROR: GUDHI_PYTHON_PATH is not valid.")
endif(NOT GUDHI_PYTHON_PATH)

option(WITH_GUDHI_CYTHON_RUNTIME_LIBRARY_DIRS "Build with setting runtime_library_dirs. Usefull when setting rpath is not allowed" ON)
option(WITH_GUDHI_PYTHON_RUNTIME_LIBRARY_DIRS "Build with setting runtime_library_dirs. Usefull when setting rpath is not allowed" ON)

if(PYTHONINTERP_FOUND AND CYTHON_FOUND)
if(SPHINX_FOUND)
Expand All @@ -139,7 +141,7 @@ if(PYTHONINTERP_FOUND AND CYTHON_FOUND)
if(NOT SPHINX_PATH)
if(PYTHON_VERSION_MAJOR EQUAL 3)
# In Python3, just hack sphinx-build if it does not exist
set(SPHINX_PATH "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/${GUDHI_CYTHON_PATH}/doc/python3-sphinx-build.py")
set(SPHINX_PATH "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/${GUDHI_PYTHON_PATH}/doc/python3-sphinx-build.py")
endif(PYTHON_VERSION_MAJOR EQUAL 3)
endif(NOT SPHINX_PATH)
endif(SPHINX_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/modules/GUDHI_user_version_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
copy_directory ${CMAKE_SOURCE_DIR}/biblio ${GUDHI_USER_VERSION_DIR}/biblio)
add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
copy_directory ${CMAKE_SOURCE_DIR}/src/cython ${GUDHI_USER_VERSION_DIR}/cython)
copy_directory ${CMAKE_SOURCE_DIR}/${GUDHI_PYTHON_PATH} ${GUDHI_USER_VERSION_DIR}/python)
add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
copy_directory ${CMAKE_SOURCE_DIR}/data ${GUDHI_USER_VERSION_DIR}/data)
add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
Expand Down
Loading

0 comments on commit 68753b3

Please sign in to comment.