project(${CMAKE_PROJECT_NAME}_lib) set(HEADER_FILES ./activation_function.hpp ./neural_net.hpp ./utility.hpp ./forward_feed.hpp ) set(SOURCE_FILES ) # Check if any source files exist list(LENGTH SOURCE_FILES SOURCE_FILES_LENGTH) if (SOURCE_FILES_LENGTH GREATER 0) # The library contains header and source files. add_library(${CMAKE_PROJECT_NAME}_lib STATIC ${SOURCE_FILES} ${HEADER_FILES} ) else() # The library only contains header files. add_library(${CMAKE_PROJECT_NAME}_lib INTERFACE) endif()