comparison Resources/CMake/Utilities.cmake @ 466:5055031f4a06 bgo-commands-codegen

- Added browserify to build. This allows using require calls for modules that work with tsc compiler. - removed older stuff related to Protocol Buffers and Flatbuffers - changed triple-slash references to import statements - module prefixes are now added at call sites - added cmake module for filename handling - switched to Ninja for sample build - Added virtual dtor in ICommand
author bgo-osimis
date Mon, 11 Feb 2019 16:00:04 +0100
parents
children dc5acb03ad93
comparison
equal deleted inserted replaced
448:cc47e6eaefb0 466:5055031f4a06
1
2
3 macro(GetFilenameFromPath TargetVariable Path)
4 #message(STATUS "GetFilenameFromPath (1): Path = ${Path} TargetVariable = ${${TargetVariable}}")
5 string(REPLACE "\\" "/" PathWithFwdSlashes "${Path}")
6 string(REGEX REPLACE "^.*/" "" ${TargetVariable} "${PathWithFwdSlashes}")
7 #message(STATUS "GetFilenameFromPath (2): Path = ${Path} Path = ${PathWithFwdSlashes} TargetVariable = ${TargetVariable}")
8 endmacro()
9
10 macro(GetFilePathWithoutLastExtension TargetVariable FilePath)
11 string(REGEX REPLACE "(^.*)\\.([^\\.]+)" "\\1" ${TargetVariable} "${FilePath}")
12 #message(STATUS "GetFileNameWithoutLastExtension: FilePath = ${FilePath} TargetVariable = ${${TargetVariable}}")
13 endmacro()
14
15 macro(Test_GetFilePathWithoutLastExtension)
16 set(tmp "/prout/zi/goui.goui.cpp")
17 GetFilePathWithoutLastExtension(TargetVariable "${tmp}")
18 if(NOT ("${TargetVariable}" STREQUAL "/prout/zi/goui.goui"))
19 message(FATAL_ERROR "Test_GetFilePathWithoutLastExtension failed (1)")
20 else()
21 #message(STATUS "Test_GetFilePathWithoutLastExtension: <<OK>>")
22 endif()
23 endmacro()
24
25 Test_GetFilePathWithoutLastExtension()
26
27 macro(Test_GetFilenameFromPath)
28 set(tmp "/prout/../../dada/zi/goui.goui.cpp")
29 GetFilenameFromPath(TargetVariable "${tmp}")
30 if(NOT ("${TargetVariable}" STREQUAL "goui.goui.cpp"))
31 message(FATAL_ERROR "Test_GetFilenameFromPath failed")
32 else()
33 #message(STATUS "Test_GetFilenameFromPath: <<OK>>")
34 endif()
35 endmacro()
36
37 Test_GetFilenameFromPath()