Skip to content
Browse files

Move the rectangle-props executable to the bin directory.

  • Loading branch information...
1 parent a46f90b commit d88f017d9c2c9bccd214a299c9ee2365958b8614 @thewtex committed
Showing with 10 additions and 11 deletions.
  1. +4 −1 CMakeLists.txt
  2. +4 −1 bin/CMakeLists.txt
  3. +0 −1 cmake/UseCython.cmake
  4. +1 −1 setup.py
  5. +1 −3 src/CMakeLists.txt
  6. +0 −4 test/rectangle_props_test.py
View
5 CMakeLists.txt
@@ -22,5 +22,8 @@ add_custom_target( ReplicatePythonSourceTree ALL ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
-# Process the CMakeLists.txt in the 'src' directory.
+include_directories( ${CYTHON_CMAKE_EXAMPLE_SOURCE_DIR}/include )
+
+# Process the CMakeLists.txt in the 'src' and 'bin' directory.
add_subdirectory( src )
+add_subdirectory( bin )
View
5 bin/CMakeLists.txt
@@ -1,5 +1,8 @@
+# If the pyx file is a C++ file, we should specify that here.
+set_source_files_properties( ${CYTHON_CMAKE_EXAMPLE_SOURCE_DIR}/src/rectangle.pyx PROPERTIES CYTHON_IS_CXX TRUE )
+
cython_add_standalone_executable( rectangle-props MAIN_MODULE rectangle_props.py
${CYTHON_CMAKE_EXAMPLE_SOURCE_DIR}/src/rectangle.pyx
rectangle_props.py
- ${CYTHON_CMAKE_EXAMPLE_SOURCE_DIR}/Rectangle.cxx
+ ${CYTHON_CMAKE_EXAMPLE_SOURCE_DIR}/src/Rectangle.cxx
)
View
1 cmake/UseCython.cmake
@@ -264,7 +264,6 @@ function( cython_add_standalone_executable _name )
endif()
endforeach()
- message( "pyx_module_sources: ${pyx_module_sources}" )
if( cython_arguments_MAIN_MODULE )
set( main_module ${cython_arguments_MAIN_MODULE} )
endif()
View
2 setup.py
@@ -7,7 +7,7 @@
name = "cythoncmakeexample",
package_dir = {'': 'src'},
data_files = [(get_python_lib(), glob.glob('src/*.so')),
- ('bin', 'bin/rectangle-props')],
+ ('bin', ['bin/rectangle-props'])],
author = 'Matt McCormick',
description = 'Use the CMake build system to make Cython modules.',
license = 'Apache',
View
4 src/CMakeLists.txt
@@ -1,7 +1,5 @@
-include_directories( ${CYTHON_CMAKE_EXAMPLE_SOURCE_DIR}/include )
-
# If the pyx file is a C++ file, we should specify that here.
-set_source_files_properties( rectangle.pyx PROPERTIES CYTHON_IS_CXX TRUE )
+set_source_files_properties( ${CYTHON_CMAKE_EXAMPLE_SOURCE_DIR}/src/rectangle.pyx PROPERTIES CYTHON_IS_CXX TRUE )
# Multi-file cython modules do not appear to be working at the moment.
cython_add_module( rectangle rectangle.pyx Rectangle.cxx )
View
4 test/rectangle_props_test.py
@@ -1,4 +0,0 @@
-from rectangle_props import main
-
-def test_main():
- main(3, 4, 8, 8)

0 comments on commit d88f017

Please sign in to comment.
Something went wrong with that request. Please try again.