Skip to content

Commit e40db08

Browse files
authored
Making CMake integration easier (#22)
1 parent 4f19e7d commit e40db08

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [2021-05-21 - Version 1.3.1](https://github.com/matajoh/libnpy/releases/tag/v1.3.1)
4+
5+
New Features:
6+
- Updated CMake integration to make the library easier to use via `FetchContent`
7+
38
## [2021-02-10 - Version 1.3.0](https://github.com/matajoh/libnpy/releases/tag/v1.3.0)
49

510
New Features:

CMakeLists.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@ project( libnpy VERSION ${LIBNPY_VERSION} LANGUAGES CXX)
2020

2121
# -------------------- Options --------------------------------
2222

23-
set( BUILD_DOCUMENTATION_DESC "Specifies whether to build the documentation for the API and XML" )
24-
set( INCLUDE_CSHARP_DESC "Specifies whether to build libnpy with C# bindings" )
25-
26-
set( BUILD_DOCUMENTATION ON CACHE BOOL ${BUILD_DOCUMENTATION_DESC} )
27-
set( INCLUDE_CSHARP ON CACHE BOOL ${INCLUDE_CSHARP_DESC} )
23+
option( BUILD_DOCUMENTATION "Specifies whether to build the documentation for the API and XML" OFF )
24+
option( INCLUDE_CSHARP "Specifies whether to build libnpy with C# bindings" OFF )
2825

2926
# ------------------- Detect the system -----------------------
3027

@@ -68,7 +65,7 @@ endif()
6865

6966
# -------------------- Find packages --------------------------
7067

71-
if ( WIN32 )
68+
if ( WIN32 AND INCLUDE_CSHARP )
7269
enable_language( CSharp )
7370
else()
7471
set( INCLUDE_CSHARP OFF )
@@ -80,10 +77,11 @@ if( INCLUDE_CSHARP )
8077
find_package( SWIG REQUIRED )
8178

8279
# Select the .NET architecture
80+
set( CSHARP_PLATFORM_DESC "C# target platform: x86, x64, anycpu, or itanium" )
8381
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
84-
set( CSHARP_PLATFORM "x64" CACHE STRING "C# target platform: x86, x64, anycpu, or itanium")
82+
set( CSHARP_PLATFORM "x64" CACHE STRING ${CSHARP_PLATFORM_DESC})
8583
else()
86-
set( CSHARP_PLATFORM "x86" CACHE STRING "C# target platform: x86, x64, anycpu, or itanium")
84+
set( CSHARP_PLATFORM "x86" CACHE STRING ${CSHARP_PLATFORM_DESC})
8785
endif()
8886
endif()
8987

RELEASE_NOTES

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
New Features:
2-
- Support for Unicode string tensors (npy type 'U')
3-
4-
Breaking change:
5-
- `CopyFrom` interface for C# Tensors has been changed to use *Buffer objects
2+
- Updated CMake integration to make the library easier to use via `FetchContent`

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.0
1+
1.3.1

doc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ configure_file(
1313
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY
1414
)
1515

16-
add_custom_target( doc
16+
add_custom_target( npy_doc
1717
ALL
1818
${DOXYGEN_EXECUTABLE}
1919
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile

samples/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
add_executable( images images.cpp )
2-
target_link_libraries( images npy::npy )
1+
add_executable( npy_images images.cpp )
2+
target_link_libraries( npy_images npy::npy )
33

44
if( INCLUDE_CSHARP )
5-
add_executable( images_net images_net.cs )
6-
target_link_libraries( images_net NumpyIO ${SWIG_MODULE_NumpyIONative_REAL_NAME} )
5+
add_executable( npy_images_net images_net.cs )
6+
target_link_libraries( npy_images_net NumpyIO ${SWIG_MODULE_NumpyIONative_REAL_NAME} )
77
endif()

0 commit comments

Comments
 (0)