Skip to content

Commit

Permalink
CMakeLists.txt: Fill in the Windows file information (version, name,
Browse files Browse the repository at this point in the history
copyright, year).

Signed-off-by: Alexandra Trifan <Alexandra.Trifan@analog.com>
  • Loading branch information
AlexandraTrifan authored and pcercuei committed Feb 22, 2018
1 parent 854471e commit 227e067
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 6 deletions.
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ project(libiio C)
set(LIBIIO_VERSION_MAJOR 0)
set(LIBIIO_VERSION_MINOR 14)
set(VERSION "${LIBIIO_VERSION_MAJOR}.${LIBIIO_VERSION_MINOR}")
if (WIN32)
string(TIMESTAMP BUILD_YEAR "%Y")
endif()

# Set the default install path to /usr
if (NOT WIN32 AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
Expand Down Expand Up @@ -303,7 +306,13 @@ if(WITH_TESTS)
add_subdirectory(tests)
endif()

add_library(iio ${LIBIIO_CFILES} ${LIBIIO_HEADERS} ${LIBIIO_EXTRA_HEADERS})
if (WIN32)
set(LIBIIO_ORIGINAL_FILENAME libiio.dll)
set(LIBIIO_RC ${CMAKE_CURRENT_BINARY_DIR}/properties.rc)
configure_file(properties.rc.cmakein ${LIBIIO_RC} @ONLY)
endif()

add_library(iio ${LIBIIO_CFILES} ${LIBIIO_HEADERS} ${LIBIIO_EXTRA_HEADERS} ${LIBIIO_RC})
set_target_properties(iio PROPERTIES
VERSION ${VERSION}
SOVERSION ${LIBIIO_VERSION_MAJOR}
Expand Down
1 change: 1 addition & 0 deletions libiio.iss.cmakein
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ AppPublisher="Analog Devices, Inc."
AppPublisherURL="http://www.analog.com"
AppSupportURL="http://www.analog.com"
AppUpdatesURL="http://www.analog.com"
AppCopyright="Copyright 2015-@BUILD_YEAR@ ADI and other contributors"
CreateAppDir=no
LicenseFile="C:\projects\libiio\COPYING.txt"
OutputBaseFilename=libiio-setup
Expand Down
24 changes: 24 additions & 0 deletions properties.rc.cmakein
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <windows.h>
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
VS_VERSION_INFO VERSIONINFO
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "Analog Devices"
VALUE "FileDescription", "libiio - Library for interface to IIO devices"
VALUE "InternalName", "libiio"
VALUE "LegalCopyright", "Copyright 2015-@BUILD_YEAR@ ADI and other contributors"
VALUE "LegalTrademarks", "http://www.gnu.org/licenses/lgpl-2.1.html"
VALUE "ProductName", "libiio"
VALUE "ProductVersion", "@LIBIIO_VERSION_MAJOR@.@LIBIIO_VERSION_MINOR@-g@LIBIIO_VERSION_GIT@"
VALUE "OriginalFilename", "@LIBIIO_ORIGINAL_FILENAME@"
END
END

BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
15 changes: 10 additions & 5 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ if (MSVC)
set(GETOPT_C_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../deps/wingetopt/src/getopt.c)
endif (MSVC)

add_executable(iio_genxml iio_genxml.c ${GETOPT_C_FILE})
add_executable(iio_info iio_info.c ${GETOPT_C_FILE})
add_executable(iio_attr iio_attr.c ${GETOPT_C_FILE})
add_executable(iio_readdev iio_readdev.c ${GETOPT_C_FILE})
add_executable(iio_reg iio_reg.c ${GETOPT_C_FILE})
if (WIN32)
set(LIBIIO_ORIGINAL_FILENAME )
set(LIBIIO_RC ${CMAKE_CURRENT_BINARY_DIR}/properties.rc)
configure_file(../properties.rc.cmakein ${LIBIIO_RC} @ONLY)
endif()
add_executable(iio_genxml iio_genxml.c ${GETOPT_C_FILE} ${LIBIIO_RC})
add_executable(iio_info iio_info.c ${GETOPT_C_FILE} ${LIBIIO_RC})
add_executable(iio_attr iio_attr.c ${GETOPT_C_FILE} ${LIBIIO_RC})
add_executable(iio_readdev iio_readdev.c ${GETOPT_C_FILE} ${LIBIIO_RC})
add_executable(iio_reg iio_reg.c ${GETOPT_C_FILE} ${LIBIIO_RC})

target_link_libraries(iio_genxml iio)
target_link_libraries(iio_info iio)
Expand Down

0 comments on commit 227e067

Please sign in to comment.