Skip to content

Commit

Permalink
Making CMake integration easier
Browse files Browse the repository at this point in the history
  • Loading branch information
matajoh committed May 25, 2021
1 parent 4f19e7d commit 33b966f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [2021-05-21 - Version 1.3.1](https://github.com/matajoh/libnpy/releases/tag/v1.3.1)

New Features:
- Updated CMake integration to make the library easier to use via `FetchContent`

## [2021-02-10 - Version 1.3.0](https://github.com/matajoh/libnpy/releases/tag/v1.3.0)

New Features:
Expand Down
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ project( libnpy VERSION ${LIBNPY_VERSION} LANGUAGES CXX)

# -------------------- Options --------------------------------

set( BUILD_DOCUMENTATION_DESC "Specifies whether to build the documentation for the API and XML" )
set( INCLUDE_CSHARP_DESC "Specifies whether to build libnpy with C# bindings" )

set( BUILD_DOCUMENTATION ON CACHE BOOL ${BUILD_DOCUMENTATION_DESC} )
set( INCLUDE_CSHARP ON CACHE BOOL ${INCLUDE_CSHARP_DESC} )
option( BUILD_DOCUMENTATION "Specifies whether to build the documentation for the API and XML" OFF )
option( INCLUDE_CSHARP "Specifies whether to build libnpy with C# bindings" OFF )

# ------------------- Detect the system -----------------------

Expand Down Expand Up @@ -68,7 +65,7 @@ endif()

# -------------------- Find packages --------------------------

if ( WIN32 )
if ( WIN32 AND INCLUDE_CSHARP )
enable_language( CSharp )
else()
set( INCLUDE_CSHARP OFF )
Expand All @@ -80,10 +77,11 @@ if( INCLUDE_CSHARP )
find_package( SWIG REQUIRED )

# Select the .NET architecture
set( CSHARP_PLATFORM_DESC "C# target platform: x86, x64, anycpu, or itanium" )
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set( CSHARP_PLATFORM "x64" CACHE STRING "C# target platform: x86, x64, anycpu, or itanium")
set( CSHARP_PLATFORM "x64" CACHE STRING ${CSHARP_PLATFORM_DESC})
else()
set( CSHARP_PLATFORM "x86" CACHE STRING "C# target platform: x86, x64, anycpu, or itanium")
set( CSHARP_PLATFORM "x86" CACHE STRING ${CSHARP_PLATFORM_DESC})
endif()
endif()

Expand Down
5 changes: 1 addition & 4 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
New Features:
- Support for Unicode string tensors (npy type 'U')

Breaking change:
- `CopyFrom` interface for C# Tensors has been changed to use *Buffer objects
- Updated CMake integration to make the library easier to use via `FetchContent`
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0
1.3.1
2 changes: 1 addition & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY
)

add_custom_target( doc
add_custom_target( npy_doc
ALL
${DOXYGEN_EXECUTABLE}
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
Expand Down
8 changes: 4 additions & 4 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
add_executable( images images.cpp )
target_link_libraries( images npy::npy )
add_executable( npy_images images.cpp )
target_link_libraries( npy_images npy::npy )

if( INCLUDE_CSHARP )
add_executable( images_net images_net.cs )
target_link_libraries( images_net NumpyIO ${SWIG_MODULE_NumpyIONative_REAL_NAME} )
add_executable( npy_images_net images_net.cs )
target_link_libraries( npy_images_net NumpyIO ${SWIG_MODULE_NumpyIONative_REAL_NAME} )
endif()

0 comments on commit 33b966f

Please sign in to comment.