File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change 11# check_if_header_only_library()
22#
3- # @param SOURCE_LIST The list of source files that a target library uses
4- # @param IS_HEADER_ONLY Returns whether the target library only contains header files
3+ # @param SOURCE_LIST The list of source files that a target library uses.
4+ # @param IS_HEADER_ONLY Returns whether the target library only contains header files.
55function (check_if_header_only_library SOURCE_LIST IS_HEADER_ONLY)
66 set (_LOCAL_SOURCE_LIST "${${SOURCE_LIST} }" )
7+ set (${IS_HEADER_ONLY} FALSE )
78 foreach (src_file IN LISTS _LOCAL_SOURCE_LIST)
8- if (${src_file} MATCHES ".*\\ .(h|hpp|inc )" )
9- list (REMOVE_ITEM _LOCAL_SOURCE_LIST " ${src_file} " )
9+ if (NOT ${src_file} MATCHES ".*\\ .(h|hpp)" )
10+ return (PROPAGATE ${IS_HEADER_ONLY} )
1011 endif ()
1112 endforeach ()
12-
13- if (_LOCAL_SOURCE_LIST STREQUAL "" )
14- set (${IS_HEADER_ONLY} TRUE PARENT_SCOPE)
15- else ()
16- set (${IS_HEADER_ONLY} FALSE PARENT_SCOPE)
17- endif ()
13+ set (${IS_HEADER_ONLY} TRUE PARENT_SCOPE)
1814endfunction ()
1915
2016# Adds a c++20 interface library in the subdirectory NAME with the target NAME and alias
Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.22.1)
22
3+ # Enables return() arguments e.g. return([PROPAGATE <var-name>...])
4+ cmake_policy (SET CMP0140 NEW)
5+
36project (YSTDLIB_CPP LANGUAGES CXX)
47
58set (YSTDLIB_CPP_VERSION "0.0.1" CACHE STRING "Project version." )
You can’t perform that action at this time.
0 commit comments