build: replace deprecated cmake features with their modern alternatives

- Use DIRECTORY instead of PATH in get_filename_component
- Use COMPILE_OPTIONS instead of COMPILE_FLAGS. COMPILE_FLAGS is treated
  as a single string while COMPILE_OPTIONS is a list, meaning that cmake
  will take care of any escaping and quoting automatically.
This commit is contained in:
Dundar Goc
2022-06-22 20:06:15 +02:00
parent cc1ceebf8f
commit 6e2c6114f9
4 changed files with 8 additions and 14 deletions

View File

@@ -16,7 +16,7 @@ endforeach()
foreach(hfile ${PRE_HEADERS})
string(REGEX REPLACE ^pre/ post/ post_hfile ${hfile})
get_filename_component(hdir ${CMAKE_CURRENT_BINARY_DIR}/${post_hfile} PATH)
get_filename_component(hdir ${CMAKE_CURRENT_BINARY_DIR}/${post_hfile} DIRECTORY)
file(MAKE_DIRECTORY ${hdir})
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${post_hfile}