File tree 3 files changed +14
-9
lines changed
3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.7 FATAL_ERROR)
2
2
3
- project (fable
4
- VERSION 1.0.0
5
- LANGUAGES CXX
6
- )
3
+ project (fable LANGUAGES CXX)
7
4
8
5
set (target fable)
9
6
set (alias fable::fable)
@@ -29,7 +26,7 @@ add_library(${alias} ALIAS ${target})
29
26
set_target_properties (${target} PROPERTIES
30
27
CXX_STANDARD 14
31
28
CXX_STANDARD_REQUIRED ON
32
- VERSION ${PROJECT_VERSION }
29
+ VERSION ${FABLE_VERSION }
33
30
)
34
31
target_include_directories (${target}
35
32
PUBLIC
Original file line number Diff line number Diff line change 1
- import os
2
-
1
+ import os .path
3
2
from conans import ConanFile , CMake , tools
4
3
5
4
6
5
class Fable (ConanFile ):
7
6
name = "fable"
8
- version = "1.0.0"
9
7
license = "Apache-2.0"
10
8
url = "https://github.com/eclipse/cloe"
11
9
description = "JSON schema and configuration library"
@@ -35,6 +33,13 @@ class Fable(ConanFile):
35
33
36
34
_cmake = None
37
35
36
+ def _project_version (self ):
37
+ version_file = os .path .join (self .recipe_folder , ".." , "VERSION" )
38
+ return tools .load (version_file ).strip ()
39
+
40
+ def set_version (self ):
41
+ self .version = self ._project_version ()
42
+
38
43
def build_requirements (self ):
39
44
if self .options .test :
40
45
self .build_requires ("gtest/[~1.10]" )
@@ -44,6 +49,7 @@ def _configure_cmake(self):
44
49
return self ._cmake
45
50
self ._cmake = CMake (self )
46
51
self ._cmake .definitions ["CMAKE_EXPORT_COMPILE_COMMANDS" ] = True
52
+ self ._cmake .definitions ["FABLE_VERSION" ] = self .version
47
53
self ._cmake .definitions ["BuildTests" ] = self .options .test
48
54
self ._cmake .configure ()
49
55
return self ._cmake
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ class CloeRuntime(ConanFile):
33
33
"inja/[~=3.0.0]" ,
34
34
"spdlog/[~=1.5.0]" ,
35
35
"incbin/[~=1.74.0]@cloe/stable" ,
36
- "fable/1.0.0@cloe/develop" ,
37
36
]
38
37
39
38
_cmake = None
@@ -45,6 +44,9 @@ def _project_version(self):
45
44
def set_version (self ):
46
45
self .version = self ._project_version ()
47
46
47
+ def requirements (self ):
48
+ self .requires ("fable/{}@cloe/develop" .format (self .version ))
49
+
48
50
def build_requirements (self ):
49
51
if self .options .test :
50
52
self .build_requires ("gtest/[~1.10]" )
You can’t perform that action at this time.
0 commit comments