Skip to content

Commit

Permalink
acceppt .keep file in src/<target_type>/ directories
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Ulmer committed Nov 21, 2024
1 parent 79f5220 commit 027ecb4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ FOREACH(target_type_dir ${target_types})
GET_FILENAME_COMPONENT(target_type ${target_type_dir} NAME)
FILE(GLOB target_directories "${target_type_dir}/*/")
FOREACH(target_directory ${target_directories})
GET_FILENAME_COMPONENT(target_name ${target_directory} NAME)
IF(IS_DIRECTORY ${target_directory})
GET_FILENAME_COMPONENT(target_name ${target_directory} NAME)
MESSAGE("Creating build instructions for ${target_name}")
FILE(GLOB target_sources "${target_directory}/*.cpp" "${target_directory}/*.c")
FILE(GLOB target_headers "${target_directory}/include/*.*")
Expand All @@ -65,7 +65,11 @@ FOREACH(target_type_dir ${target_types})
TARGET_INCLUDE_DIRECTORIES(${target_name} PRIVATE ${target_directory}/include)
ADD_DEPS(${target_directory})
ELSE()
MESSAGE(FATAL_ERROR "${target_directory} is no directory")
STRING(COMPARE EQUAL ${target_name} .keep is_keep)
IF(${is_keep})
ELSE()
MESSAGE(FATAL_ERROR "${target_directory} is no directory")
ENDIF()
ENDIF()
ENDFOREACH()
ELSE()
Expand Down Expand Up @@ -105,7 +109,7 @@ FOREACH(test_type_dir ${test_types})
MESSAGE(FATAL_ERROR "Error: unknown test type ${test_type}")
ENDIF()
ELSE()
string(COMPARE EQUAL ${test_target} .keep is_keep)
STRING(COMPARE EQUAL ${test_target} .keep is_keep)
IF(${is_keep})
ELSE()
MESSAGE(FATAL_ERROR "${test_target_dir} is no directory")
Expand Down

0 comments on commit 027ecb4

Please sign in to comment.