Mercurial > hg > orthanc-stone
annotate Resources/CMake/Utilities.cmake @ 621:8adc8cfb50c7
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 07 May 2019 11:59:46 +0200 |
parents | 5055031f4a06 |
children | dc5acb03ad93 |
rev | line source |
---|---|
466
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
1 |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
2 |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
3 macro(GetFilenameFromPath TargetVariable Path) |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
4 #message(STATUS "GetFilenameFromPath (1): Path = ${Path} TargetVariable = ${${TargetVariable}}") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
5 string(REPLACE "\\" "/" PathWithFwdSlashes "${Path}") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
6 string(REGEX REPLACE "^.*/" "" ${TargetVariable} "${PathWithFwdSlashes}") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
7 #message(STATUS "GetFilenameFromPath (2): Path = ${Path} Path = ${PathWithFwdSlashes} TargetVariable = ${TargetVariable}") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
8 endmacro() |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
9 |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
10 macro(GetFilePathWithoutLastExtension TargetVariable FilePath) |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
11 string(REGEX REPLACE "(^.*)\\.([^\\.]+)" "\\1" ${TargetVariable} "${FilePath}") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
12 #message(STATUS "GetFileNameWithoutLastExtension: FilePath = ${FilePath} TargetVariable = ${${TargetVariable}}") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
13 endmacro() |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
14 |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
15 macro(Test_GetFilePathWithoutLastExtension) |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
16 set(tmp "/prout/zi/goui.goui.cpp") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
17 GetFilePathWithoutLastExtension(TargetVariable "${tmp}") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
18 if(NOT ("${TargetVariable}" STREQUAL "/prout/zi/goui.goui")) |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
19 message(FATAL_ERROR "Test_GetFilePathWithoutLastExtension failed (1)") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
20 else() |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
21 #message(STATUS "Test_GetFilePathWithoutLastExtension: <<OK>>") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
22 endif() |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
23 endmacro() |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
24 |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
25 Test_GetFilePathWithoutLastExtension() |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
26 |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
27 macro(Test_GetFilenameFromPath) |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
28 set(tmp "/prout/../../dada/zi/goui.goui.cpp") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
29 GetFilenameFromPath(TargetVariable "${tmp}") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
30 if(NOT ("${TargetVariable}" STREQUAL "goui.goui.cpp")) |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
31 message(FATAL_ERROR "Test_GetFilenameFromPath failed") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
32 else() |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
33 #message(STATUS "Test_GetFilenameFromPath: <<OK>>") |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
34 endif() |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
35 endmacro() |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
36 |
5055031f4a06
- Added browserify to build. This allows using require calls for modules that
bgo-osimis
parents:
diff
changeset
|
37 Test_GetFilenameFromPath() |