Skip to content

Commit fbb9056

Browse files
authored
Merge pull request #163 from SK83RJOSH/project-options-src-dir [skip ci]
2 parents cad19a9 + c96bdff commit fbb9056

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/Common.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
include_guard()
22

3+
# This function sets ProjectOptions_SRC_DIR using the current lists path
4+
macro(set_project_options_src_dir)
5+
get_directory_property(LISTFILE_STACK LISTFILE_STACK)
6+
list(POP_BACK LISTFILE_STACK _LIST_FILE)
7+
cmake_path(GET _LIST_FILE PARENT_PATH ProjectOptions_SRC_DIR)
8+
endmacro()
9+
310
# Common project settings run by default for all the projects that call `project_options()`
411
macro(common_project_options)
12+
set_project_options_src_dir()
13+
message(DEBUG "${ProjectOptions_SRC_DIR}")
14+
515
include("${ProjectOptions_SRC_DIR}/PreventInSourceBuilds.cmake")
616
assure_out_of_source_builds()
717

0 commit comments

Comments
 (0)