|
6 | 6 | # Resource generator |
7 | 7 | #---------------------------------------------- |
8 | 8 |
|
9 | | -add_executable(nfx-resourcegenerator-cli |
10 | | - src/resourcefenerator-cli.cpp |
11 | | -) |
12 | | -set_target_properties(nfx-resourcegenerator-cli PROPERTIES |
13 | | - CXX_STANDARD 20 |
14 | | - CXX_STANDARD_REQUIRED ON |
15 | | - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin" |
16 | | -) |
17 | | -add_executable(nfx::resourcegen ALIAS nfx-resourcegenerator-cli) |
| 9 | +if(NOT TARGET nfx-resourcegenerator-cli) |
| 10 | + add_executable(nfx-resourcegenerator-cli |
| 11 | + src/resourcefenerator-cli.cpp |
| 12 | + ) |
| 13 | + set_target_properties(nfx-resourcegenerator-cli PROPERTIES |
| 14 | + CXX_STANDARD 20 |
| 15 | + CXX_STANDARD_REQUIRED ON |
| 16 | + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin" |
| 17 | + ) |
| 18 | + add_executable(nfx::resourcegen ALIAS nfx-resourcegenerator-cli) |
| 19 | +endif() |
18 | 20 |
|
19 | 21 | #---------------------------------------------- |
20 | 22 | # Header-only library |
21 | 23 | #---------------------------------------------- |
22 | 24 |
|
23 | | -add_library(nfx-resource INTERFACE) |
24 | | -add_library(nfx::resource ALIAS nfx-resource) |
| 25 | +if(NOT TARGET nfx-resource) |
| 26 | + add_library(nfx-resource INTERFACE) |
| 27 | + add_library(nfx::resource ALIAS nfx-resource) |
25 | 28 |
|
26 | | -target_include_directories(nfx-resource |
27 | | - INTERFACE |
28 | | - $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> |
29 | | - $<INSTALL_INTERFACE:include> |
30 | | -) |
| 29 | + target_include_directories(nfx-resource |
| 30 | + INTERFACE |
| 31 | + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> |
| 32 | + $<INSTALL_INTERFACE:include> |
| 33 | + ) |
31 | 34 |
|
32 | | -target_compile_features(nfx-resource INTERFACE cxx_std_20) |
| 35 | + target_compile_features(nfx-resource INTERFACE cxx_std_20) |
| 36 | +endif() |
0 commit comments