[CMAKE] Set VERSION to use @VERSION@ in input file of config_file
authorWook Song <wook16.song@samsung.com>
Wed, 24 Oct 2018 04:21:12 +0000 (13:21 +0900)
committerMyungJoo Ham <myungjoo.ham@gmail.com>
Wed, 24 Oct 2018 05:22:06 +0000 (14:22 +0900)
In order to reference variable values using '@VAR@' forms, VAR should be
defined using the 'set' cmake command. However, 'instead of 'VERSION',
since '-DVERSION' is defined using 'add_definitions', @VERSION@ could
not be properly substitued. As a result, the 'Version' field in the
pkg-config file for nnstreamer only contains a white space. This patch
fixes this issue.

Signed-off-by: Wook Song <wook16.song@samsung.com>
CMakeLists.txt

index cec8aa6..e096631 100644 (file)
@@ -14,7 +14,8 @@ ELSE(SINGLE_BINARY)
        MESSAGE(STATUS "The nnstreamer elements will be created as multple plugin binaries, one binary for one element. This is no more the standard method to release since nnstreamer 0.0.3.")
 ENDIF(SINGLE_BINARY)
 
-ADD_DEFINITIONS(-DVERSION="0.0.3")
+SET(VERSION "0.0.3")
+ADD_DEFINITIONS(-DVERSION="${VERSION}")
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(EXEC_PREFIX "${PREFIX}/bin")